From 037ea6e786b5d05f4a8965e4c2ba6aa60ec7c01a Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Wed, 10 Apr 2024 11:42:46 +0200 Subject: feat(api): add nvim__redraw for more granular redrawing Experimental and subject to future changes. Add a way to redraw certain elements that are not redrawn while Nvim is waiting for input, or currently have no API to do so. This API covers all that can be done with the :redraw* commands, in addition to the following new features: - Immediately move the cursor to a (non-current) window. - Target a specific window or buffer to mark for redraw. - Mark a buffer range for redraw (replaces nvim__buf_redraw_range()). - Redraw the 'statuscolumn'. --- test/functional/ui/cmdline_spec.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/functional/ui/cmdline_spec.lua') diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua index b3ec5f7535..6edfb4a49c 100644 --- a/test/functional/ui/cmdline_spec.lua +++ b/test/functional/ui/cmdline_spec.lua @@ -827,14 +827,14 @@ local function test_cmdline(linegrid) ]]) end) - -- Needs new API - pending('does not move cursor to curwin #20309', function() + it('does not move cursor to curwin #20309', function() local win = api.nvim_get_current_win() command('norm icmdlinewin') command('new') command('norm icurwin') feed(':') api.nvim_win_set_cursor(win, { 1, 7 }) + api.nvim__redraw({ win = win, cursor = true }) screen:expect { grid = [[ curwin | -- cgit