• Login
Community
  • Login

AutoCompletion startFunc

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
10 Posts 4 Posters 2.3k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F
    Finn McCarthy
    last edited by May 15, 2018, 12:56 AM

    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

    C 1 Reply Last reply May 15, 2018, 11:38 PM Reply Quote 1
    • C
      Claudia Frank @Finn McCarthy
      last edited by May 15, 2018, 11:38 PM

      @Finn-McCarthy

      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

      1 Reply Last reply Reply Quote 2
      • F
        Finn McCarthy
        last edited by May 16, 2018, 3:23 AM

        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 ")"
        

        The rest: http://docs.notepad-plus-plus.org/index.php/Editing_Configuration_Files#Autocompletion.2C_aka_API.2C_files

        1 Reply Last reply Reply Quote 1
        • F
          Finn Mac
          last edited by May 16, 2018, 5:37 AM

          character(s) would imply that there are multiple allowed

          1 Reply Last reply Reply Quote 0
          • C
            Claudia Frank
            last edited by May 16, 2018, 9:27 AM

            Hi,

            multiple in terms of python api might use round brackets whereas another language uses curly brackets, I guess.

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 2
            • F
              Finn Mac
              last edited by May 16, 2018, 12:10 PM

              Yeah…I wonder if there is a plugin maybe that does what i what?

              Cheers,
              Finn

              C 1 Reply Last reply May 16, 2018, 9:27 PM Reply Quote 0
              • C
                Claudia Frank @Finn Mac
                last edited by Claudia Frank May 16, 2018, 9:28 PM May 16, 2018, 9:27 PM

                @Finn-Mac

                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

                1 Reply Last reply Reply Quote 2
                • F
                  Finn Mac
                  last edited by May 16, 2018, 10:03 PM

                  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

                  1 Reply Last reply Reply Quote 1
                  • P
                    PeterJones
                    last edited by PeterJones May 16, 2018, 10:13 PM May 16, 2018, 10:10 PM

                    @Finn-Mac,

                    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 select Ask as Question, then select Mark As Solved.

                    (Also, don’t forget to upvote helpful posts.)

                    1 Reply Last reply Reply Quote 2
                    • P
                      PeterJones
                      last edited by May 16, 2018, 10:16 PM

                      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.

                      1 Reply Last reply Reply Quote 2
                      1 out of 10
                      • First post
                        1/10
                        Last post
                      The Community of users of the Notepad++ text editor.
                      Powered by NodeBB | Contributors