annotate runtime/indent/meson.vim @ 21406:3d55463c8156

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