diff --git a/src/nvim/window.c b/src/nvim/window.c index 9837672e62..00076b0a45 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -5503,6 +5503,7 @@ void win_setheight_win(int height, win_T *win) msg_row = row; msg_col = 0; redraw_all_later(NOT_VALID); + redraw_cmdline = true; } } diff --git a/test/functional/ui/global_statusline_spec.lua b/test/functional/ui/statusline_spec.lua similarity index 90% rename from test/functional/ui/global_statusline_spec.lua rename to test/functional/ui/statusline_spec.lua index f6821ec589..3706a5589e 100644 --- a/test/functional/ui/global_statusline_spec.lua +++ b/test/functional/ui/statusline_spec.lua @@ -1,7 +1,13 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') -local clear, command, feed = helpers.clear, helpers.command, helpers.feed -local eq, funcs, meths = helpers.eq, helpers.funcs, helpers.meths +local assert_alive = helpers.assert_alive +local clear = helpers.clear +local command = helpers.command +local feed = helpers.feed +local eq = helpers.eq +local funcs = helpers.funcs +local meths = helpers.meths +local exec = helpers.exec describe('global statusline', function() local screen @@ -258,3 +264,48 @@ describe('global statusline', function() eq(1, meths.get_option('cmdheight')) end) end) + +it('statusline does not crash if it has Arabic characters #19447', function() + clear() + meths.set_option('statusline', 'غً') + meths.set_option('laststatus', 2) + command('redraw!') + assert_alive() +end) + +it('statusline is redrawn with :resize from mapping #19629', function() + clear() + local screen = Screen.new(40, 8) + screen:set_default_attr_ids({ + [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [1] = {bold = true, reverse = true}, -- StatusLine + }) + screen:attach() + exec([[ + set laststatus=2 + nnoremap resize -1 + nnoremap resize +1 + ]]) + feed('') + screen:expect([[ + ^ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {1:[No Name] }| + | + | + ]]) + feed('') + screen:expect([[ + ^ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {1:[No Name] }| + | + ]]) +end)