Hi @Claudia-Frank ,
thanks for the help again!
I have had trouble with the plugin manager before, but it’s no big deal as long as google is still around.
And the Python documentation isn’t a big problem either, again google will have all the answers ;P
I did look into Python before as i have a Raspberry Pi, but i have never really done anything with it.
Most of the time i write simple programs in C#, getting spoiled by MSDN and Intellisense, hehe.
Your suggestion works great tho, typing @ or # shows all entries in the api file and those from files i import in the script i’m writing.
I only wish i could start typing in lowercase and get Properly Cased autocomplete entries. I figured that editor.autoCSetIgnoreCase(True) would do this but i might be wrong.
Also inside the api file the ignoreCase attribute is set to ‘yes’ so it might be a scintilla or npp limitation?
I might just have to adjust my typing style and not be so lazy ;P
But i will try sorting the api file tho. (when i have more time)
Considering autocompleting autoit variables (starting with $) it works ok if i leave $ out of the AdditionalWordChars, i just have to type the first character after the $ and it pops up.
Comparing VS and npp is like comparing apples and oranges (or as we say in Holland, apples and pears) especially considering the sheer manpower behind VS.
I didn’t mean to bash npp but i was just a bit annoyed by the trouble i had. Maybe i should have waited a bit before posting.
Npp is great with all the features and plugins, it puts regular notepad to shame.
Besides, writing Python in VS isn’t that much better anyway and i still have a lot to learn.
I definitely see you can do some interesting things with the PythonScript plugin, i’ll have to look into that. And it’s documented pretty well too.
Thanks!
If anyone’s interested here’s the script: (fixed)
def setEditiorOpts(args):
# check if this editor already has the WordChars set
if editor.getProperty("_isOptionsSet"):
return
# get current WordChars and append additional chars. add any character you like here, but they may not all work
chars = editor.getWordChars() + "@#"
# set new WordChars
editor.setWordChars(chars)
# set a flag in this editor instance to prevent future calls
editor.setProperty("_isOptionsSet", True)
# manually call because callback will not be run upon start
setEditiorOpts({"bufferID": notepad.getCurrentBufferID()})
# register callback to be called whenever the current window changes
notepad.callback(setEditiorOpts, [NOTIFICATION.BUFFERACTIVATED])
(the forum doesn’t want to format the comments properly anymore?)
It’s possible to detect the current language with editor.getLexerLanguage(), it returns the current language as a string.
Or maybe you can use NOTIFICATION.LANGCHANGED instead of NOTIFICATION.BUFFERACTIVATED, but i haven’t looked into that.
Happy Holidays!