mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.4026: ml_get error with specific win_execute() command
Problem: ml_get error with specific win_execute() command. (Sean Dewar)
Solution: Check cursor and Visual area are OK.
e664a32701
This commit is contained in:
parent
f326c9a77d
commit
d984a8d130
@ -2193,6 +2193,13 @@ static void f_win_execute(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
if (win_valid(wp) && !equalpos(curpos, wp->w_cursor)) {
|
if (win_valid(wp) && !equalpos(curpos, wp->w_cursor)) {
|
||||||
wp->w_redr_status = true;
|
wp->w_redr_status = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In case the command moved the cursor or changed the Visual area,
|
||||||
|
// check it is valid.
|
||||||
|
check_cursor();
|
||||||
|
if (VIsual_active) {
|
||||||
|
check_pos(curbuf, &VIsual);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,8 +152,23 @@ func Test_win_execute_visual_redraw()
|
|||||||
call setline(1, ['a', 'b', 'c'])
|
call setline(1, ['a', 'b', 'c'])
|
||||||
new
|
new
|
||||||
wincmd p
|
wincmd p
|
||||||
|
" start Visual in current window, redraw in other window with fewer lines
|
||||||
call feedkeys("G\<C-V>", 'txn')
|
call feedkeys("G\<C-V>", 'txn')
|
||||||
call win_execute(winnr('#')->win_getid(), 'redraw')
|
call win_execute(winnr('#')->win_getid(), 'redraw')
|
||||||
|
call feedkeys("\<Esc>", 'txn')
|
||||||
|
bwipe!
|
||||||
|
bwipe!
|
||||||
|
|
||||||
|
enew
|
||||||
|
new
|
||||||
|
call setline(1, ['a', 'b', 'c'])
|
||||||
|
let winid = win_getid()
|
||||||
|
wincmd p
|
||||||
|
" start Visual in current window, extend it in other window with more lines
|
||||||
|
call feedkeys("\<C-V>", 'txn')
|
||||||
|
call win_execute(winid, 'call feedkeys("G\<C-V>", ''txn'')')
|
||||||
|
redraw
|
||||||
|
|
||||||
bwipe!
|
bwipe!
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
Loading…
Reference in New Issue
Block a user