mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
vim-patch:8.2.2425: cursor on invalid line with range and :substitute
Problem: Cursor on invalid line with range and :substitute.
Solution: Do not move the cursor when skipping commands. (closes vim/vim#3434)
df2c2988bb
Cherry-pick Test_for_invalid() from patch v8.1.0736.
This commit is contained in:
@@ -3126,6 +3126,9 @@ static bool sub_joining_lines(exarg_T *eap, char_u *pat, char_u *sub,
|
|||||||
|| *cmd == 'l'
|
|| *cmd == 'l'
|
||||||
|| *cmd == 'p'
|
|| *cmd == 'p'
|
||||||
|| *cmd == '#')))) {
|
|| *cmd == '#')))) {
|
||||||
|
if (eap->skip) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
curwin->w_cursor.lnum = eap->line1;
|
curwin->w_cursor.lnum = eap->line1;
|
||||||
if (*cmd == 'l') {
|
if (*cmd == 'l') {
|
||||||
eap->flags = EXFLAG_LIST;
|
eap->flags = EXFLAG_LIST;
|
||||||
|
@@ -22,6 +22,17 @@ func Test_E963()
|
|||||||
call assert_equal(v_o, v:oldfiles)
|
call assert_equal(v_o, v:oldfiles)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_for_invalid()
|
||||||
|
call assert_fails("for x in 99", 'E714:')
|
||||||
|
call assert_fails("for x in 'asdf'", 'E714:')
|
||||||
|
call assert_fails("for x in {'a': 9}", 'E714:')
|
||||||
|
|
||||||
|
if 0
|
||||||
|
/1/5/2/s/\n
|
||||||
|
endif
|
||||||
|
redraw
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_mkdir_p()
|
func Test_mkdir_p()
|
||||||
call mkdir('Xmkdir/nested', 'p')
|
call mkdir('Xmkdir/nested', 'p')
|
||||||
call assert_true(isdirectory('Xmkdir/nested'))
|
call assert_true(isdirectory('Xmkdir/nested'))
|
||||||
|
Reference in New Issue
Block a user