diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-03-15 09:23:18 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2024-03-15 09:48:31 +0100 |
commit | a8522f02e9a295055b03fe5066a77d711182c111 (patch) | |
tree | 95b44198970f1fa2291ced29a5418689150eb7ae /src/nvim/version.c | |
parent | 062c0245e3455f0a483729479bda2fc242b3dec5 (diff) | |
download | rneovim-a8522f02e9a295055b03fe5066a77d711182c111.tar.gz rneovim-a8522f02e9a295055b03fe5066a77d711182c111.tar.bz2 rneovim-a8522f02e9a295055b03fe5066a77d711182c111.zip |
fix(ui): startup intro message should be visible with ext_multigrid
As this message is literally drawn on top of the EOB area of the first
window, the simple solution is to just draw the message on top of the
grid of the first window.
We still want #24764 (msg_intro event) but now only for ext_messages.
Diffstat (limited to 'src/nvim/version.c')
-rw-r--r-- | src/nvim/version.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/nvim/version.c b/src/nvim/version.c index ff6f7835b2..27c3826cd2 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -32,6 +32,7 @@ #include "nvim/option_vars.h" #include "nvim/os/os.h" #include "nvim/strings.h" +#include "nvim/ui.h" #include "nvim/version.h" // for ":version", ":intro", and "nvim --version" @@ -2724,7 +2725,7 @@ bool may_show_intro(void) /// Or with the ":intro" command (for Sven :-). /// /// @param colon true for ":intro" -void intro_message(int colon) +void intro_message(bool colon) { static char *(lines[]) = { N_(NVIM_VERSION_LONG), @@ -2801,7 +2802,7 @@ void intro_message(int colon) } if (*mesg != NUL) { - do_intro_line(row, mesg, 0); + do_intro_line(row, mesg, colon); } row++; @@ -2812,7 +2813,7 @@ void intro_message(int colon) } } -static void do_intro_line(int row, char *mesg, int attr) +static void do_intro_line(int row, char *mesg, bool colon) { int l; @@ -2825,7 +2826,12 @@ static void do_intro_line(int row, char *mesg, int attr) col = 0; } - grid_line_start(&default_grid, row); + ScreenGrid *grid = &default_grid; + if (!colon && ui_has(kUIMultigrid)) { + grid = &firstwin->w_grid; + } + + grid_line_start(grid, row); // Split up in parts to highlight <> items differently. for (char *p = mesg; *p != NUL; p += l) { for (l = 0; @@ -2834,7 +2840,7 @@ static void do_intro_line(int row, char *mesg, int attr) l += utfc_ptr2len(p + l) - 1; } assert(row <= INT_MAX && col <= INT_MAX); - col += grid_line_puts(col, p, l, *p == '<' ? HL_ATTR(HLF_8) : attr); + col += grid_line_puts(col, p, l, *p == '<' ? HL_ATTR(HLF_8) : 0); } grid_line_flush(); } |