]> granicus.if.org Git - vim/commitdiff
patch 7.4.742 v7.4.742
authorBram Moolenaar <Bram@vim.org>
Fri, 19 Jun 2015 12:41:49 +0000 (14:41 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 19 Jun 2015 12:41:49 +0000 (14:41 +0200)
Problem:    Cannot specify a vertical split when loading a buffer for a
            quickfix command.
Solution:   Add the "vsplit" value to 'switchbuf'. (Brook Hong)

runtime/doc/options.txt
src/buffer.c
src/option.h
src/version.c

index 31210393bb414ad4b85e391c86fcddfd530f4dee..9cdf9bb58e60b9efd269037e372394b9cf4ab7ac 100644 (file)
@@ -7067,6 +7067,7 @@ A jump table for the options with a short description can be found at |Q_op|.
           split        If included, split the current window before loading
                        a buffer for a |quickfix| command that display errors.
                        Otherwise: do not split, use current window.
+          vsplit       Just like "split" but split vertically.
           newtab       Like "split", but open a new tab page.  Overrules
                        "split" when both are present.
 
index 6dfe007c28e0e4dfcaab57005032b0f98ff539a2..97c65960423bb9c78675c903ca63e86ed90d0237 100644 (file)
@@ -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);
        }
index b0314667688d26900f6e655a51e3d68d8bbadc4f..7c7d35abfe8521217bc430dd895ea3be5c8efd02 100644 (file)
@@ -765,12 +765,13 @@ EXTERN char_u     *p_sws;         /* 'swapsync' */
 EXTERN char_u  *p_swb;         /* 'switchbuf' */
 EXTERN unsigned        swb_flags;
 #ifdef IN_OPTION_C
-static char *(p_swb_values[]) = {"useopen", "usetab", "split", "newtab", NULL};
+static char *(p_swb_values[]) = {"useopen", "usetab", "split", "newtab", "vsplit", NULL};
 #endif
 #define SWB_USEOPEN            0x001
 #define SWB_USETAB             0x002
 #define SWB_SPLIT              0x004
 #define SWB_NEWTAB             0x008
+#define SWB_VSPLIT             0x010
 EXTERN int     p_tbs;          /* 'tagbsearch' */
 EXTERN long    p_tl;           /* 'taglength' */
 EXTERN int     p_tr;           /* 'tagrelative' */
index 6fc420cbd0f6326127d1395948c8297ee4ff8acd..197b6ea0b917e883cf97d1a1f798fd48e2889432 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    742,
 /**/
     741,
 /**/