Mercurial > vim
comparison runtime/indent/make.vim @ 11160:d0a20101ecb2
Update runtime files.
commit https://github.com/vim/vim/commit/036986f1507d223549d110af300144468bd3a1f7
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 16 17:41:02 2017 +0100
Update runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 16 Mar 2017 17:45:05 +0100 |
parents | 1218c5353e2b |
children | e3ec2ec8841a |
comparison
equal
deleted
inserted
replaced
11159:c13ab9398ce9 | 11160:d0a20101ecb2 |
---|---|
46 " TODO: Deal with comments. In comments, continuations aren't interesting. | 46 " TODO: Deal with comments. In comments, continuations aren't interesting. |
47 if prev_line =~ s:continuation_rx | 47 if prev_line =~ s:continuation_rx |
48 if prev_prev_line =~ s:continuation_rx | 48 if prev_prev_line =~ s:continuation_rx |
49 return indent(prev_lnum) | 49 return indent(prev_lnum) |
50 elseif prev_line =~ s:rule_rx | 50 elseif prev_line =~ s:rule_rx |
51 return &sw | 51 return shiftwidth() |
52 elseif prev_line =~ s:assignment_rx | 52 elseif prev_line =~ s:assignment_rx |
53 call cursor(prev_lnum, 1) | 53 call cursor(prev_lnum, 1) |
54 if search(s:assignment_rx, 'W') != 0 | 54 if search(s:assignment_rx, 'W') != 0 |
55 return virtcol('.') - 1 | 55 return virtcol('.') - 1 |
56 else | 56 else |
57 " TODO: ? | 57 " TODO: ? |
58 return &sw | 58 return shiftwidth() |
59 endif | 59 endif |
60 else | 60 else |
61 " TODO: OK, this might be a continued shell command, so perhaps indent | 61 " TODO: OK, this might be a continued shell command, so perhaps indent |
62 " properly here? Leave this out for now, but in the next release this | 62 " properly here? Leave this out for now, but in the next release this |
63 " should be using indent/sh.vim somehow. | 63 " should be using indent/sh.vim somehow. |
64 "if prev_line =~ '^\t' " s:rule_command_rx | 64 "if prev_line =~ '^\t' " s:rule_command_rx |
65 " if prev_line =~ '^\s\+[@-]\%(if\)\>' | 65 " if prev_line =~ '^\s\+[@-]\%(if\)\>' |
66 " return indent(prev_lnum) + 2 | 66 " return indent(prev_lnum) + 2 |
67 " endif | 67 " endif |
68 "endif | 68 "endif |
69 return indent(prev_lnum) + &sw | 69 return indent(prev_lnum) + shiftwidth() |
70 endif | 70 endif |
71 elseif prev_prev_line =~ s:continuation_rx | 71 elseif prev_prev_line =~ s:continuation_rx |
72 let folded_line = s:remove_continuation(prev_prev_line) . ' ' . s:remove_continuation(prev_line) | 72 let folded_line = s:remove_continuation(prev_prev_line) . ' ' . s:remove_continuation(prev_line) |
73 let lnum = prev_prev_lnum - 1 | 73 let lnum = prev_prev_lnum - 1 |
74 let line = getline(lnum) | 74 let line = getline(lnum) |
100 return 0 | 100 return 0 |
101 else | 101 else |
102 return &ts | 102 return &ts |
103 endif | 103 endif |
104 elseif prev_line =~ s:conditional_directive_rx | 104 elseif prev_line =~ s:conditional_directive_rx |
105 return &sw | 105 return shiftwidth() |
106 else | 106 else |
107 let line = getline(v:lnum) | 107 let line = getline(v:lnum) |
108 if line =~ s:just_inserted_rule_rx | 108 if line =~ s:just_inserted_rule_rx |
109 return 0 | 109 return 0 |
110 elseif line =~ s:end_conditional_directive_rx | 110 elseif line =~ s:end_conditional_directive_rx |
111 return v:lnum - 1 == 0 ? 0 : indent(v:lnum - 1) - &sw | 111 return v:lnum - 1 == 0 ? 0 : indent(v:lnum - 1) - shiftwidth() |
112 else | 112 else |
113 return v:lnum - 1 == 0 ? 0 : indent(v:lnum - 1) | 113 return v:lnum - 1 == 0 ? 0 : indent(v:lnum - 1) |
114 endif | 114 endif |
115 endif | 115 endif |
116 endfunction | 116 endfunction |