mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
fix: client: vim: space
This commit is contained in:
parent
e3f89e8845
commit
cc134464a4
2 changed files with 22 additions and 1 deletions
|
|
@ -21,7 +21,7 @@ const rmFirst = (a) => {
|
|||
|
||||
const noop = () => {};
|
||||
|
||||
module.exports = (key, operations) => {
|
||||
module.exports = (key, operations = {}) => {
|
||||
const prevStore = store();
|
||||
const isVisual = visual();
|
||||
const value = store(prevStore.concat(key));
|
||||
|
|
@ -169,6 +169,9 @@ module.exports = (key, operations) => {
|
|||
findPrevious();
|
||||
return end();
|
||||
}
|
||||
|
||||
if (key === ' ')
|
||||
return end();
|
||||
};
|
||||
|
||||
function handleDelete(prevStore) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,24 @@ test('vim: no operations', (t) => {
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('vim: space', (t) => {
|
||||
const moveNext = stub();
|
||||
|
||||
vim(' ');
|
||||
vim('j', {
|
||||
moveNext,
|
||||
});
|
||||
|
||||
const args = [{
|
||||
count: 1,
|
||||
isDelete: false,
|
||||
isVisual: false,
|
||||
}];
|
||||
|
||||
t.calledWith(moveNext, args);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('vim: ^', (t) => {
|
||||
const movePrevious = stub();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue