annotate runtime/indent/meson.vim @ 25091:143c87f12b9b

Added tag v8.2.3082 for changeset 73503bafb3bf24b5d3786548304950de75f820c2
author Bram Moolenaar <Bram@vim.org>
date Thu, 01 Jul 2021 22:15:05 +0200
parents 840665e74421
children babd9f1dbe12
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18456
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim indent file
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: Meson
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " License: VIM License
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Maintainer: Nirbheek Chauhan <nirbheek.chauhan@gmail.com>
24636
840665e74421 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 18456
diff changeset
5 " Liam Beguin <liambeguin@gmail.com>
18456
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 " Original Authors: David Bustos <bustos@caltech.edu>
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 " Bram Moolenaar <Bram@vim.org>
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 " Last Change: 2019 Oct 18
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 " Only load this indent file when no other was loaded.
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 if exists("b:did_indent")
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 finish
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 let b:did_indent = 1
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 " Some preliminary settings
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 setlocal nolisp " Make sure lisp indenting doesn't supersede us
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 setlocal autoindent " indentexpr isn't much help otherwise
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 setlocal indentexpr=GetMesonIndent(v:lnum)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 setlocal indentkeys+==elif,=else,=endforeach,=endif,0)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 " Only define the function once.
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 if exists("*GetMesonIndent")
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 finish
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 let s:keepcpo= &cpo
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 set cpo&vim
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 " Come here when loading the script the first time.
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 let s:maxoff = 50 " maximum number of lines to look backwards for ()
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 function GetMesonIndent(lnum)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 echom getline(line("."))
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 " If this line is explicitly joined: If the previous line was also joined,
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38 " line it up with that one, otherwise add two 'shiftwidth'
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 if getline(a:lnum - 1) =~ '\\$'
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 if a:lnum > 1 && getline(a:lnum - 2) =~ '\\$'
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 return indent(a:lnum - 1)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 return indent(a:lnum - 1) + (exists("g:mesonindent_continue") ? eval(g:mesonindent_continue) : (shiftwidth() * 2))
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 " If the start of the line is in a string don't change the indent.
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47 if has('syntax_items')
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 \ && synIDattr(synID(a:lnum, 1, 1), "name") =~ "String$"
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 return -1
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
51
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 " Search backwards for the previous non-empty line.
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 let plnum = prevnonblank(v:lnum - 1)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 if plnum == 0
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
56 " This is the first non-empty line, use zero indent.
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
57 return 0
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
58 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
59
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60 " If the previous line is inside parenthesis, use the indent of the starting
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
61 " line.
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 " Trick: use the non-existing "dummy" variable to break out of the loop when
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 " going too far back.
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 call cursor(plnum, 1)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW',
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 \ "line('.') < " . (plnum - s:maxoff) . " ? dummy :"
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68 \ . " =~ '\\(Comment\\|Todo\\|String\\)$'")
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 if parlnum > 0
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 let plindent = indent(parlnum)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 let plnumstart = parlnum
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72 else
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
73 let plindent = indent(plnum)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 let plnumstart = plnum
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78 " When inside parenthesis: If at the first line below the parenthesis add
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 " a 'shiftwidth', otherwise same as previous line.
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 " i = (a
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 " + b
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82 " + c)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83 call cursor(a:lnum, 1)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
84 let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 \ . " =~ '\\(Comment\\|Todo\\|String\\)$'")
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 if p > 0
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89 if p == plnum
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90 " When the start is inside parenthesis, only indent one 'shiftwidth'.
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93 \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 \ . " =~ '\\(Comment\\|Todo\\|String\\)$'")
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95 if pp > 0
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
96 return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : shiftwidth())
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 return indent(plnum) + (exists("g:pyindent_open_paren") ? eval(g:pyindent_open_paren) : shiftwidth())
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100 if plnumstart == p
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101 return indent(plnum)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103 return plindent
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
104 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
106
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 " Get the line and remove a trailing comment.
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 " Use syntax highlighting attributes when possible.
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
109 let pline = getline(plnum)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 let pline_len = strlen(pline)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
111 if has('syntax_items')
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
112 " If the last character in the line is a comment, do a binary search for
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
113 " the start of the comment. synID() is slow, a linear search would take
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
114 " too long on a long line.
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
115 if synIDattr(synID(plnum, pline_len, 1), "name") =~ "\\(Comment\\|Todo\\)$"
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
116 let min = 1
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
117 let max = pline_len
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
118 while min < max
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
119 let col = (min + max) / 2
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
120 if synIDattr(synID(plnum, col, 1), "name") =~ "\\(Comment\\|Todo\\)$"
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
121 let max = col
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
122 else
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
123 let min = col + 1
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
124 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
125 endwhile
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
126 let pline = strpart(pline, 0, min - 1)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
127 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
128 else
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
129 let col = 0
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
130 while col < pline_len
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
131 if pline[col] == '#'
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
132 let pline = strpart(pline, 0, col)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
133 break
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
134 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
135 let col = col + 1
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
136 endwhile
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
137 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
138
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
139 " If the previous line ended the conditional/loop
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
140 if getline(plnum) =~ '^\s*\(endif\|endforeach\)\>\s*'
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
141 " Maintain indent
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
142 return -1
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
143 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
144
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
145 " If the previous line ended with a builtin, indent this line
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
146 if pline =~ '^\s*\(foreach\|if\|else\|elif\)\>\s*'
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
147 return plindent + shiftwidth()
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
148 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
149
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
150 " If the current line begins with a header keyword, deindent
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
151 if getline(a:lnum) =~ '^\s*\(else\|elif\|endif\|endforeach\)'
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
152
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
153 " Unless the previous line was a one-liner
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
154 if getline(plnumstart) =~ '^\s*\(foreach\|if\)\>\s*'
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
155 return plindent
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
156 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
157
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
158 " Or the user has already dedented
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
159 if indent(a:lnum) <= plindent - shiftwidth()
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
160 return -1
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
161 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
162
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
163 return plindent - shiftwidth()
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
164 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
165
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
166 " When after a () construct we probably want to go back to the start line.
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
167 " a = (b
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
168 " + c)
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
169 " here
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
170 if parlnum > 0
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
171 return plindent
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
172 endif
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
173
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
174 return -1
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
175
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
176 endfunction
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
177
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
178 let &cpo = s:keepcpo
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
179 unlet s:keepcpo
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
180
6d11fc4aa683 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
181 " vim:sw=2