On Sun, Jun 24, 2018 at 10:21 PM, Christian Brabandt <[email protected]> wrote: > > On So, 24 Jun 2018, Tony Mechelynck wrote: > >> At startup from a handcoded Session.vim I get this error (which I >> didn't get before with the same session script) >> >> Error detected while processing function <SNR>24_Highlight_Matching_Pair: >> line 97: >> E475: Invalid argument: 0 >> >> I get this several times, including when clicking the statusline of a >> non-current window to make it current. >> Script 24 (as listed by :scriptnames) is >> /usr/local/share/vim/vim81/plugin/matchparen.vim >> >> If I move the cursor, be it by keyboard or by mouse, I mostly don't >> get this message, and the matching brackets are highlighted correctly. >> However I do get it when the matched brackets are the first and last >> characters on a line. For instance when the line is >> >> <!-- P --> >> >> with 'matchpairs' set to (:),[:],{:},<:> > > Most likely patch 8.1.112. > > Can you try, if the following patch works for you? > > diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim > index 2b2392dfc..ad3113ce7 100644 > --- a/runtime/plugin/matchparen.vim > +++ b/runtime/plugin/matchparen.vim > @@ -116,10 +116,10 @@ function! s:Highlight_Matching_Pair() > " outside of the syntax types and s_skip should keep its value so we skip > any > " matching pair inside the syntax types. > if !has("syntax") || !exists("g:syntax_on") > - let s:skip = 0 > + let s_skip = '0' > else > try > - execute 'if' s_skip '| let s_skip = 0 | endif' > + 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 > > > Best, > Christian
It doesn't even apply. Here are my lines 115-130 of that script,
_after_ applying the very latest runtime files update (which happened
just before I had the problem):
----- start
" 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$')
let stoplinetop = line('w0')
if i % 2 == 0
let stopline = stoplinebottom
else
let stopline = stoplinetop
endif
" Limit the search time to 300 msec to avoid a hang on very long lines.
" This fails when a timeout is not supported.
----- end
So let's try putting quotes around the zero on my line 117, with no
other change. Since that is inside single quotes, we'll use double
quotes there.
=> the error disappears.
I'll attach the diff.
Best regards,
Tony.
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
matchpZero
Description: Binary data
