Highlight custom functions in SciTE?
Highlight custom functions in SciTE?
Hey, I would like to know whether it is possible to highlight own/custom functions (to be precise: their names), like ScitE4AHK does with built-in functions like Round() or Sqrt(). I found nothing regarding this on the forum/the Internet.
Re: Highlight custom functions in SciTE?
Create a text file named user.ahk.api in your SciTE user config directory, and list the functions there, one to a line.
Re: Highlight custom functions in SciTE?
After doing so my functions were added to SciTE's auto-complete feature, but still have no highlighting. I found this in the meantime in an old thread: keywords3.$(file.patterns.ahk)=$(ahk.keywords3) lowercase custom function names
I cannot figure out how to use this correctly. When I exchange keywords with a function's name, it does not have an effect.
Edit:
Found out how it works, lol:
keywords3.$(file.patterns.ahk)=$(ahk.keywords3) customfunction
However, it does not work with a function that has a number as a suffix. Is there some way to fix this?
I cannot figure out how to use this correctly. When I exchange keywords with a function's name, it does not have an effect.
Edit:
Found out how it works, lol:
keywords3.$(file.patterns.ahk)=$(ahk.keywords3) customfunction
However, it does not work with a function that has a number as a suffix. Is there some way to fix this?
Re: Highlight custom functions in SciTE?
Right, I mustn't have been paying attention.
If you meant "any function name with a common prefix and any number as a suffix" (which seems odd), you can write ^foo, but it will also highlight any "foo" with any other (numeric or non-numeric) suffix.
What do you mean? This highlights foo42 just fine:Leli196 wrote:However, it does not work with a function that has a number as a suffix.
Code: Select all
keywords3.$(file.patterns.ahk)=$(ahk.keywords3) foo42
Re: Highlight custom functions in SciTE?
It was because I wrote this:
It only highlighted the last name "bar" because you have to write all keywords to the same line or use the following method:
Btw, the number changes the type of highlighting; 1 is used for special variable names like A_Index, 2 for Commands like PixelGetColor and 3 for functions.
Maybe this helps somebody in the future.
Code: Select all
(This is an example of how to do it wrong!!)
keywords3.$(file.patterns.ahk)=$(ahk.keywords3) foo
keywords3.$(file.patterns.ahk)=$(ahk.keywords3) foo2
keywords3.$(file.patterns.ahk)=$(ahk.keywords3) foo3
keywords3.$(file.patterns.ahk)=$(ahk.keywords3) bar
Code: Select all
ahk.keywords3=\
keywords functions etc \
another keyword another function \
keywords3.$(file.patterns.ahk)=$(ahk.keywords3)
Maybe this helps somebody in the future.
- rediffusion
- Posts: 58
- Joined: 15 Mar 2019, 05:16
Re: Highlight custom functions in SciTE?
@lexikos
@Leli196
Tested right now...
For me it works if I put it here:
Apologize, but I'm at a dead end! So I have to write a post... ʅ_(ツ)_ʃ
@Leli196
Tested right now...
For me it works if I put it here:
I also found a file that contains `keywords`. I don't understand why they're here and where they're being used?:"C:\Users\MyPC\Documents\AutoHotkey\SciTE\SciTEUser.properties"
P.S. ··· @gregster"C:\Program Files\AutoHotkey\SciTE\ahk.keywords.properties"
Who is online
Users browsing this forum: No registered users and 2 guests