fix(cli): restore ? shortcuts in vim normal mode

This commit is contained in:
YingchaoX 2026-04-04 22:24:56 +08:00
parent 3bce84d5da
commit 0be974b1d7
3 changed files with 53 additions and 0 deletions

View file

@ -1300,6 +1300,23 @@ describe('InputPrompt', () => {
expect(mockBuffer.handleInput).toHaveBeenCalled();
unmount();
});
it('should toggle shortcuts when vim passes through ? on an empty prompt', async () => {
props.vimHandleInput = vi.fn().mockReturnValue(false);
props.onToggleShortcuts = vi.fn();
const { stdin, unmount } = renderWithProviders(
<InputPrompt {...props} />,
);
await wait();
stdin.write('?');
await wait();
expect(props.vimHandleInput).toHaveBeenCalled();
expect(props.onToggleShortcuts).toHaveBeenCalled();
unmount();
});
});
describe('unfocused paste', () => {