@dkearns pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Fixes:
https://github.com/vim/vim/pull/19331
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Can this pr fix this problem?
In vim9 call and let are not necessary, but everything behind silent and silent! are highlight as command, even function or g:thing, while exe and echo 's highlight are well.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Sorry @mao-yining, I missed your query.
Yes, it should fix that issue but that part is still on my machine. I'll update this PR soon.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@dkearns pushed 2 commits.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@dkearns pushed 2 commits.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@dkearns pushed 1 commit.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@dkearns pushed 1 commit.
—
View it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@dkearns pushed 1 commit.
—
View it on GitHub or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
@kennypete commented on this pull request.
In runtime/syntax/generator/vim.vim.base:
>
-" Highlight: clear {{{2
-syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHLGroup,vimHiGroup
-
-" Highlight: link {{{2
-" see tst24 (hi def vs hi) (Jul 06, 2018)
-"syn region vimHiLink contained oneline matchgroup=vimCommand start="\(\<hi\%[ghlight]\s\+\)\@<=\(\(def\%[ault]\s\+\)\=link\>\|\<def\>\)" end="$" contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation
-" TODO: simplify and allow line continuations --djk
-syn region vimHiLink contained matchgroup=Type start="\%(\<hi\%[ghlight]!\=\s\+\)\@<=\%(\%(def\%[ault]\s\+\)\=link\>\|\<def\%[ault]\>\)" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimHiCluster
+" Additional IsCommand: here by reasons of precedence {{{2
+" ===================+syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotation
Is this too restrictive? See my comment in #20191 (comment)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@dkearns pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@dkearns commented on this pull request.
In runtime/syntax/generator/vim.vim.base:
>
-" Highlight: clear {{{2
-syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHLGroup,vimHiGroup
-
-" Highlight: link {{{2
-" see tst24 (hi def vs hi) (Jul 06, 2018)
-"syn region vimHiLink contained oneline matchgroup=vimCommand start="\(\<hi\%[ghlight]\s\+\)\@<=\(\(def\%[ault]\s\+\)\=link\>\|\<def\>\)" end="$" contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation
-" TODO: simplify and allow line continuations --djk
-syn region vimHiLink contained matchgroup=Type start="\%(\<hi\%[ghlight]!\=\s\+\)\@<=\%(\%(def\%[ault]\s\+\)\=link\>\|\<def\%[ault]\>\)" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimHiCluster
+" Additional IsCommand: here by reasons of precedence {{{2
+" ===================+syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotation
It is but it's a very old group that's no longer intended for use and scheduled for removal. I don't believe it matches anywhere valid but I need to test that.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@dkearns pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@dkearns pushed 1 commit.
—
View it on GitHub or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
@kennypete commented on this pull request.
In runtime/syntax/generator/vim.vim.base:
>
-syn region vimSyncArgs contained start="\S" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=vimCmdSep end="|\|$" contains=vimSyncLines,vimSyncLinebreak,vimSyncLinecont,vimSyncFromstart,vimSyncCcomment
+" User Command Highlighting: {{{2
+" syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([<.(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!'
+" syn match vimUsrCmd contained '\u\%(\w*\)\@>\%([<.(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!' nextgroup=vimBang
+syn match vimUsrCmd contained '\%#=1\<\u\w\+\>\%([![:space:]]\|$\)\@=' nextgroup=vimBang
\u\w\+ will match invalid patterns like :My_Invalid_Command. It needs to be [:alnum:].\ overload.[:space:], if used after a command, give errors. A tab or space only is allowed, so [:blank:] should replace [:space:]:syn match vimUsrCmd contained '\v<[[:upper:]][[:alnum:]]+>%([[:blank:]!]|$)@=' nextgroup=vimBang
Illustrating with /\v<[[:upper:]][[:alnum:]]+>%([[:space:]!]|$)@= why it should be [:blank:]:
image.png (view on web)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@dkearns pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@dkearns commented on this pull request.
In runtime/syntax/generator/vim.vim.base:
>
-" Highlight: clear {{{2
-syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHLGroup,vimHiGroup
-
-" Highlight: link {{{2
-" see tst24 (hi def vs hi) (Jul 06, 2018)
-"syn region vimHiLink contained oneline matchgroup=vimCommand start="\(\<hi\%[ghlight]\s\+\)\@<=\(\(def\%[ault]\s\+\)\=link\>\|\<def\>\)" end="$" contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation
-" TODO: simplify and allow line continuations --djk
-syn region vimHiLink contained matchgroup=Type start="\%(\<hi\%[ghlight]!\=\s\+\)\@<=\%(\%(def\%[ault]\s\+\)\=link\>\|\<def\%[ault]\>\)" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimHiCluster
+" Additional IsCommand: here by reasons of precedence {{{2
+" ===================+syn match vimIsCommand "<Bar>\s*\a\+" transparent contains=vimCommand,vimNotation
Removed.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@dkearns pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@dkearns pushed 1 commit.
—
View it on GitHub or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
@dkearns pushed 1 commit.
—
View it on GitHub or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
@dkearns pushed 1 commit.
—
View it on GitHub or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
>
-syn region vimSyncArgs contained start="\S" skip=+\\\\\|\\|\|\n\s*\%(\\\|"\\ \)+ matchgroup=vimCmdSep end="|\|$" contains=vimSyncLines,vimSyncLinebreak,vimSyncLinecont,vimSyncFromstart,vimSyncCcomment
+" User Command Highlighting: {{{2
+" syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([<.(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!'
+" syn match vimUsrCmd contained '\u\%(\w*\)\@>\%([<.(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!' nextgroup=vimBang
+syn match vimUsrCmd contained '\%#=1\<\u\w\+\>\%([![:space:]]\|$\)\@=' nextgroup=vimBang
\u\w\+will match invalid patterns like:My_Invalid_Command. It needs to be[:alnum:].
Fixed.
- It would be easier to read with very magic to reduce the
\overload.
I don't want to mix pattern styles. The default is used by about 95% of the syntax files and also gets some useful highlighting.
"Easier to read" also depends on what you've been reading and for how long. :)
- POSIX character classes throughout would be better too.
For aesthetics? The \u atoms are faster.
- Characters (like vertical tab and line-end) in
[:space:], if used after a command, give errors. A tab or space only is allowed, so[:blank:]should replace[:space:]:
They're interchangeable in this syntax file, if you allow for the invalid syntax, and in this case it catches the pathological ^@ case. I'll update the use of [:space:] to [:blank:] throughout the file in a different commit in the interests of correctness.
I expect the pattern can be simplified further to something more like \u[[:alnum:]]*\%([^[:alnum:]]\|$\)\@=. It's impossible to match perfectly without the actual user command list, we can only hope for tasteful use of whitespace.
syn match vimUsrCmd contained '\v<[[:upper:]][[:alnum:]]+>%([[:blank:]!]|$)@=' nextgroup=vimBang
Illustrating with
/\v<[[:upper:]][[:alnum:]]+>%([[:space:]!]|$)@=why it should be[:blank:]:
They're all valid matches for a user command as far as I'm concerned. We don't try to invalidate earlier matches or entire commands based on later syntax errors.
The last match should be valid and is executed as
MyHelp
vim9cmd
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
thanks
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()