Community
    • Login

    [Feature Request] Intelligent delimiters insert

    Scheduled Pinned Locked Moved General Discussion
    intelligentdelimiterauto-insertauto-completionfeature request
    6 Posts 3 Posters 5.2k 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.
    • tomas-chrastinaT
      tomas-chrastina
      last edited by tomas-chrastina

      Hi,

      I’d like to suggest to add option to use “Intelligent” insert of delimiters, when I type it right before/after word/character. As optional setting per delimiter, or just one for all of them in menu Settings -> Preferences -> Auto-Completion ->Auto-Insert.

      When I type delimiter (let’s say quotes) out of word (not right before/after word) it works just fine:

      "" word ""
      

      Let’s say I want just put existing word to quotes. So we have:

      word
      

      Now when I try to add quotes(or any other delimieter) right before/after word, it will add also one more quote like this:

      word""
      ""word
      

      But I’d like if now it will add only one delimiter = don’t use auto-insert now:

      word"
      "word
      


      Thank you for considering it.


      Best regards,
      Tomas

      1 Reply Last reply Reply Quote 0
      • donhoD
        donho
        last edited by donho

        Could you try this binary and tell me what you think?
        https://notepad-plus-plus.org/temp/npp.zip

        tomas-chrastinaT 1 Reply Last reply Reply Quote 0
        • dailD
          dail
          last edited by

          @donho Looks like Google has disabled that link :(

          1 Reply Last reply Reply Quote 0
          • donhoD
            donho
            last edited by

            @dail Fixed. Thank you for noticing.

            1 Reply Last reply Reply Quote 0
            • dailD
              dail
              last edited by

              This has also annoyed me for quite a while so I’m glad to see something like this. This is much nicer than before. One thing I’d suggest is how you determine when you are “next” to something. For example, try to type:

              puts("string")

              The second parenthesis is auto-inserted, which is great, but once you type the " it does not auto insert the second quote since it thinks it is “next” to something.

              Also, on a side note, I’ve noticed some editors auto-wrap (not sure what a good terminology is) when you have something selected. For example if you select a string such as string and then type a " it would become "string". Same goes for parenthesis, brackets, etc. Makes it much easier to edit in certain cases. :)

              1 Reply Last reply Reply Quote 0
              • tomas-chrastinaT
                tomas-chrastina @donho
                last edited by

                @donho : Thank you very much! Tested, and it works perfectly.

                One more question: Do you prefer to post suggestions/bugs here on community, or on GitHub? So I know what is better for you, not to complicate things.
                If here, maybe it would be nice to have separated section for it? Or maybe even type of comments, so I can set it as resolved ;). Something like questions. But maybe I’m just thinking too much ;).

                @dail : Sure, it would be also nice feature, to close selected text to typed delimiter.

                Also one more suggestion for this feature in auto-insert for html/xml close tag. Let’s say we have any xml:

                <node name="abc"/>
                

                Then I’d like to add > as value, right after c. Or better say to “value” part. Just to use it while writing regular expression etc… I will get:

                <node name="abc></node>"/>
                


                So maybe to ignore this feature even in this case. Sure it’s not best to add non-xml-correct character as value. But I type it normal way. And after it’s done, I use plugin XML Tools -> Convert selection XML to text (). But on the other hand, maybe this is just my different approach, that is not needed globally. Still maybe also others would like to don’t auto-close xml tag while in value area?

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