summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0143
blob: d9d03c15bce174a05665e1deb766104a4ed9671b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0143
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0143
Problem:    Matchit and matchparen don't handle E363.
Solution:   Catch the E363 error. (Christian Brabandt)
Files:	    runtime/pack/dist/opt/matchit/plugin/matchit.vim,
            runtime/plugin/matchparen.vim


*** ../vim-8.1.0142/runtime/pack/dist/opt/matchit/plugin/matchit.vim	2017-09-15 22:24:05.000000000 +0200
--- runtime/pack/dist/opt/matchit/plugin/matchit.vim	2018-07-03 18:08:21.939478130 +0200
***************
*** 1,5 ****
  "  matchit.vim: (global plugin) Extended "%" matching
! "  Last Change: 2017 Sep 15
  "  Maintainer:  Benji Fisher PhD   <benji@member.AMS.org>
  "  Version:     1.13.3, for Vim 6.3+
  "		Fix from Fernando Torres included.
--- 1,5 ----
  "  matchit.vim: (global plugin) Extended "%" matching
! "  Last Change: 2018 Jul 3 by Christian Brabandt
  "  Maintainer:  Benji Fisher PhD   <benji@member.AMS.org>
  "  Version:     1.13.3, for Vim 6.3+
  "		Fix from Fernando Torres included.
***************
*** 272,278 ****
    "   execute "normal!" . curcol . "l"
    " endif
    if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on"))
!     let skip = "0"
    else
      execute "if " . skip . "| let skip = '0' | endif"
    endif
--- 272,278 ----
    "   execute "normal!" . curcol . "l"
    " endif
    if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on"))
!     let skip = '0'
    else
      execute "if " . skip . "| let skip = '0' | endif"
    endif
***************
*** 719,728 ****
    let openpat = substitute(openpat, ',', '\\|', 'g')
    let closepat = substitute(close, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g')
    let closepat = substitute(closepat, ',', '\\|', 'g')
    if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on"))
      let skip = '0'
    else
!     execute "if " . skip . "| let skip = '0' | endif"
    endif
    mark '
    while level
--- 719,734 ----
    let openpat = substitute(openpat, ',', '\\|', 'g')
    let closepat = substitute(close, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g')
    let closepat = substitute(closepat, ',', '\\|', 'g')
+ 
    if skip =~ 'synID' && !(has("syntax") && exists("g:syntax_on"))
      let skip = '0'
    else
!     try
!       execute "if " . skip . "| let skip = '0' | endif"
!     catch /^Vim\%((\a\+)\)\=:E363/
!       " We won't find anything, so skip searching, should keep Vim responsive.
!       return
!     endtry
    endif
    mark '
    while level
*** ../vim-8.1.0142/runtime/plugin/matchparen.vim	2018-06-25 00:05:55.897799652 +0200
--- runtime/plugin/matchparen.vim	2018-07-03 18:14:30.337154571 +0200
***************
*** 1,6 ****
  " Vim plugin for showing matching parens
  " Maintainer:  Bram Moolenaar <Bram@vim.org>
! " Last Change: 2017 Sep 30
  
  " Exit quickly when:
  " - this plugin was already loaded (or disabled)
--- 1,6 ----
  " Vim plugin for showing matching parens
  " Maintainer:  Bram Moolenaar <Bram@vim.org>
! " Last Change: 2018 Jul 3
  
  " Exit quickly when:
  " - this plugin was already loaded (or disabled)
***************
*** 103,120 ****
      call cursor(c_lnum, c_col - before)
    endif
  
!   " Build an expression that detects whether the current cursor position is in
!   " certain syntax types (string, comment, etc.), for use as searchpairpos()'s
!   " skip argument.
!   " We match "escape" for special items, such as lispEscapeSpecial.
!   let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' .
  	\ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))'
!   " If executing the expression determines that the cursor is currently in
!   " one of the syntax types, then we want searchpairpos() to find the pair
!   " within those syntax types (i.e., not skip).  Otherwise, the cursor is
!   " outside of the syntax types and s_skip should keep its value so we skip any
!   " matching pair inside the syntax types.
!   execute 'if' s_skip '| let s_skip = "0" | endif'
  
    " Limit the search to lines visible in the window.
    let stoplinebottom = line('w$')
--- 103,130 ----
      call cursor(c_lnum, c_col - before)
    endif
  
!   if !has("syntax") || !exists("g:syntax_on")
!     let s_skip = "0"
!   else
!     " Build an expression that detects whether the current cursor position is
!     " in certain syntax types (string, comment, etc.), for use as
!     " searchpairpos()'s skip argument.
!     " We match "escape" for special items, such as lispEscapeSpecial.
!     let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' .
  	\ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))'
!     " If executing the expression determines that the cursor is currently in
!     " one of the syntax types, then we want searchpairpos() to find the pair
!     " within those syntax types (i.e., not skip).  Otherwise, the cursor is
!     " outside of the syntax types and s_skip should keep its value so we skip
!     " any matching pair inside the syntax types.
!     " Catch if this throws E363: pattern uses more memory than 'maxmempattern'.
!     try
!       execute 'if ' . s_skip . ' | let s_skip = "0" | endif'
!     catch /^Vim\%((\a\+)\)\=:E363/
!       " We won't find anything, so skip searching, should keep Vim responsive.
!       return
!     endtry
!   endif
  
    " Limit the search to lines visible in the window.
    let stoplinebottom = line('w$')
*** ../vim-8.1.0142/src/version.c	2018-07-03 17:16:55.626135028 +0200
--- src/version.c	2018-07-03 18:16:06.620560417 +0200
***************
*** 791,792 ****
--- 791,794 ----
  {   /* Add new patch number below this line */
+ /**/
+     143,
  /**/

-- 
If Microsoft would build a car...
... Occasionally, executing a maneuver such as a left turn
would cause your car to shut down and refuse to restart, in
which case you would have to reinstall the engine.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///