diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-12-10 14:53:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-10 14:53:02 +0800 |
commit | d1fd674df3eb07049c780d6b7821e17d471fdc4c (patch) | |
tree | 61c4eea43636e9979310746e8896b27ed0c93770 /src/nvim/drawscreen.c | |
parent | 98694c36756f747e7929033343e8479f39094461 (diff) | |
download | rneovim-d1fd674df3eb07049c780d6b7821e17d471fdc4c.tar.gz rneovim-d1fd674df3eb07049c780d6b7821e17d471fdc4c.tar.bz2 rneovim-d1fd674df3eb07049c780d6b7821e17d471fdc4c.zip |
fix(ui): update title in more cases (#31508)
Diffstat (limited to 'src/nvim/drawscreen.c')
-rw-r--r-- | src/nvim/drawscreen.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c index a939038603..0961aabf21 100644 --- a/src/nvim/drawscreen.c +++ b/src/nvim/drawscreen.c @@ -679,6 +679,10 @@ int update_screen(void) updating_screen = false; + if (need_maketitle) { + maketitle(); + } + // Clear or redraw the command line. Done last, because scrolling may // mess up the command line. if (clear_cmdline || redraw_cmdline || redraw_mode) { @@ -856,6 +860,19 @@ void setcursor_mayforce(win_T *wp, bool force) } } +/// Mark the title and icon for redraw if either of them uses statusline format. +/// +/// @return whether either title or icon uses statusline format. +bool redraw_custom_title_later(void) +{ + if ((p_icon && (stl_syntax & STL_IN_ICON)) + || (p_title && (stl_syntax & STL_IN_TITLE))) { + need_maketitle = true; + return true; + } + return false; +} + /// Show current cursor info in ruler and various other places /// /// @param always if false, only show ruler if position has changed. @@ -889,10 +906,7 @@ void show_cursor_info_later(bool force) curwin->w_redr_status = true; } - if ((p_icon && (stl_syntax & STL_IN_ICON)) - || (p_title && (stl_syntax & STL_IN_TITLE))) { - need_maketitle = true; - } + redraw_custom_title_later(); } curwin->w_stl_cursor = curwin->w_cursor; @@ -2773,6 +2787,10 @@ void redraw_statuslines(void) if (redraw_tabline) { draw_tabline(); } + + if (need_maketitle) { + maketitle(); + } } /// Redraw all status lines at the bottom of frame "frp". |