1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2012-08-08 18:01:05 +02:00
parent b02612b641
commit 14f2474147
8 changed files with 46 additions and 26 deletions

View File

@@ -8125,7 +8125,7 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags)
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 @@ check_ff_value(p)
{
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;
}