updated for version 7.3.629
Problem: There is no way to make 'shiftwidth' follow 'tabstop'.
Solution: When 'shiftwidth' is zero use the value of 'tabstop'. (Christian
Brabandt)
diff --git a/src/option.c b/src/option.c
index 97e45cd..b6b0bf6 100644
--- a/src/option.c
+++ b/src/option.c
@@ -8125,7 +8125,7 @@
need_mouse_correct = TRUE;
#endif
- if (curbuf->b_p_sw <= 0)
+ if (curbuf->b_p_sw < 0)
{
errmsg = e_positive;
curbuf->b_p_sw = curbuf->b_p_ts;
@@ -11419,3 +11419,13 @@
{
return check_opt_strings(p, p_ff_values, FALSE);
}
+
+/*
+ * Return the effective shiftwidth value for current buffer, using the
+ * 'tabstop' value when 'shiftwidth' is zero.
+ */
+ long
+get_sw_value()
+{
+ return curbuf->b_p_sw ? curbuf->b_p_sw : curbuf->b_p_ts;
+}