Skip to content

Commit cc13446

Browse files
committed
fix: client: vim: space
1 parent e3f89e8 commit cc13446

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

client/key/vim/vim.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const rmFirst = (a) => {
2121

2222
const noop = () => {};
2323

24-
module.exports = (key, operations) => {
24+
module.exports = (key, operations = {}) => {
2525
const prevStore = store();
2626
const isVisual = visual();
2727
const value = store(prevStore.concat(key));
@@ -169,6 +169,9 @@ module.exports = (key, operations) => {
169169
findPrevious();
170170
return end();
171171
}
172+
173+
if (key === ' ')
174+
return end();
172175
};
173176

174177
function handleDelete(prevStore) {

client/key/vim/vim.spec.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,24 @@ test('vim: no operations', (t) => {
1111
t.end();
1212
});
1313

14+
test('vim: space', (t) => {
15+
const moveNext = stub();
16+
17+
vim(' ');
18+
vim('j', {
19+
moveNext,
20+
});
21+
22+
const args = [{
23+
count: 1,
24+
isDelete: false,
25+
isVisual: false,
26+
}];
27+
28+
t.calledWith(moveNext, args);
29+
t.end();
30+
});
31+
1432
test('vim: ^', (t) => {
1533
const movePrevious = stub();
1634

0 commit comments

Comments
 (0)