fix: client: vim: space

This commit is contained in:
coderaiser 2024-03-29 10:31:23 +02:00
parent e3f89e8845
commit cc134464a4
2 changed files with 22 additions and 1 deletions

View file

@ -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) {

View file

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