mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 06:48:17 +00:00
vim-patch:8.1.0514: CTRL-W ^ does not work when alternate buffer has no name
Problem: CTRL-W ^ does not work when alternate buffer has no name.
Solution: Use another method to split and edit the alternate buffer. (Jason
Franklin)
1bbb619483
This commit is contained in:
@@ -131,8 +131,20 @@ do_window (
|
||||
case '^':
|
||||
CHECK_CMDWIN;
|
||||
reset_VIsual_and_resel(); // stop Visual mode
|
||||
cmd_with_count("split #", (char_u *)cbuf, sizeof(cbuf), Prenum);
|
||||
do_cmdline_cmd(cbuf);
|
||||
|
||||
if (buflist_findnr(Prenum == 0 ? curwin->w_alt_fnum : Prenum) == NULL) {
|
||||
if (Prenum == 0) {
|
||||
EMSG(_(e_noalt));
|
||||
} else {
|
||||
EMSGN(_("E92: Buffer %" PRId64 " not found"), Prenum);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (!curbuf_locked() && win_split(0, 0) == OK) {
|
||||
(void)buflist_getfile(Prenum == 0 ? curwin->w_alt_fnum : Prenum,
|
||||
(linenr_T)0, GETF_ALT, false);
|
||||
}
|
||||
break;
|
||||
|
||||
/* open new window */
|
||||
|
Reference in New Issue
Block a user