mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 23:18:33 +00:00
fix(intro): link showing intro to state at start
Problem: Current behavior of stateful intro message is too persistent. For example, it is still drawn if new empty buffer is shown in current window (either by explicitly setting it or after `tabnew`). Although the buffer is empty, the act of it being shown should be made visible. Solution: Make intro message persist if all is true: - Current buffer is the same as it was just after start, i.e. empty nameless with initial handle (i.e. 1). - Current window is the same as it was just after start, i.e. single non-floating with initial handle.
This commit is contained in:
@@ -2715,9 +2715,11 @@ void list_version(void)
|
||||
/// Whether it still is not too late to show an intro message
|
||||
bool may_show_intro(void)
|
||||
{
|
||||
return (buf_is_empty(firstwin->w_buffer)
|
||||
&& (firstwin->w_buffer->b_fname == NULL)
|
||||
&& one_window(firstwin)
|
||||
return (buf_is_empty(curbuf)
|
||||
&& (curbuf->b_fname == NULL)
|
||||
&& (curbuf->handle == 1)
|
||||
&& (curwin->handle == LOWEST_WIN_ID)
|
||||
&& one_window(curwin)
|
||||
&& (vim_strchr(p_shm, SHM_INTRO) == NULL));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user