Hi, all.
I've noticed that the AHK syntax-highlighting definition file that's bundled with the current version of vim fails to highlight a number of commands. The problem appears to be that although the following lines are in the "syn keyword autohotkeyPreProc" section, they aren't in the "syn keyword autohotkeyCommand" section. The exception is the "KeyHistory" item, which is in both sections and which does highlight correctly.
\ HotkeyInterval HotKeyModifierTimeout
\ Hotstring
\ IfWinActive IfWinNotActive IfWinExist IfWinNotExist
\ MaxHotkeysPerInterval MaxThreads MaxThreadsBuffer MaxThreadsPerHotkey
\ UseHook InstallKeybdHook InstallMouseHook
\ KeyHistory
\ NoTrayIcon SingleInstance
\ WinActivateForce
\ AllowSameLineComments
\ ClipboardTimeout
\ CommentFlag
\ ErrorStdOut
\ EscapeChar
\ MaxMem
\ NoEnv
\ Persistent
vim syntax highlighting missing some f'ns
Re: vim syntax highlighting missing some f'ns
Um, thats because they are not commands, they are preprocessed directives, requiring the # character to precede them.
KeyHistory is special because it is both a command and a directive, thats why its in both locations.
Everything highlights correctly for me:
KeyHistory is special because it is both a command and a directive, thats why its in both locations.
Everything highlights correctly for me:
Re: vim syntax highlighting missing some f'ns
IfWinActive, IfWinNotActive, IfWinExist, and IfWinNotExist are functions. I noticed that they weren't being highlighted in code that I'd written. I wasn't paying close enough attention to notice that the other items are preprocessed directives when I wrote my note; I just saw that they also weren't being highlighted when I copied them into a test script.
Re: vim syntax highlighting missing some f'ns
Those 4 are not functions (the functions are WinExist() and WinActive() and are listed under syn keyword autothotkeyFunction section), but yes they are commands.BunsenH wrote: IfWinActive, IfWinNotActive, IfWinExist, and IfWinNotExist are functions. I noticed that they weren't being highlighted in code that I'd written. I wasn't paying close enough attention to notice that the other items are preprocessed directives when I wrote my note; I just saw that they also weren't being highlighted when I copied them into a test script.
You are right, they are similar to KeyHistory in that they are both preprocessed directives AND commands.
Re: vim syntax highlighting missing some f'ns
Commands, then. My point is that they aren't highlighted by the definition file that's bundled with the current version of vim, when they're used as commands.
Re: vim syntax highlighting missing some f'ns
I have updated the Vim syntax file and i am maintaining it here:
https://github.com/mmikeww/autohotkey.vim
its also now included with the latest Vim
https://github.com/mmikeww/autohotkey.vim
its also now included with the latest Vim
Who is online
Users browsing this forum: No registered users and 3 guests