mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2025-01-30 09:47:12 +08:00
42f5a06f7f
Specific case where this matters is following: Be in vi insert mode with some text in the buffer and the cursor at the end of the buffer. Press `esc` to trigger `vi-cmd-mode widget`, then before the cursor moves (KEYTIMEOUT), press `h` to trigger `vi-backward-char` widget. When `vi-cmd-mode` original widget exits, KEYS_QUEUED_COUNT will be non-zero and the suggestion will be lost.
22 lines
463 B
Ruby
22 lines
463 B
Ruby
describe 'when using vi mode' do
|
|
let(:before_sourcing) do
|
|
-> do
|
|
session.run_command('bindkey -v')
|
|
end
|
|
end
|
|
|
|
describe 'moving the cursor after exiting insert mode' do
|
|
it 'should not clear the current suggestion' do
|
|
with_history('foobar foo') do
|
|
session.
|
|
send_string('foo').
|
|
send_keys('escape').
|
|
send_keys('h')
|
|
|
|
wait_for { session.content }.to eq('foobar foo')
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|