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:
12
src/option.c
12
src/option.c
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user