]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
updated for version 7.3.693 v7.3.693
authorBram Moolenaar <Bram@vim.org>
Sat, 20 Oct 2012 22:10:39 +0000 (00:10 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 20 Oct 2012 22:10:39 +0000 (00:10 +0200)
Problem:    Can't make 'softtabstop' follow 'shiftwidth'.
Solution:   When 'softtabstop' is negative use the value of 'shiftwidth'.
            (so8res)

src/edit.c
src/option.c
src/proto/option.pro
src/version.c

index 9017fd0f317cb9ca48ab67a88129ed1b622f0839..0d940954668b97cf652c02355c53fb9fbb0f76b5 100644 (file)
@@ -8885,7 +8885,7 @@ ins_bs(c, mode, inserted_space_p)
         */
        if (       mode == BACKSPACE_CHAR
                && ((p_sta && in_indent)
-                   || (curbuf->b_p_sts != 0
+                   || (get_sts_value() != 0
                        && curwin->w_cursor.col > 0
                        && (*(ml_get_cursor() - 1) == TAB
                            || (*(ml_get_cursor() - 1) == ' '
@@ -8901,7 +8901,7 @@ ins_bs(c, mode, inserted_space_p)
            if (p_sta && in_indent)
                ts = (int)get_sw_value();
            else
-               ts = (int)curbuf->b_p_sts;
+               ts = (int)get_sts_value();
            /* Compute the virtual column where we want to be.  Since
             * 'showbreak' may get in the way, need to get the last column of
             * the previous character. */
@@ -9590,7 +9590,7 @@ ins_tab()
      */
     if (!curbuf->b_p_et
            && !(p_sta && ind && curbuf->b_p_ts != get_sw_value())
-           && curbuf->b_p_sts == 0)
+           && get_sts_value() == 0)
        return TRUE;
 
     if (stop_arrow() == FAIL)
@@ -9606,8 +9606,8 @@ ins_tab()
 
     if (p_sta && ind)          /* insert tab in indent, use 'shiftwidth' */
        temp = (int)get_sw_value();
-    else if (curbuf->b_p_sts > 0) /* use 'softtabstop' when set */
-       temp = (int)curbuf->b_p_sts;
+    else if (curbuf->b_p_sts != 0) /* use 'softtabstop' when set */
+       temp = (int)get_sts_value();
     else                       /* otherwise use 'tabstop' */
        temp = (int)curbuf->b_p_ts;
     temp -= get_nolist_virtcol() % temp;
@@ -9635,7 +9635,7 @@ ins_tab()
     /*
      * When 'expandtab' not set: Replace spaces by TABs where possible.
      */
-    if (!curbuf->b_p_et && (curbuf->b_p_sts || (p_sta && ind)))
+    if (!curbuf->b_p_et && (get_sts_value() || (p_sta && ind)))
     {
        char_u          *ptr;
 #ifdef FEAT_VREPLACE
index b6b0bf634685545b2f7ae3121a17cc2cdbc8cecd..da9807156d4e0c70e80035b179e632da1ab6e931 100644 (file)
@@ -8509,11 +8509,6 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags)
            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;
+}
index 7d3d8d65156d79b0605902bb90c3b3c06d81de8f..fd71704ec1f39c26345e1f16f99770e9182bee8a 100644 (file)
@@ -57,4 +57,5 @@ void save_file_ff __ARGS((buf_T *buf));
 int file_ff_differs __ARGS((buf_T *buf, int ignore_empty));
 int check_ff_value __ARGS((char_u *p));
 long get_sw_value __ARGS((void));
+long get_sts_value __ARGS((void));
 /* vim: set ft=c : */
index e0a63265af470725cce5d0f7258356fd26c8da1d..0a39edeeb606d3c2377be97473dc37eafc400c46 100644 (file)
@@ -719,6 +719,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    693,
 /**/
     692,
 /**/