Skip to content

Commit 1bbb619

Browse files
committed
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)
1 parent d072105 commit 1bbb619

6 files changed

Lines changed: 180 additions & 75 deletions

File tree

runtime/doc/windows.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,11 @@ CTRL-W CTRL_N *CTRL-W_CTRL-N*
222222
|:find|. Doesn't split if {file} is not found.
223223

224224
CTRL-W CTRL-^ *CTRL-W_CTRL-^* *CTRL-W_^*
225-
CTRL-W ^ Does ":split #", split window in two and edit alternate file.
226-
When a count is given, it becomes ":split #N", split window
227-
and edit buffer N.
225+
CTRL-W ^ Split the current window in two and edit the alternate file.
226+
When a count N is given, split the current window and edit
227+
buffer N. Similar to ":sp #" and ":sp #N", but it allows the
228+
other buffer to be unnamed. This command matches the behavior
229+
of |CTRL-^|, except that it splits a window first.
228230

229231
*CTRL-W_:*
230232
CTRL-W : Does the same as typing |:| - enter a command line. Useful in a

src/normal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5496,7 +5496,8 @@ nv_ctrlo(cmdarg_T *cap)
54965496
}
54975497

54985498
/*
5499-
* CTRL-^ command, short for ":e #"
5499+
* CTRL-^ command, short for ":e #". Works even when the alternate buffer is
5500+
* not named.
55005501
*/
55015502
static void
55025503
nv_hat(cmdarg_T *cap)

0 commit comments

Comments
 (0)