The above patch has a typo! Oops. I'd love to see this feature go in when the 
sw=0 indent fixes go in, because then we can just "set ts=8 sw=0 sts=-1" and 
use tabstop alone to adjust indent width. The second patch (corrected below) 
makes it so sw can also be negative (which means it falls back to tabstop) just 
for consistency with sts. I'm not sure if it's the right thing to do but it 
might be.

-- 
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 -r e89dca68f3f3 runtime/doc/options.txt
--- a/runtime/doc/options.txt	Wed Oct 03 15:19:17 2012 -0700
+++ b/runtime/doc/options.txt	Wed Oct 03 15:22:11 2012 -0700
@@ -6119,7 +6119,7 @@
 			local to buffer
 	Number of spaces to use for each step of (auto)indent.  Used for
 	|'cindent'|, |>>|, |<<|, etc.
-	When zero the 'ts' value will be used.
+	When zero or negative the 'ts' value will be used.
 
 						*'shortmess'* *'shm'*
 'shortmess' 'shm'	string	(Vim default "filnxtToO", Vi default: "",
diff -r e89dca68f3f3 src/option.c
--- a/src/option.c	Wed Oct 03 15:19:17 2012 -0700
+++ b/src/option.c	Wed Oct 03 15:22:11 2012 -0700
@@ -8125,12 +8125,6 @@
     need_mouse_correct = TRUE;
 #endif
 
-    if (curbuf->b_p_sw < 0)
-    {
-	errmsg = e_positive;
-	curbuf->b_p_sw = curbuf->b_p_ts;
-    }
-
     /*
      * Number options that need some action when changed
      */
@@ -11422,7 +11416,7 @@
     long
 get_sw_value()
 {
-    return curbuf->b_p_sw ? curbuf->b_p_sw : curbuf->b_p_ts;
+    return curbuf->b_p_sw >= 0 ? curbuf->b_p_sw : curbuf->b_p_ts;
 }
 
 /*

Raspunde prin e-mail lui