summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-06-19 14:41:49 +0200
committerBram Moolenaar <Bram@vim.org>2015-06-19 14:41:49 +0200
commita594d77ffcccf2ac0e4079c41342ca55d4c9bb08 (patch)
treecd5d4aefbcf18485f1c3fb3c247b67fc1752d33b /src/buffer.c
parenta7b7b1cef9b61700ba5076c1d889dce791392388 (diff)
patch 7.4.742v7.4.742
Problem: Cannot specify a vertical split when loading a buffer for a quickfix command. Solution: Add the "vsplit" value to 'switchbuf'. (Brook Hong)
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 6dfe007c28..97c6596042 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2071,17 +2071,21 @@ buflist_getfile(n, lnum, options, forceit)
* "buf" if one exists */
if (swb_flags & SWB_USEOPEN)
wp = buf_jump_open_win(buf);
+
/* If 'switchbuf' contains "usetab": jump to first window in any tab
* page containing "buf" if one exists */
if (wp == NULL && (swb_flags & SWB_USETAB))
wp = buf_jump_open_tab(buf);
- /* If 'switchbuf' contains "split" or "newtab" and the current buffer
- * isn't empty: open new window */
- if (wp == NULL && (swb_flags & (SWB_SPLIT | SWB_NEWTAB)) && !bufempty())
+
+ /* If 'switchbuf' contains "split", "vsplit" or "newtab" and the
+ * current buffer isn't empty: open new tab or window */
+ if (wp == NULL && (swb_flags & (SWB_VSPLIT | SWB_SPLIT | SWB_NEWTAB))
+ && !bufempty())
{
- if (swb_flags & SWB_NEWTAB) /* Open in a new tab */
+ if (swb_flags & SWB_NEWTAB)
tabpage_new();
- else if (win_split(0, 0) == FAIL) /* Open in a new window */
+ else if (win_split(0, (swb_flags & SWB_VSPLIT) ? WSP_VERT : 0)
+ == FAIL)
return FAIL;
RESET_BINDING(curwin);
}