Community
    • Login

    AutoCompletion startFunc

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    10 Posts 4 Posters 2.9k Views 3 Watching
    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 Offline
      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 Offline
        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 Offline
          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 Offline
            Finn Mac
            last edited by

            character(s) would imply that there are multiple allowed

            1 Reply Last reply Reply Quote 0
            • Claudia FrankC Offline
              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 Offline
                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 Offline
                  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 Offline
                    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 Offline
                      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 Offline
                        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

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors