mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
fix(inccommand): improve preview buffer number handling (#27087)
This commit is contained in:
@@ -2277,6 +2277,7 @@ static buf_T *cmdpreview_open_buf(void)
|
||||
///
|
||||
/// @return Pointer to command preview window if succeeded, NULL if failed.
|
||||
static win_T *cmdpreview_open_win(buf_T *cmdpreview_buf)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
win_T *save_curwin = curwin;
|
||||
|
||||
@@ -2548,10 +2549,10 @@ static bool cmdpreview_may_show(CommandLineState *s)
|
||||
cmdpreview_prepare(&cpinfo);
|
||||
|
||||
// Open preview buffer if inccommand=split.
|
||||
if (!icm_split) {
|
||||
cmdpreview_bufnr = 0;
|
||||
} else if ((cmdpreview_buf = cmdpreview_open_buf()) == NULL) {
|
||||
abort();
|
||||
if (icm_split && (cmdpreview_buf = cmdpreview_open_buf()) == NULL) {
|
||||
// Failed to create preview buffer, so disable preview.
|
||||
set_string_option_direct(kOptInccommand, "nosplit", 0, SID_NONE);
|
||||
icm_split = false;
|
||||
}
|
||||
// Setup preview namespace if it's not already set.
|
||||
if (!cmdpreview_ns) {
|
||||
|
Reference in New Issue
Block a user