diff src/option.c @ 3873:fd96b3cc88ed v7.3.693

updated for version 7.3.693 Problem: Can't make 'softtabstop' follow 'shiftwidth'. Solution: When 'softtabstop' is negative use the value of 'shiftwidth'. (so8res)
author Bram Moolenaar <bram@vim.org>
date Sun, 21 Oct 2012 00:10:39 +0200
parents 7de7ef01288d
children f69321485951
line wrap: on
line diff
--- a/src/option.c
+++ b/src/option.c
@@ -8509,11 +8509,6 @@ set_num_option(opt_idx, varp, value, err
 	    p_window = Rows - 1;
     }
 
-    if (curbuf->b_p_sts < 0)
-    {
-	errmsg = e_positive;
-	curbuf->b_p_sts = 0;
-    }
     if (curbuf->b_p_ts <= 0)
     {
 	errmsg = e_positive;
@@ -11429,3 +11424,13 @@ get_sw_value()
 {
     return curbuf->b_p_sw ? curbuf->b_p_sw : curbuf->b_p_ts;
 }
+
+/*
+ * Return the effective softtabstop value for the current buffer, using the
+ * 'tabstop' value when 'softtabstop' is negative.
+ */
+    long
+get_sts_value()
+{
+    return curbuf->b_p_sts < 0 ? get_sw_value() : curbuf->b_p_sts;
+}