Currently, the matchit configuration chokes on valid syntax like:
if !(true) then true endif
Make sure the negation syntax is supported.
Ping @dkearns
https://github.com/vim/vim/pull/19172
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I was surprised that this works. The documentation seems very clear that the parens are required as expression delimiters, like C. However, any expression is accepted there and the parens are not required at all.
Looking at the source I couldn't tell for sure whether it was an oversight or intentional but there is a solitary example in the test harness not using parens so I'm favouring the latter. It's also been that way forever.
Parsing the expression to disambiguate single and multiline if commands sounds annoying at best.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@dkearns commented on this pull request.
> + \ s:line_start .. 'if\s*!\?\s*(.*)\s*then\>:' .. \ s:line_start .. 'else\s\+if\s*(.*)\s*then\>:' .. s:line_start .. 'else\>:' ..
Something like this (untested) is better but we need to look behind to check for operators and param $ etc. to avoid matching then at the end of an expression.
- \ s:line_start .. 'if\s*!\?\s*(.*)\s*then\>:' .. - \ s:line_start .. 'else\s\+if\s*(.*)\s*then\>:' .. s:line_start .. 'else\>:' .. + \ s:line_start .. 'if\>.*\<then\>\s*\%(;\|$\):' .. + \ s:line_start .. 'else\s\+if\>.*\<then\>\s*\%(;\|$\):' .. s:line_start .. 'else\>:' ..
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@simaoafonso-pwt commented on this pull request.
> + \ s:line_start .. 'if\s*!\?\s*(.*)\s*then\>:' .. \ s:line_start .. 'else\s\+if\s*(.*)\s*then\>:' .. s:line_start .. 'else\>:' ..
That might work, but it can be too big of a change to test. The vast majority of usage includes the parens, I guess.
I tested that change, but it doesn't work, I guess it was actually pseudo-code.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()