Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Minor highlighter adjustments
Fixes block comments only being highlighted when preceded by an empty line.
  • Loading branch information
G33kDude committed Aug 15, 2017
1 parent a1e6a9c commit 56a6223
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
8 changes: 4 additions & 4 deletions CodeQuickTester.ahk
Expand Up @@ -36,13 +36,13 @@ Settings :=
; Highlighter (colors are 0xRRGGBB)
"UseHighlighter": True,
"Colors": [
0x7F9F7F, ; Comments
0x7F9F7F, ; Multiline comments
0x7CC8CF, ; Directives
0x97C0EB, ; Punctuation
0xF79B57, ; Numbers
0x7F9F7F, ; Comments
0xCC9893, ; Strings
0x7CC8CF, ; Directives
0x7F9F7F, ; Multiline comments
0xF79B57, ; A_Constants
0xF79B57, ; A_Builtins
0xE4EDED, ; Flow
0xCDBFA3, ; Commands
0x7CC8CF, ; Functions
Expand Down
25 changes: 13 additions & 12 deletions lib/Highlight.ahk
Expand Up @@ -9,18 +9,19 @@ Highlight(ByRef Code, Settings)
, Needle := "
( LTrim Join Comments
ODims)
([+*!~&\/\\<>^|=?:(),.```%{}\[\]\-]+) ; Punctuation
|(0x[0-9a-fA-F]+|[0-9]+) ; Numbers
|((?:^|\s);[^\n]+) ; Comments
|(""[^""\r\n]*"") ; Strings
|((?:^|\s)#[^ \t\r\n,]+) ; Directives
|(^\s*\/\*.+?\n\s*\*\/) ; Multiline comments
|\b(A_\w*|%Group5%)\b ; Builtins
|\b(" Flow ")\b ; Flow
|\b(" Commands ")\b ; Commands
|\b(" Functions ")\b ; Functions
|\b(" Builtins ")\b ; Keynames
|\b(" Keywords ")\b ; Other keywords
((?:^|\s);[^\n]+) ; Comments
|(^\s*\/\*.+?\n\s*\*\/) ; Multiline comments
|((?:^|\s)#[^ \t\r\n,]+) ; Directives
|([+*!~&\/\\<>^|=?:
,().```%{}\[\]\-]+) ; Punctuation
|(0x[0-9a-fA-F]+|[0-9]+) ; Numbers
|(""[^""\r\n]*"") ; Strings
|\b(A_\w*|" Builtins ")\b ; A_Builtins
|\b(" Flow ")\b ; Flow
|\b(" Commands ")\b ; Commands
|\b(" Functions ")\b ; Functions
|\b(" Keynames ")\b ; Keynames
|\b(" Keywords ")\b ; Other keywords
)"
FontTable := "{\fonttbl{\f0\fnil\fcharset0 "
Expand Down

0 comments on commit 56a6223

Please sign in to comment.