From 80f6d55521cd25e7746e34b899be5532ea88c09b Mon Sep 17 00:00:00 2001 From: quintik <28828855+quintik@users.noreply.github.com> Date: Thu, 13 Apr 2023 06:17:05 -0400 Subject: test(winbar_spec): properly update winbar when 'showcmdloc' is "statusline" Co-authored-by: zeertzjq Co-authored-by: Luuk van Baal --- test/functional/ui/winbar_spec.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'test/functional/ui/winbar_spec.lua') diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua index ece27ec3ff..970f9c3d76 100644 --- a/test/functional/ui/winbar_spec.lua +++ b/test/functional/ui/winbar_spec.lua @@ -114,6 +114,41 @@ describe('winbar', function() {2:[No Name] [No Name] }| | ]]) + -- 'showcmdloc' "statusline" should not interfere with winbar redrawing #23030 + command('set showcmd showcmdloc=statusline') + feed('w') + feed('') + screen:expect([[ + {6:Set Up The Bars }│{6:Set Up The Bars }| + │ | + {3:~ }│{3:~ }| + {3:~ }│{2:[No Name] }| + {3:~ }│{5:Set Up The Bars }| + {3:~ }│^ | + {3:~ }│{3:~ }| + {3:~ }│{4:[No Name] ^W }| + {3:~ }│{6:Set Up The Bars }| + {3:~ }│ | + {3:~ }│{3:~ }| + {2:[No Name] [No Name] }| + | + ]]) + feed('wW') + screen:expect([[ + {6:Set Up The Bars }│{6:Set Up The Bars }| + │ | + {3:~ }│{3:~ }| + {3:~ }│{2:[No Name] }| + {3:~ }│{5:Set Up The Bars }| + {3:~ }│^ | + {3:~ }│{3:~ }| + {3:~ }│{4:[No Name] }| + {3:~ }│{6:Set Up The Bars }| + {3:~ }│ | + {3:~ }│{3:~ }| + {2:[No Name] [No Name] }| + | + ]]) end) it('works when switching value of \'winbar\'', function() -- cgit From 4ecf6fdfd857b52c0bab9a8dbfc760364ac2677b Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 8 May 2023 16:25:03 +0800 Subject: fix(statusline): bail out properly on negative row (#23535) --- test/functional/ui/winbar_spec.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/functional/ui/winbar_spec.lua') diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua index 970f9c3d76..3b79f4328d 100644 --- a/test/functional/ui/winbar_spec.lua +++ b/test/functional/ui/winbar_spec.lua @@ -713,3 +713,26 @@ describe('local winbar with tabs', function() ]]} end) end) + +it('winbar works properly when redrawing is postponed #23534', function() + clear({args = { + '-c', 'set laststatus=2 lazyredraw', + '-c', 'setlocal statusline=(statusline) winbar=(winbar)', + '-c', 'call nvim_input(":")', + }}) + local screen = Screen.new(60, 6) + screen:attach() + screen:set_default_attr_ids({ + [0] = {foreground = Screen.colors.Blue, bold = true}, + [1] = {bold = true}, + [2] = {bold = true, reverse = true}, + }) + screen:expect([[ + {1:(winbar) }| + ^ | + {0:~ }| + {0:~ }| + {2:(statusline) }| + | + ]]) +end) -- cgit From 1fe1bb084d0099fc4f9bfdc11189485d0f74b75a Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 19 Dec 2022 16:37:45 +0000 Subject: refactor(options): deprecate nvim[_buf|_win]_[gs]et_option Co-authored-by: zeertzjq Co-authored-by: famiu --- test/functional/ui/winbar_spec.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/functional/ui/winbar_spec.lua') diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua index 3b79f4328d..78bbcd3a63 100644 --- a/test/functional/ui/winbar_spec.lua +++ b/test/functional/ui/winbar_spec.lua @@ -31,7 +31,7 @@ describe('winbar', function() [10] = {background = Screen.colors.LightGrey, underline = true}, [11] = {background = Screen.colors.LightGrey, underline = true, bold = true, foreground = Screen.colors.Magenta}, }) - meths.set_option('winbar', 'Set Up The Bars') + meths.set_option_value('winbar', 'Set Up The Bars', {}) end) it('works', function() @@ -206,7 +206,7 @@ describe('winbar', function() insert [[ just some random text]] - meths.set_option('winbar', 'Hello, I am a ruler: %l,%c') + meths.set_option_value('winbar', 'Hello, I am a ruler: %l,%c', {}) screen:expect{grid=[[ {1:Hello, I am a ruler: 2,11 }| just some | @@ -450,7 +450,7 @@ describe('winbar', function() | | ]]) - eq(3, meths.get_option('cmdheight')) + eq(3, meths.get_option_value('cmdheight', {})) meths.input_mouse('left', 'drag', '', 1, 11, 10) screen:expect([[ @@ -468,7 +468,7 @@ describe('winbar', function() {2:[No Name] }| | ]]) - eq(1, meths.get_option('cmdheight')) + eq(1, meths.get_option_value('cmdheight', {})) end) it('properly equalizes window height for window-local value', function() -- cgit