mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(api): do not update grid position in nvim_win_set_cursor (#28235)
Revert commit c971f538ab
.
Forcing grid cursor position will need a new API like originally proposed in #27858.
This commit is contained in:
parent
9e1bbb9813
commit
344906a08f
@ -148,7 +148,7 @@ void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err)
|
|||||||
switchwin_T switchwin;
|
switchwin_T switchwin;
|
||||||
switch_win(&switchwin, win, NULL, true);
|
switch_win(&switchwin, win, NULL, true);
|
||||||
update_topline(curwin);
|
update_topline(curwin);
|
||||||
setcursor_mayforce(true);
|
validate_cursor(curwin);
|
||||||
restore_win(&switchwin, true);
|
restore_win(&switchwin, true);
|
||||||
|
|
||||||
redraw_later(win, UPD_VALID);
|
redraw_later(win, UPD_VALID);
|
||||||
|
@ -257,21 +257,6 @@ describe('API/win', function()
|
|||||||
|
|
||||||
-- curwin didn't change back
|
-- curwin didn't change back
|
||||||
neq(win, curwin())
|
neq(win, curwin())
|
||||||
|
|
||||||
-- shows updated position after getchar() #20793
|
|
||||||
feed(':call getchar()<CR>')
|
|
||||||
api.nvim_win_set_cursor(win, { 1, 5 })
|
|
||||||
screen:expect {
|
|
||||||
grid = [[
|
|
||||||
|
|
|
||||||
{1:~ }|*2
|
|
||||||
{2:[No Name] }|
|
|
||||||
prolo^gue |
|
|
||||||
|*2
|
|
||||||
{3:[No Name] [+] }|
|
|
||||||
:call getchar() |
|
|
||||||
]],
|
|
||||||
}
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('remembers what column it wants to be in', function()
|
it('remembers what column it wants to be in', function()
|
||||||
|
@ -825,7 +825,8 @@ local function test_cmdline(linegrid)
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('does not move cursor to curwin #20309', function()
|
-- Needs new API
|
||||||
|
pending('does not move cursor to curwin #20309', function()
|
||||||
local win = api.nvim_get_current_win()
|
local win = api.nvim_get_current_win()
|
||||||
command('norm icmdlinewin')
|
command('norm icmdlinewin')
|
||||||
command('new')
|
command('new')
|
||||||
|
Loading…
Reference in New Issue
Block a user