diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2024-03-14 23:55:32 +0100 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2024-03-15 09:15:50 +0100 |
commit | c971f538ab87b537ae4c97bd44167661c5691a2d (patch) | |
tree | fd0d59de9b23e2676010aabc4652b4bc9417d979 /test/functional/api/window_spec.lua | |
parent | ca7dd33fa783181d62b0573082d2e691fcfc29d2 (diff) | |
download | rneovim-c971f538ab87b537ae4c97bd44167661c5691a2d.tar.gz rneovim-c971f538ab87b537ae4c97bd44167661c5691a2d.tar.bz2 rneovim-c971f538ab87b537ae4c97bd44167661c5691a2d.zip |
fix(api): update grid cursor in nvim_win_set_cursor()
Problem: Cursor position set by nvim_win_set_cursor() is not reflected
on the screen when followed by a blocking call like getchar().
Solution: Immediately update the cursor position on the grid.
Diffstat (limited to 'test/functional/api/window_spec.lua')
-rw-r--r-- | test/functional/api/window_spec.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua index a10c8f48ef..721148faaa 100644 --- a/test/functional/api/window_spec.lua +++ b/test/functional/api/window_spec.lua @@ -219,6 +219,21 @@ describe('API/win', function() -- curwin didn't change back 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) it('remembers what column it wants to be in', function() |