mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
vim-patch:9.1.0049: Make "[Command Line]" a special buffer name
Problem: E95 is possible if a buffer called "[Command Line]" already
exists when opening the cmdwin. This can also happen if the
cmdwin's buffer could not be deleted when closing.
Solution: Un-name the cmdwin buffer, and give it a special name instead,
similar to what's done for quickfix buffers and for unnamed
prompt and scratch buffers. As a result, BufFilePre/Post are
no longer fired when opening the cmdwin. Add a "command" key
to the dictionary returned by getbufinfo() to differentiate
the cmdwin buffer instead. (Sean Dewar)
Cherry-pick test_normal changes from v9.0.0954.
1fb4103206
This commit is contained in:
@@ -4345,7 +4345,7 @@ static int open_cmdwin(void)
|
||||
|
||||
// Create empty command-line buffer. Be especially cautious of BufLeave
|
||||
// autocommands from do_ecmd(), as cmdwin restrictions do not apply to them!
|
||||
const int newbuf_status = buf_open_scratch(0, _("[Command Line]"));
|
||||
const int newbuf_status = buf_open_scratch(0, NULL);
|
||||
const bool cmdwin_valid = win_valid(cmdwin_win);
|
||||
if (newbuf_status == FAIL || !cmdwin_valid || curwin != cmdwin_win || !win_valid(old_curwin)
|
||||
|| !bufref_valid(&old_curbuf) || old_curwin->w_buffer != old_curbuf.br_buf) {
|
||||
|
Reference in New Issue
Block a user