mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature: client: key: vim: open editor with 'e'
This commit is contained in:
parent
a27e4ecf61
commit
fd1eb1dc27
4 changed files with 26 additions and 0 deletions
|
|
@ -37,6 +37,10 @@ const getOperations = (event) => ({
|
|||
CloudCmd.Terminal.show();
|
||||
},
|
||||
|
||||
edit: () => {
|
||||
CloudCmd.EditFileVim.show();
|
||||
},
|
||||
|
||||
copy: () => {
|
||||
DOM.Buffer.copy();
|
||||
DOM.unselectFiles();
|
||||
|
|
|
|||
|
|
@ -525,3 +525,18 @@ test('cloudcmd: client: vim: terminal', (t) => {
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('cloudcmd: client: vim: edit', (t) => {
|
||||
assign(CloudCmd, {
|
||||
EditFileVim: {
|
||||
show: stub(),
|
||||
},
|
||||
});
|
||||
|
||||
const event = {
|
||||
};
|
||||
vim('e', event);
|
||||
|
||||
t.calledWithNoArgs(CloudCmd.EditFileVim.show);
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ module.exports = (key, operations) => {
|
|||
makeFile = noop,
|
||||
makeDirectory = noop,
|
||||
terminal = noop,
|
||||
edit = noop,
|
||||
} = operations;
|
||||
|
||||
if (key === 'Enter')
|
||||
|
|
@ -108,6 +109,11 @@ module.exports = (key, operations) => {
|
|||
return end();
|
||||
}
|
||||
|
||||
if (value === 'e') {
|
||||
edit();
|
||||
return end();
|
||||
}
|
||||
|
||||
if (value === 'mf') {
|
||||
makeFile();
|
||||
return end();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue