ahkscript / SublimeAutoHotkey

AutoHotkey AHK language package for SublimeText including syntax highlighting, comments toggling, auto-completions, build system definitions, commands for ahkrun, ahkcompile, ahkrunpiped.
The Unlicense
207 stars 43 forks source link

Fix hotkeyline.ahk #53

Closed tmplinshi closed 5 years ago

tmplinshi commented 5 years ago

if !(SubStr(oItem.path, 1, 3) = "::{") were treated as a hotkey line:

not hotkeyline

There are 2 rules for hotkey syntax as I know:

  1. Non-space characters. For example Lbutton:: or ^#Lbutton::
  2. With space and & character. For example a & b:: or a & b & c::

Current hotkeyline were matching all charcters with .+, I have changed the regex to the limited 2 rules mentioned above.

Before: <string>^\s*(.+)(::)</string> After: <string>^\s*(\S+(?:\s+&\s+\S+)*)(::)</string>