aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-09-24 22:53:20 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-10-01 22:27:43 -0400
commit17e96d96bac4ea9074a337b263fe85d4755106b6 (patch)
treeaa24ce3db7cfc79e7af4e80c68bed44a0fd491bf /src/nvim/window.c
parent8d0bc3c18964db51fec4b204a122e946393f2d6d (diff)
downloadrneovim-17e96d96bac4ea9074a337b263fe85d4755106b6.tar.gz
rneovim-17e96d96bac4ea9074a337b263fe85d4755106b6.tar.bz2
rneovim-17e96d96bac4ea9074a337b263fe85d4755106b6.zip
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) https://github.com/vim/vim/commit/1bbb61948342b5cf6e363629f145c65eb455c388
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 1e6de73549..d7df048588 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -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 */