Skip to content

Commit

Permalink
Made set method of code property more efficient when highlighter is e…
Browse files Browse the repository at this point in the history
…nabled
  • Loading branch information
G33kDude committed Aug 9, 2017
1 parent cea0425 commit 7e8d129
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/CQT.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ class CodeQuickTester
}

set {
; TODO: Make more efficient by sending text directly to highlighter
GuiControl,, % this.hCodeEditor, %Value%
this.Highlight()
if this.Settings.UseHighlighter
this.Highlight(Value)
else
GuiControl,, % this.hCodeEditor, %Value%
return Value
}
}
Expand Down Expand Up @@ -252,7 +253,7 @@ class CodeQuickTester
SetTimer(this.Bound.Highlight, -200)
}

Highlight()
Highlight(NewCode:="")
{
if !this.Settings.UseHighlighter
return
Expand All @@ -264,7 +265,7 @@ class CodeQuickTester
Critical, 1000

; Run the highlighter
Text := Highlight(this.Code, this.Settings)
Text := Highlight(NewCode == "" ? this.Code : NewCode, this.Settings)

; "TRichEdit suspend/resume undo function"
; https://stackoverflow.com/a/21206620
Expand Down

0 comments on commit 7e8d129

Please sign in to comment.