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.
    • Finn McCarthyF
      Finn McCarthy
      last edited by

      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

      Claudia FrankC 1 Reply Last reply Reply Quote 1
      • Claudia FrankC
        Claudia Frank @Finn McCarthy
        last edited by

        @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
        • Finn McCarthyF
          Finn McCarthy
          last edited by

          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
          • Finn MacF
            Finn Mac
            last edited by

            character(s) would imply that there are multiple allowed

            1 Reply Last reply Reply Quote 0
            • Claudia FrankC
              Claudia Frank
              last edited by

              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
              • Finn MacF
                Finn Mac
                last edited by

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

                Cheers,
                Finn

                Claudia FrankC 1 Reply Last reply Reply Quote 0
                • Claudia FrankC
                  Claudia Frank @Finn Mac
                  last edited by Claudia Frank

                  @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
                  • Finn MacF
                    Finn Mac
                    last edited by

                    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
                    • PeterJonesP
                      PeterJones
                      last edited by PeterJones

                      @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
                      • PeterJonesP
                        PeterJones
                        last edited by

                        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
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors