summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2012-10-21 00:10:39 +0200
committerBram Moolenaar <Bram@vim.org>2012-10-21 00:10:39 +0200
commit9f340fa57b91db9c04307c99cd4475f197d7a5c8 (patch)
treeb7be09f511971a7e931fb52cbbe0a2ec115f719c /src/option.c
parent205f9f5e2d4b25a94072644bbcdd2c8b20ad7b80 (diff)
downloadvim-git-9f340fa57b91db9c04307c99cd4475f197d7a5c8.tar.gz
updated for version 7.3.693v7.3.693
Problem: Can't make 'softtabstop' follow 'shiftwidth'. Solution: When 'softtabstop' is negative use the value of 'shiftwidth'. (so8res)
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/option.c b/src/option.c
index b6b0bf634..da9807156 100644
--- a/src/option.c
+++ b/src/option.c
@@ -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;
+}