AutoCompletion startFunc
-
Hi,
I have a question:
How do I use more than one bracket in startFunc e.g. startFunc=“({[.” I know I cannot do startFunc=“({[.”
I have a language that requires more than one set of brackets so…
Is there a way?
Finn
-
looks like this can’t be done, if I understood the code correctly it is
hardcoded to read only one char.
A possible solution might be to use a scripting language plugin like
python script or lua script and define your own user lists to show up.Cheers
Claudia -
Hi,
Um…I had a look at the Notepad ++ wiki and found this:
The contents of a <AutoComplete> start with an autoclosing <Environment> tag, with the following attributes:
2. startFunc: the character(s) which start the parameter list. Default is "(" 3. stopFunc: the character(s) which end the parameter list. Default is ")"
-
character(s) would imply that there are multiple allowed
-
Hi,
multiple in terms of python api might use round brackets whereas another language uses curly brackets, I guess.
Cheers
Claudia -
Yeah…I wonder if there is a plugin maybe that does what i what?
Cheers,
Finn -
afaik, no but to be honest, I haven’t searched for it - just quickly run through
the plugin manager list. If you want to go the way using a scripting language,
then something like this could do the job I guess.from Npp import editor, SCINTILLANOTIFICATION start_proposal_mode_chars = [ord('('), ord('['), ord('{')] editor.autoCSetSeparator(ord(';')) def callback_USERLISTSELECTION(args): editor.insertText(args['position'], args['text']) def callback_CHARADDED(args): if args['ch'] in start_proposal_mode_chars: editor.userListShow(1,'parameter1, parameter2, parameter3') editor.callbackSync(callback_CHARADDED,[SCINTILLANOTIFICATION.CHARADDED]) editor.callbackSync(callback_USERLISTSELECTION,[SCINTILLANOTIFICATION.USERLISTSELECTION])
Not fully functional but should show the overall logic.
Cheers
Claudia -
Thanks
How do I mark something as answered?
P.S: It’s funny that your name is Claudia, because one of my best friends is also Claudia, though she is not a programmer
-
https://notepad-plus-plus.org/community/topic/14108/be-sure-to-mark-posts-solved-when-solution-found/3 : you should see a
Topic Tools ⏷
. You need to selectAsk as Question
, then selectMark As Solved
.(Also, don’t forget to upvote helpful posts.)
-
Also, assuming @Finn-McCarthy (original poster) is the same person as the second user @Finn-Mac: you will have to be logged in as @Finn-McCarthy to mark @Finn-McCarthy’s Topic as solved.