#1860 Lua: Add prefix hint to ConstantName (files attached)

Feature_Request
closed-fixed
5
2016-10-16
2016-09-08
dail8859
No

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_"))
4 Attachments

Discussion

  • Neil Hodgson

    Neil Hodgson - 2016-09-09
    • labels: --> scite, scripting
    • status: open --> open-fixed
    • assigned_to: Neil Hodgson
     
  • Neil Hodgson

    Neil Hodgson - 2016-10-16
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks