annotate runtime/indent/json.vim @ 34329:a059fc613d55 v9.1.0098

patch 9.1.0098: CompletionChanged not triggered when new leader added without matches Commit: https://github.com/vim/vim/commit/0d3c0a66a39570cbc52b9536604c39e324b989b3 Author: glepnir <glephunter@gmail.com> Date: Sun Feb 11 17:52:40 2024 +0100 patch 9.1.0098: CompletionChanged not triggered when new leader added without matches Problem: CompletionChanged not triggered when new leader added causing no matching item in the completion menu Solution: When completion is active but no items matched still trigger CompletChanged event (glepnir) closes: #13982 Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 11 Feb 2024 18:00:03 +0100
parents fee9eccee266
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6070
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " Vim indent file
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 " Language: JSON
25773
11b656e74444 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 22171
diff changeset
3 " Maintainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
22171
d4c7b3e9cd17 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
4 " Last Change: 2020 Aug 30
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
5 " https://github.com/jakar/vim-json/commit/20b650e22aa750c4ab6a66aa646bdd95d7cd548a#diff-e81fc111b2052e306d126bd9989f7b7c
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25773
diff changeset
6 " 2022 Sep 07: b:undo_indent added by Doug Kearns
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
7 " Original Author: Rogerz Zhang <rogerz.zhang at gmail.com> http://github.com/rogerz/vim-json
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
8 " Acknowledgement: Based off of vim-javascript maintained by Darrick Wiebe
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
9 " http://www.vim.org/scripts/script.php?script_id=2765
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
10
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
11 " 0. Initialization {{{1
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
12 " =================
6070
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
14 " Only load this indent file when no other was loaded.
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
15 if exists("b:did_indent")
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
16 finish
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
17 endif
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
18 let b:did_indent = 1
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
19
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
20 setlocal nosmartindent
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
21
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
22 " Now, set up our indentation expression and keys that trigger it.
22171
d4c7b3e9cd17 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
23 setlocal indentexpr=GetJSONIndent(v:lnum)
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
24 setlocal indentkeys=0{,0},0),0[,0],!^F,o,O,e
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
25
30202
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25773
diff changeset
26 let b:undo_indent = "setl inde< indk< si<"
fee9eccee266 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 25773
diff changeset
27
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
28 " Only define the function once.
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
29 if exists("*GetJSONIndent")
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
30 finish
6070
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
31 endif
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
33 let s:cpo_save = &cpo
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
34 set cpo&vim
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
35
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
36 " 1. Variables {{{1
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
37 " ============
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
38
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
39 let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
40 " Regex that defines blocks.
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
41 let s:block_regex = '\%({\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
42
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
43 " 2. Auxiliary Functions {{{1
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
44 " ======================
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
45
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
46 " Check if the character at lnum:col is inside a string.
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
47 function s:IsInString(lnum, col)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
48 return synIDattr(synID(a:lnum, a:col, 1), 'name') == 'jsonString'
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
49 endfunction
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
50
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
51 " Find line above 'lnum' that isn't empty, or in a string.
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
52 function s:PrevNonBlankNonString(lnum)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
53 let lnum = prevnonblank(a:lnum)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
54 while lnum > 0
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
55 " If the line isn't empty or in a string, end search.
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
56 let line = getline(lnum)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
57 if !(s:IsInString(lnum, 1) && s:IsInString(lnum, strlen(line)))
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
58 break
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
59 endif
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
60 let lnum = prevnonblank(lnum - 1)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
61 endwhile
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
62 return lnum
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
63 endfunction
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
64
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
65 " Check if line 'lnum' has more opening brackets than closing ones.
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
66 function s:LineHasOpeningBrackets(lnum)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
67 let open_0 = 0
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
68 let open_2 = 0
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
69 let open_4 = 0
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
70 let line = getline(a:lnum)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
71 let pos = match(line, '[][(){}]', 0)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
72 while pos != -1
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
73 let idx = stridx('(){}[]', line[pos])
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
74 if idx % 2 == 0
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
75 let open_{idx} = open_{idx} + 1
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
76 else
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
77 let open_{idx - 1} = open_{idx - 1} - 1
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
78 endif
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
79 let pos = match(line, '[][(){}]', pos + 1)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
80 endwhile
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
81 return (open_0 > 0) . (open_2 > 0) . (open_4 > 0)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
82 endfunction
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
83
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
84 function s:Match(lnum, regex)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
85 let col = match(getline(a:lnum), a:regex) + 1
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
86 return col > 0 && !s:IsInString(a:lnum, col) ? col : 0
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
87 endfunction
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
88
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
89 " 3. GetJSONIndent Function {{{1
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
90 " =========================
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
91
22171
d4c7b3e9cd17 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
92 function GetJSONIndent(...)
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
93 " 3.1. Setup {{{2
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
94 " ----------
22171
d4c7b3e9cd17 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
95 " For the current line, use the first argument if given, else v:lnum
d4c7b3e9cd17 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
96 let clnum = a:0 ? a:1 : v:lnum
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
97
22171
d4c7b3e9cd17 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
98 " Set up variables for restoring position in file. Could use clnum here.
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
99 let vcol = col('.')
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
100
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
101 " 3.2. Work on the current line {{{2
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
102 " -----------------------------
6070
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
103
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
104 " Get the current line.
22171
d4c7b3e9cd17 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
105 let line = getline(clnum)
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
106 let ind = -1
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
107
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
108 " If we got a closing bracket on an empty line, find its match and indent
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
109 " according to it.
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
110 let col = matchend(line, '^\s*[]}]')
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
111
22171
d4c7b3e9cd17 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
112 if col > 0 && !s:IsInString(clnum, col)
d4c7b3e9cd17 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
113 call cursor(clnum, col)
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
114 let bs = strpart('{}[]', stridx('}]', line[col - 1]) * 2, 2)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
115
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
116 let pairstart = escape(bs[0], '[')
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
117 let pairend = escape(bs[1], ']')
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
118 let pairline = searchpair(pairstart, '', pairend, 'bW')
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
119
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
120 if pairline > 0
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
121 let ind = indent(pairline)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
122 else
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
123 let ind = virtcol('.') - 1
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
124 endif
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
125
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
126 return ind
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
127 endif
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
128
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
129 " If we are in a multi-line string, don't do anything to it.
22171
d4c7b3e9cd17 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
130 if s:IsInString(clnum, matchend(line, '^\s*') + 1)
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
131 return indent('.')
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
132 endif
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
133
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
134 " 3.3. Work on the previous line. {{{2
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
135 " -------------------------------
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
136
22171
d4c7b3e9cd17 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
137 let lnum = prevnonblank(clnum - 1)
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
138
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
139 if lnum == 0
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
140 return 0
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
141 endif
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
142
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
143 " Set up variables for current line.
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
144 let line = getline(lnum)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
145 let ind = indent(lnum)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
146
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
147 " If the previous line ended with a block opening, add a level of indent.
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
148 " if s:Match(lnum, s:block_regex)
11518
63b0b7b79b25 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 6180
diff changeset
149 " return indent(lnum) + shiftwidth()
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
150 " endif
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
151
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
152 " If the previous line contained an opening bracket, and we are still in it,
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
153 " add indent depending on the bracket type.
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
154 if line =~ '[[({]'
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
155 let counts = s:LineHasOpeningBrackets(lnum)
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
156 if counts[0] == '1' || counts[1] == '1' || counts[2] == '1'
11518
63b0b7b79b25 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 6180
diff changeset
157 return ind + shiftwidth()
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
158 else
22171
d4c7b3e9cd17 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11518
diff changeset
159 call cursor(clnum, vcol)
6180
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
160 end
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
161 endif
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
162
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
163 " }}}2
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
164
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
165 return ind
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
166 endfunction
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
167
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
168 " }}}1
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
169
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
170 let &cpo = s:cpo_save
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
171 unlet s:cpo_save
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
172
6921742f396a Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
173 " vim:set sw=2 sts=2 ts=8 noet: