File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Deprecations and removed features
1212Regression fixes:
1313-----------------
1414- (from 4.4.0) Vi mode ``d,f `` key binding did not work (:issue: `12417 `).
15+ - (from 4.4.0) Vi mode ``c,w `` key binding wrongly deleted trailing spaces (:issue: `12443 `).
1516- (from 4.4.0) Vi mode crash on ``c,i,w `` after accepting autosuggestion (:issue: `12430 `).
1617- (from 4.4.0) ``fish_vi_key_bindings `` called with a mode argument produced an error (:issue: `12413 `).
1718- (from 4.0.0) Build on Illumos (:issue: `12410 `).
Original file line number Diff line number Diff line change @@ -93,10 +93,12 @@ function fish_vi_exec_motion
9393 set motion (string replace -- forward kill $motion )
9494 end
9595 end
96+ set -l motion_cmd
9697 switch $motion [1]
9798 case commandline
99+ set motion_cmd $motion
98100 case ' *'
99- set motion commandline -f $motion
101+ set motion_cmd commandline -f $motion
100102 end
101103 if $use_selection
102104 commandline -f begin -selection
@@ -107,14 +109,22 @@ function fish_vi_exec_motion
107109 switch $_ _fish_vi_operator
108110 case delete
109111 for i in (seq $total )
110- $motion || { set ok false ; break }
112+ $motion_cmd || { set ok false ; break }
111113 end
112114 if $ok && $use_selection
113115 commandline -f kill -selection
114116 end
115117 case change
116- for i in (seq $total )
117- $motion || { set ok false ; break }
118+ switch $motion [1]
119+ case kill -word-vi
120+ for i in (seq (math $total - 1))
121+ $motion_cmd
122+ end
123+ commandline -f kill -word
124+ case ' *'
125+ for i in (seq $total )
126+ $motion_cmd || { set ok false ; break }
127+ end
118128 end
119129 if $ok
120130 if $use_selection
@@ -124,7 +134,7 @@ function fish_vi_exec_motion
124134 end
125135 case yank
126136 for i in (seq $total )
127- $motion || { set ok false ; break }
137+ $motion_cmd || { set ok false ; break }
128138 end
129139 if $ok
130140 if $use_selection
@@ -135,7 +145,7 @@ function fish_vi_exec_motion
135145 end
136146 case swap-case
137147 for i in (seq $total )
138- $motion || { set ok false ; break }
148+ $motion_cmd || { set ok false ; break }
139149 end
140150 if $ok
141151 if set -q swap_case_hack[1]
Original file line number Diff line number Diff line change 304304send ("0w" )
305305send ("c2wREPLACED" )
306306sendline ("" )
307- expect_prompt ("echo REPLACEDthree " )
307+ expect_prompt ("echo REPLACED three " )
308308
309309# Test escape cancelling count
310310send ("echo one two three" )
460460send ("echo abc def" )
461461send ("\033 " )
462462sleep (0.200 )
463- send ("0wcwXXX\r " ) # Move to 'abc', 'cw' deletes 'abc ' (including space) , type 'XXX'
463+ send ("0wcwXXX\r " ) # Move to 'abc', 'cw' deletes 'abc' , type 'XXX'
464464expect_prompt (
465- "\r \n .*XXXdef \r \n " , unmatched = "vi mode 'cw' should delete to start of next word"
465+ "\r \n .*XXX def \r \n " , unmatched = "vi mode 'cw' should delete to start of next word"
466466)
467467
468468# Test 'ce' - change to end of word (like vim's 'de')
You can’t perform that action at this time.
0 commit comments