feature: client: key: vim: open editor with 'e'

This commit is contained in:
coderaiser 2023-01-29 18:03:58 +02:00
parent a27e4ecf61
commit fd1eb1dc27
4 changed files with 26 additions and 0 deletions

View file

@ -37,6 +37,10 @@ const getOperations = (event) => ({
CloudCmd.Terminal.show();
},
edit: () => {
CloudCmd.EditFileVim.show();
},
copy: () => {
DOM.Buffer.copy();
DOM.unselectFiles();

View file

@ -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();
});

View file

@ -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();