Hi Kartik!

On Do, 23 Sep 2010, Kartik Agaram wrote:

[split vertical request]
Try the attached patch, it provides the new setting 'splitvertical'

Mit freundlichen Grüßen
Christian
-- 
Wer zu lange ein Auge zugedrückt hat, dem werden eines Tages plötzlich
beide aufgehen.
                -- Sophia Loren (eig. Maria Scicolone)

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -6452,6 +6452,14 @@
 	When on, splitting a window will put the new window right of the
 	current one. |:vsplit|
 
+			*'splitvertical'* *'spv'* *'nosplitvertical'* *'nospv'*
+'splitvertical' 'spv'	boolean	(default off)
+			global
+			{not in Vi}
+			{not available when compiled without the |+vertsplit|
+			feature}
+	When on, splitting a window will always be performed vertical. |:vsplit|
+
 			   *'startofline'* *'sol'* *'nostartofline'* *'nosol'*
 'startofline' 'sol'	boolean	(default on)
 			global
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -482,6 +482,8 @@
 if has("vertsplit")
   call append("$", "splitright\ta new window is put right of the current one")
   call <SID>BinOptionG("spr", &spr)
+  call append("$", "splitvertical\ta Splitting windows will be performed vertically")
+  call <SID>BinOptionG("spv", &spv)
 endif
 if has("scrollbind")
   call append("$", "scrollbind\tthis window scrolls together with other bound windows")
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -10198,6 +10198,8 @@
 	    return FAIL;
 	if (!p_spr && put_line(fd, "set nosplitright") == FAIL)
 	    return FAIL;
+	if (!p_spv && put_line(fd, "set novertical") == FAIL)
+	    return FAIL;
 
 	/*
 	 * Check if window sizes can be restored (no windows omitted).
diff --git a/src/option.c b/src/option.c
--- a/src/option.c
+++ b/src/option.c
@@ -2416,6 +2416,13 @@
 			    (char_u *)NULL, PV_NONE,
 #endif
 			    {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
+    {"splitvertical",  "spv",  P_BOOL|P_VI_DEF,
+#ifdef FEAT_VERTSPLIT
+			    (char_u *)&p_spv, PV_NONE,
+#else
+			    (char_u *)NULL, PV_NONE,
+#endif
+			    {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
     {"startofline", "sol",  P_BOOL|P_VI_DEF|P_VIM,
 			    (char_u *)&p_sol, PV_NONE,
 			    {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT},
diff --git a/src/option.h b/src/option.h
--- a/src/option.h
+++ b/src/option.h
@@ -747,6 +747,7 @@
 #endif
 #ifdef FEAT_VERTSPLIT
 EXTERN int	p_spr;		/* 'splitright' */
+EXTERN int	p_spv;		/* 'splitvertical' */
 #endif
 EXTERN int	p_sol;		/* 'startofline' */
 EXTERN char_u	*p_su;		/* 'suffixes' */
diff --git a/src/window.c b/src/window.c
--- a/src/window.c
+++ b/src/window.c
@@ -667,6 +667,10 @@
 
     /* Add flags from ":vertical", ":topleft" and ":botright". */
     flags |= cmdmod.split;
+#ifdef FEAT_VERTSPLIT
+    if (p_spv)
+	flags |= WSP_VERT;
+#endif
     if ((flags & WSP_TOP) && (flags & WSP_BOT))
     {
 	EMSG(_("E442: Can't split topleft and botright at the same time"));

Raspunde prin e-mail lui