mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #20775 from shadmansaleh/fix/opt_tal_not_redrawing_tabline
fix: setting tabline option not redrawing tabline
This commit is contained in:
commit
40791f8e82
@ -30,6 +30,7 @@ local type_flags={
|
|||||||
|
|
||||||
local redraw_flags={
|
local redraw_flags={
|
||||||
statuslines='P_RSTAT',
|
statuslines='P_RSTAT',
|
||||||
|
tabline = 'P_RTABL',
|
||||||
current_window='P_RWIN',
|
current_window='P_RWIN',
|
||||||
current_window_only='P_RWINONLY',
|
current_window_only='P_RWINONLY',
|
||||||
current_buffer='P_RBUF',
|
current_buffer='P_RBUF',
|
||||||
|
@ -2648,6 +2648,10 @@ void check_redraw(uint32_t flags)
|
|||||||
status_redraw_all();
|
status_redraw_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((flags & P_RTABL) || all) { // mark tablines dirty
|
||||||
|
redraw_tabline = true;
|
||||||
|
}
|
||||||
|
|
||||||
if ((flags & P_RBUF) || (flags & P_RWIN) || all) {
|
if ((flags & P_RBUF) || (flags & P_RWIN) || all) {
|
||||||
changed_window_setting();
|
changed_window_setting();
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#define P_NO_MKRC 0x200U ///< don't include in :mkvimrc output
|
#define P_NO_MKRC 0x200U ///< don't include in :mkvimrc output
|
||||||
|
|
||||||
// when option changed, what to display:
|
// when option changed, what to display:
|
||||||
|
#define P_RTABL 0x800U ///< redraw tabline
|
||||||
#define P_RSTAT 0x1000U ///< redraw status lines
|
#define P_RSTAT 0x1000U ///< redraw status lines
|
||||||
#define P_RWIN 0x2000U ///< redraw current window and recompute text
|
#define P_RWIN 0x2000U ///< redraw current window and recompute text
|
||||||
#define P_RBUF 0x4000U ///< redraw current buffer and recompute text
|
#define P_RBUF 0x4000U ///< redraw current buffer and recompute text
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
-- types: bool, number, string
|
-- types: bool, number, string
|
||||||
-- lists: (nil), comma, onecomma, flags, flagscomma
|
-- lists: (nil), comma, onecomma, flags, flagscomma
|
||||||
-- scopes: global, buffer, window
|
-- scopes: global, buffer, window
|
||||||
-- redraw options: statuslines, current_window, curent_window_only,
|
-- redraw options: statuslines, tabline, current_window, curent_window_only,
|
||||||
-- current_buffer, all_windows, curswant
|
-- current_buffer, all_windows, curswant
|
||||||
-- defaults: {condition=#if condition, if_true=default, if_false=default}
|
-- defaults: {condition=#if condition, if_true=default, if_false=default}
|
||||||
-- #if condition:
|
-- #if condition:
|
||||||
@ -2407,7 +2407,7 @@ return {
|
|||||||
short_desc=N_("custom format for the console tab pages line"),
|
short_desc=N_("custom format for the console tab pages line"),
|
||||||
type='string', scope={'global'},
|
type='string', scope={'global'},
|
||||||
modelineexpr=true,
|
modelineexpr=true,
|
||||||
redraw={'statuslines'},
|
redraw={'tabline'},
|
||||||
varname='p_tal',
|
varname='p_tal',
|
||||||
defaults={if_true=""}
|
defaults={if_true=""}
|
||||||
},
|
},
|
||||||
|
@ -84,3 +84,39 @@ describe('ui/ext_tabline', function()
|
|||||||
end}
|
end}
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
describe("tabline", function()
|
||||||
|
local screen
|
||||||
|
|
||||||
|
before_each(function()
|
||||||
|
clear()
|
||||||
|
screen = Screen.new(42, 5)
|
||||||
|
screen:attach()
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('redraws when tabline option is set', function()
|
||||||
|
command('set tabline=asdf')
|
||||||
|
command('set showtabline=2')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{1:asdf }|
|
||||||
|
^ |
|
||||||
|
{2:~ }|
|
||||||
|
{2:~ }|
|
||||||
|
|
|
||||||
|
]], attr_ids={
|
||||||
|
[1] = {reverse = true};
|
||||||
|
[2] = {bold = true, foreground = Screen.colors.Blue1};
|
||||||
|
}}
|
||||||
|
command('set tabline=jkl')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{1:jkl }|
|
||||||
|
^ |
|
||||||
|
{2:~ }|
|
||||||
|
{2:~ }|
|
||||||
|
|
|
||||||
|
]], attr_ids={
|
||||||
|
[1] = {reverse = true};
|
||||||
|
[2] = {bold = true, foreground = Screen.colors.Blue};
|
||||||
|
}}
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user