File tree Expand file tree Collapse file tree 5 files changed +17
-5
lines changed Expand file tree Collapse file tree 5 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## v0.6.3
4
+ - Fixed bug moving cursor to end of buffer after accepting suggestion (#453 )
5
+
3
6
## v0.6.2
4
7
- Fixed bug deleting the last character in the buffer in vi mode (#450 )
5
8
- Degrade gracefully when user doesn't have ` zsh/system ` module installed (#447 )
Original file line number Diff line number Diff line change 1
- v0.6.2
1
+ v0.6.3
Original file line number Diff line number Diff line change 5
5
context 'when added to ZSH_AUTOSUGGEST_ACCEPT_WIDGETS' do
6
6
let ( :options ) { [ "ZSH_AUTOSUGGEST_ACCEPT_WIDGETS+=(#{ widget } )" ] }
7
7
8
- it 'accepts the suggestion when invoked' do
8
+ it 'accepts the suggestion and moves the cursor to the end of the buffer when invoked' do
9
9
with_history ( 'echo hello' ) do
10
10
session . send_string ( 'e' )
11
11
wait_for { session . content } . to eq ( 'echo hello' )
12
12
session . send_keys ( 'C-b' )
13
13
wait_for { session . content ( esc_seqs : true ) } . to eq ( 'echo hello' )
14
+ wait_for { session . cursor } . to eq ( [ 10 , 0 ] )
14
15
end
15
16
end
16
17
end
Original file line number Diff line number Diff line change @@ -136,7 +136,11 @@ _zsh_autosuggest_accept() {
136
136
unset POSTDISPLAY
137
137
138
138
# Move the cursor to the end of the buffer
139
- CURSOR=${max_cursor_pos}
139
+ if [[ " $KEYMAP " = " vicmd" ]]; then
140
+ CURSOR=$(( $# BUFFER - 1 ))
141
+ else
142
+ CURSOR=$# BUFFER
143
+ fi
140
144
fi
141
145
142
146
_zsh_autosuggest_invoke_original_widget $@
Original file line number Diff line number Diff line change 1
1
# Fish-like fast/unobtrusive autosuggestions for zsh.
2
2
# https://github.com/zsh-users/zsh-autosuggestions
3
- # v0.6.2
3
+ # v0.6.3
4
4
# Copyright (c) 2013 Thiago de Arruda
5
5
# Copyright (c) 2016-2019 Eric Freese
6
6
#
@@ -398,7 +398,11 @@ _zsh_autosuggest_accept() {
398
398
unset POSTDISPLAY
399
399
400
400
# Move the cursor to the end of the buffer
401
- CURSOR=${max_cursor_pos}
401
+ if [[ " $KEYMAP " = " vicmd" ]]; then
402
+ CURSOR=$(( $# BUFFER - 1 ))
403
+ else
404
+ CURSOR=$# BUFFER
405
+ fi
402
406
fi
403
407
404
408
_zsh_autosuggest_invoke_original_widget $@
You can’t perform that action at this time.
0 commit comments