annotate runtime/plugin/matchparen.vim @ 7049:2ebc20378f68 v7.4.837

commit https://github.com/vim/vim/commit/80ce282107849ef1a0e9b8a3be26c59c211b0957 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 25 19:49:50 2015 +0200 patch 7.4.837 Problem: Compiler warning with MSVC compiler when using +sniff. Solution: Use Sleep() instead of _sleep(). (Tux)
author Christian Brabandt <cb@256bit.org>
date Tue, 25 Aug 2015 20:00:05 +0200
parents 8d361608fe86
children aea5ebf352c4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
1 " Vim plugin for showing matching parens
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
2 " Maintainer: Bram Moolenaar <Bram@vim.org>
6070
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
3 " Last Change: 2014 Jul 19
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
4
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
5 " Exit quickly when:
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
6 " - this plugin was already loaded (or disabled)
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
7 " - when 'compatible' is set
4352
04736b4030ec updated for version 7.3.925
Bram Moolenaar <bram@vim.org>
parents: 4242
diff changeset
8 " - the "CursorMoved" autocmd event is not available.
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
9 if exists("g:loaded_matchparen") || &cp || !exists("##CursorMoved")
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
10 finish
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
11 endif
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
12 let g:loaded_matchparen = 1
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
13
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
14 if !exists("g:matchparen_timeout")
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
15 let g:matchparen_timeout = 300
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
16 endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
17 if !exists("g:matchparen_insert_timeout")
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
18 let g:matchparen_insert_timeout = 60
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
19 endif
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
20
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
21 augroup matchparen
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
22 " Replace all matchparen autocommands
1368
048f26eb43a3 updated for version 7.1-082
vimboss
parents: 1334
diff changeset
23 autocmd! CursorMoved,CursorMovedI,WinEnter * call s:Highlight_Matching_Pair()
4232
0fcb050fd79d updated for version 7.3.867
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
24 if exists('##TextChanged')
0fcb050fd79d updated for version 7.3.867
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
25 autocmd! TextChanged,TextChangedI * call s:Highlight_Matching_Pair()
0fcb050fd79d updated for version 7.3.867
Bram Moolenaar <bram@vim.org>
parents: 3082
diff changeset
26 endif
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
27 augroup END
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
28
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
29 " Skip the rest if it was already done.
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
30 if exists("*s:Highlight_Matching_Pair")
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
31 finish
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
32 endif
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
33
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1556
diff changeset
34 let s:cpo_save = &cpo
757
8b0484fd9119 updated for version 7.0224
vimboss
parents: 711
diff changeset
35 set cpo-=C
8b0484fd9119 updated for version 7.0224
vimboss
parents: 711
diff changeset
36
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
37 " The function that is invoked (very often) to define a ":match" highlighting
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
38 " for any matching paren.
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
39 function! s:Highlight_Matching_Pair()
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
40 " Remove any previous match.
819
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 818
diff changeset
41 if exists('w:paren_hl_on') && w:paren_hl_on
5979
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
42 silent! call matchdelete(3)
819
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 818
diff changeset
43 let w:paren_hl_on = 0
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
44 endif
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
45
711
1babf94e0b24 updated for version 7.0214
vimboss
parents: 706
diff changeset
46 " Avoid that we remove the popup menu.
1556
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
47 " Return when there are no colors (looks like the cursor jumps).
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
48 if pumvisible() || (&t_Co < 8 && !has("gui_running"))
711
1babf94e0b24 updated for version 7.0214
vimboss
parents: 706
diff changeset
49 return
1babf94e0b24 updated for version 7.0214
vimboss
parents: 706
diff changeset
50 endif
1babf94e0b24 updated for version 7.0214
vimboss
parents: 706
diff changeset
51
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
52 " Get the character under the cursor and check if it's in 'matchpairs'.
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
53 let c_lnum = line('.')
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
54 let c_col = col('.')
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
55 let before = 0
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
56
6051
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5979
diff changeset
57 let text = getline(c_lnum)
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5979
diff changeset
58 let c = text[c_col - 1]
967
daa1e34570ff updated for version 7.0-093
vimboss
parents: 920
diff changeset
59 let plist = split(&matchpairs, '.\zs[:,]')
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
60 let i = index(plist, c)
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
61 if i < 0
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
62 " not found, in Insert mode try character before the cursor
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
63 if c_col > 1 && (mode() == 'i' || mode() == 'R')
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
64 let before = 1
6051
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5979
diff changeset
65 let c = text[c_col - 2]
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
66 let i = index(plist, c)
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
67 endif
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
68 if i < 0
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
69 " not found, nothing to do
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
70 return
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
71 endif
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
72 endif
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
73
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
74 " Figure out the arguments for searchpairpos().
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
75 if i % 2 == 0
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
76 let s_flags = 'nW'
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
77 let c2 = plist[i + 1]
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
78 else
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
79 let s_flags = 'nbW'
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
80 let c2 = c
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
81 let c = plist[i - 1]
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
82 endif
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
83 if c == '['
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
84 let c = '\['
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
85 let c2 = '\]'
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
86 endif
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
87
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
88 " Find the match. When it was just before the cursor move it there for a
702
8a99b25de218 updated for version 7.0212
vimboss
parents: 698
diff changeset
89 " moment.
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
90 if before > 0
6070
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
91 let has_getcurpos = exists("*getcurpos")
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
92 if has_getcurpos
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
93 " getcurpos() is more efficient but doesn't exist before 7.4.313.
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
94 let save_cursor = getcurpos()
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
95 else
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
96 let save_cursor = winsaveview()
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
97 endif
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
98 call cursor(c_lnum, c_col - before)
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
99 endif
845
0fe7765dcb8e updated for version 7.0f03
vimboss
parents: 819
diff changeset
100
6118
8d361608fe86 updated for version 7.4.397
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
101 " Build an expression that detects whether the current cursor position is in
8d361608fe86 updated for version 7.4.397
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
102 " certain syntax types (string, comment, etc.), for use as searchpairpos()'s
8d361608fe86 updated for version 7.4.397
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
103 " skip argument.
3082
3502a7f991fc Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2662
diff changeset
104 " We match "escape" for special items, such as lispEscapeSpecial.
6118
8d361608fe86 updated for version 7.4.397
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
105 let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' .
8d361608fe86 updated for version 7.4.397
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
106 \ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))'
8d361608fe86 updated for version 7.4.397
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
107 " If executing the expression determines that the cursor is currently in
8d361608fe86 updated for version 7.4.397
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
108 " one of the syntax types, then we want searchpairpos() to find the pair
8d361608fe86 updated for version 7.4.397
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
109 " within those syntax types (i.e., not skip). Otherwise, the cursor is
8d361608fe86 updated for version 7.4.397
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
110 " outside of the syntax types and s_skip should keep its value so we skip any
8d361608fe86 updated for version 7.4.397
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
111 " matching pair inside the syntax types.
845
0fe7765dcb8e updated for version 7.0f03
vimboss
parents: 819
diff changeset
112 execute 'if' s_skip '| let s_skip = 0 | endif'
0fe7765dcb8e updated for version 7.0f03
vimboss
parents: 819
diff changeset
113
1556
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
114 " Limit the search to lines visible in the window.
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
115 let stoplinebottom = line('w$')
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
116 let stoplinetop = line('w0')
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
117 if i % 2 == 0
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
118 let stopline = stoplinebottom
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
119 else
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
120 let stopline = stoplinetop
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
121 endif
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
122
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
123 " Limit the search time to 300 msec to avoid a hang on very long lines.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
124 " This fails when a timeout is not supported.
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
125 if mode() == 'i' || mode() == 'R'
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
126 let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
127 else
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
128 let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
129 endif
1496
29c09fa57168 updated for version 7.1-211
vimboss
parents: 1368
diff changeset
130 try
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4352
diff changeset
131 let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout)
1496
29c09fa57168 updated for version 7.1-211
vimboss
parents: 1368
diff changeset
132 catch /E118/
1556
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
133 " Can't use the timeout, restrict the stopline a bit more to avoid taking
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
134 " a long time on closed folds and long lines.
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
135 " The "viewable" variables give a range in which we can scroll while
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
136 " keeping the cursor at the same position.
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
137 " adjustedScrolloff accounts for very large numbers of scrolloff.
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
138 let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2])
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
139 let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2])
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
140 let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2])
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
141 " one of these stoplines will be adjusted below, but the current values are
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
142 " minimal boundaries within the current window
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
143 if i % 2 == 0
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
144 if has("byte_offset") && has("syntax_items") && &smc > 0
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
145 let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2])
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
146 let stopline = min([bottom_viewable, byte2line(stopbyte)])
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
147 else
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
148 let stopline = min([bottom_viewable, c_lnum + 100])
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
149 endif
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
150 let stoplinebottom = stopline
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
151 else
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
152 if has("byte_offset") && has("syntax_items") && &smc > 0
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
153 let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2])
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
154 let stopline = max([top_viewable, byte2line(stopbyte)])
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
155 else
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
156 let stopline = max([top_viewable, c_lnum - 100])
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
157 endif
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
158 let stoplinetop = stopline
1c597397f006 updated for version 7.1-269
vimboss
parents: 1496
diff changeset
159 endif
1496
29c09fa57168 updated for version 7.1-211
vimboss
parents: 1368
diff changeset
160 let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
29c09fa57168 updated for version 7.1-211
vimboss
parents: 1368
diff changeset
161 endtry
845
0fe7765dcb8e updated for version 7.0f03
vimboss
parents: 819
diff changeset
162
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
163 if before > 0
6070
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
164 if has_getcurpos
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
165 call setpos('.', save_cursor)
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
166 else
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
167 call winrestview(save_cursor)
32a77cc160d9 Update runtime files. Make matchparen plugin backwards compatible.
Bram Moolenaar <bram@vim.org>
parents: 6051
diff changeset
168 endif
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
169 endif
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
170
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
171 " If a match is found setup match highlighting.
1334
f3abb6aec8c8 updated for version 7.1-048
vimboss
parents: 1136
diff changeset
172 if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom
5979
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
173 if exists('*matchaddpos')
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
174 call matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10, 3)
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
175 else
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
176 exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) .
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
177 \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
178 endif
819
23f82b5d2814 updated for version 7.0c10
vimboss
parents: 818
diff changeset
179 let w:paren_hl_on = 1
694
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
180 endif
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
181 endfunction
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
182
07d199fe02ed updated for version 7.0209
vimboss
parents:
diff changeset
183 " Define commands that will disable and enable the plugin.
5979
f9fa2e506b9f updated for version 7.4.330
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
184 command! NoMatchParen windo silent! call matchdelete(3) | unlet! g:loaded_matchparen |
1368
048f26eb43a3 updated for version 7.1-082
vimboss
parents: 1334
diff changeset
185 \ au! matchparen
048f26eb43a3 updated for version 7.1-082
vimboss
parents: 1334
diff changeset
186 command! DoMatchParen runtime plugin/matchparen.vim | windo doau CursorMoved
757
8b0484fd9119 updated for version 7.0224
vimboss
parents: 711
diff changeset
187
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1556
diff changeset
188 let &cpo = s:cpo_save
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1556
diff changeset
189 unlet s:cpo_save