Mercurial > vim
comparison src/ex_getln.c @ 5995:ef83b423ebf7 v7.4.338
updated for version 7.4.338
Problem: Cannot wrap lines taking indent into account.
Solution: Add the 'breakindent' option. (many authors, final improvements by
Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 25 Jun 2014 14:39:50 +0200 |
parents | 0206ac84ff5f |
children | 2fd550c75256 |
comparison
equal
deleted
inserted
replaced
5994:ca18c797aafe | 5995:ef83b423ebf7 |
---|---|
2300 { | 2300 { |
2301 long sw = get_sw_value(curbuf); | 2301 long sw = get_sw_value(curbuf); |
2302 | 2302 |
2303 p = (char_u *)line_ga.ga_data; | 2303 p = (char_u *)line_ga.ga_data; |
2304 p[line_ga.ga_len] = NUL; | 2304 p[line_ga.ga_len] = NUL; |
2305 indent = get_indent_str(p, 8); | 2305 indent = get_indent_str(p, 8, FALSE); |
2306 indent += sw - indent % sw; | 2306 indent += sw - indent % sw; |
2307 add_indent: | 2307 add_indent: |
2308 while (get_indent_str(p, 8) < indent) | 2308 while (get_indent_str(p, 8, FALSE) < indent) |
2309 { | 2309 { |
2310 char_u *s = skipwhite(p); | 2310 char_u *s = skipwhite(p); |
2311 | 2311 |
2312 ga_grow(&line_ga, 1); | 2312 ga_grow(&line_ga, 1); |
2313 mch_memmove(s + 1, s, line_ga.ga_len - (s - p) + 1); | 2313 mch_memmove(s + 1, s, line_ga.ga_len - (s - p) + 1); |
2355 p[--line_ga.ga_len] = NUL; | 2355 p[--line_ga.ga_len] = NUL; |
2356 } | 2356 } |
2357 else | 2357 else |
2358 { | 2358 { |
2359 p[line_ga.ga_len] = NUL; | 2359 p[line_ga.ga_len] = NUL; |
2360 indent = get_indent_str(p, 8); | 2360 indent = get_indent_str(p, 8, FALSE); |
2361 --indent; | 2361 --indent; |
2362 indent -= indent % get_sw_value(curbuf); | 2362 indent -= indent % get_sw_value(curbuf); |
2363 } | 2363 } |
2364 while (get_indent_str(p, 8) > indent) | 2364 while (get_indent_str(p, 8, FALSE) > indent) |
2365 { | 2365 { |
2366 char_u *s = skipwhite(p); | 2366 char_u *s = skipwhite(p); |
2367 | 2367 |
2368 mch_memmove(s - 1, s, line_ga.ga_len - (s - p) + 1); | 2368 mch_memmove(s - 1, s, line_ga.ga_len - (s - p) + 1); |
2369 --line_ga.ga_len; | 2369 --line_ga.ga_len; |