瀏覽代碼
Merge pull request #450 from zsh-users/fixes/vi-delete
Fix deleting last character in vi mode (#302)
pull/451/head
Eric Freese
5 年之前
committed by
GitHub
沒有發現已知的金鑰在資料庫的簽署中
GPG Key ID: 4AEE18F83AFDEB23
共有
3 個文件被更改,包括
16 次插入 和
3 次删除
-
spec/integrations/vi_mode_spec.rb
-
src/widgets.zsh
-
zsh-autosuggestions.zsh
|
|
@ -63,5 +63,18 @@ describe 'when using vi mode' do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
describe '`vi-delete`' do |
|
|
|
it 'should be able to remove the last character in the buffer' do |
|
|
|
skip 'deleting last char did not work below zsh version 5.0.8' if session.zsh_version < Gem::Version.new('5.0.8') |
|
|
|
|
|
|
|
session. |
|
|
|
send_string('echo foo'). |
|
|
|
send_keys('escape'). |
|
|
|
send_keys('d'). |
|
|
|
send_keys('l') |
|
|
|
|
|
|
|
wait_for { session.content }.to eq('echo fo') |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
@ -136,7 +136,7 @@ _zsh_autosuggest_accept() { |
|
|
|
unset POSTDISPLAY |
|
|
|
|
|
|
|
# Move the cursor to the end of the buffer |
|
|
|
CURSOR=${#BUFFER} |
|
|
|
CURSOR=${max_cursor_pos} |
|
|
|
fi |
|
|
|
|
|
|
|
_zsh_autosuggest_invoke_original_widget $@ |
|
|
|
|
|
@ -398,7 +398,7 @@ _zsh_autosuggest_accept() { |
|
|
|
unset POSTDISPLAY |
|
|
|
|
|
|
|
# Move the cursor to the end of the buffer |
|
|
|
CURSOR=${#BUFFER} |
|
|
|
CURSOR=${max_cursor_pos} |
|
|
|
fi |
|
|
|
|
|
|
|
_zsh_autosuggest_invoke_original_widget $@ |
|
|
|