In alot of cases the return value from ConstantName() isn't that meaningful. This change adds an optional 2nd paramenter that is used as a prefix for the constant to find.
Running:
print(scite.ConstantName(3))
print(scite.ConstantName(3, nil))
print(scite.ConstantName(3, ""))
print(scite.ConstantName(3, "ANN"))
print(scite.ConstantName(3, "SCE_C"))
print(scite.ConstantName(3, "SCE_C_"))
print(scite.ConstantName(3, "abc"))
Will output
ANNOTATION_INDENTED
ANNOTATION_INDENTED
ANNOTATION_INDENTED
ANNOTATION_INDENTED
SCE_CAML_KEYWORD
SCE_C_COMMENTDOC
C:\Users\xxx/SciTEStartup.lua:7: Argument does not match any Scintilla / SciTE constant
>Lua: error occurred while running startup script
Now you can do something like this :)
print(scite.ConstantName(editor.StyleAt[editor.CurrentPos], "SCE_C_"))
Committed as [5b7152].
Related
Commit: [5b7152]