Mercurial > vim
comparison src/ex_getln.c @ 3740:7de7ef01288d v7.3.629
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)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 08 Aug 2012 18:01:05 +0200 |
parents | 3ac005f02cf0 |
children | 99f076ca8d84 |
comparison
equal
deleted
inserted
replaced
3739:8f80a615ba03 | 3740:7de7ef01288d |
---|---|
2266 continue; | 2266 continue; |
2267 } | 2267 } |
2268 | 2268 |
2269 if (c1 == Ctrl_T) | 2269 if (c1 == Ctrl_T) |
2270 { | 2270 { |
2271 long sw = get_sw_value(); | |
2272 | |
2271 p = (char_u *)line_ga.ga_data; | 2273 p = (char_u *)line_ga.ga_data; |
2272 p[line_ga.ga_len] = NUL; | 2274 p[line_ga.ga_len] = NUL; |
2273 indent = get_indent_str(p, 8); | 2275 indent = get_indent_str(p, 8); |
2274 indent += curbuf->b_p_sw - indent % curbuf->b_p_sw; | 2276 indent += sw - indent % sw; |
2275 add_indent: | 2277 add_indent: |
2276 while (get_indent_str(p, 8) < indent) | 2278 while (get_indent_str(p, 8) < indent) |
2277 { | 2279 { |
2278 char_u *s = skipwhite(p); | 2280 char_u *s = skipwhite(p); |
2279 | 2281 |
2321 else | 2323 else |
2322 { | 2324 { |
2323 p[line_ga.ga_len] = NUL; | 2325 p[line_ga.ga_len] = NUL; |
2324 indent = get_indent_str(p, 8); | 2326 indent = get_indent_str(p, 8); |
2325 --indent; | 2327 --indent; |
2326 indent -= indent % curbuf->b_p_sw; | 2328 indent -= indent % get_sw_value(); |
2327 } | 2329 } |
2328 while (get_indent_str(p, 8) > indent) | 2330 while (get_indent_str(p, 8) > indent) |
2329 { | 2331 { |
2330 char_u *s = skipwhite(p); | 2332 char_u *s = skipwhite(p); |
2331 | 2333 |