Community
    • Login

    Highlighting matched single and double quotes.

    Scheduled Pinned Locked Moved General Discussion
    7 Posts 4 Posters 2.6k 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.
    • Frank HuttererF
      Frank Hutterer
      last edited by

      Hello,
      This is my first post here.
      I have just installed Notepad++ V7.7.1.
      I note that it matches braces, brackets, curly braces by highlighting. This is a great help in editing and writing code.

      However, it does not do this for singe and double quotes
      Is there as setting, coding, plug-in or some other way of adding this feature?

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @Frank Hutterer
        last edited by

        @Frank-Hutterer

        from core scintilla it is not supported but I’m unaware if some plugin is out there which simulates this behavior.
        Especially for quotes and double quotes it is hard to determine whether the one at the current position is used as the opening or closing mark.

        1 Reply Last reply Reply Quote 2
        • Frank HuttererF
          Frank Hutterer
          last edited by

          Thank y9ou for that reference.
          I understand that with braces etc. nesting may be accomplished, therefore, searching for a close brace is in order.

          However, single and double quotes cannot be nested and a simple search for the next occurrence from every second entry would suffice.
          Also, a total sum of single and double quotes in a document would prove that each occurrence is matched (of course not known if correctly matched).

          1 Reply Last reply Reply Quote 0
          • PeterJonesP
            PeterJones
            last edited by PeterJones

            @Frank-Hutterer said:

            However, single and double quotes cannot be nested

            I disagree. Just because the programming language you happen to use happens to make you think it does not allow nesting of quotes does not mean that no one who uses Notepad++ for a variety of programming and other text editing needs will ever need to nest quotes.

            In writing us-en dialog, it’s pretty easy to nest quotes: George said, "did you hear, John asked 'why did you say "the end is nigh"?'".

            And in any programming language I’ve used, there have been ways to nest and/or escape quotes, not all of which have to be balanced: printf("Hello, world. I said \"Hello, world\"! Notice my unbalanced quote '\"' embedded in this string\n");.

            1 Reply Last reply Reply Quote 3
            • Frank HuttererF
              Frank Hutterer
              last edited by

              I must admit, since I am using TCL/TK a lot, quotes cannot be nested (except for delimited ones), I assumed that other languages would do the same.

              However, I don’t see the nesting in your examples. I didn’t think that single quotes inside double quotes is nesting, like brackets inside braces I don’t think of as nesting. Braces inside braces or brackets inside brackets I call nesting.

              Checking Notepad++ now, I notice that it highlights delimited braces etc as valid matches. This makes debugging complicated due to incorrect highlighting of matching. Due to this problem it doesn’t really matter that there is no highlighting for matched quotes anyway.

              I do take your point that there may be languages that do allow nesting of quotes.

              Alan KilbornA 1 Reply Last reply Reply Quote 0
              • Frank HuttererF
                Frank Hutterer
                last edited by

                Just checked NPP for highlighting of matched braces etc. in another language and disregards delimited braces. Therefore, NPP matches correctly depending on the language.

                1 Reply Last reply Reply Quote 0
                • Alan KilbornA
                  Alan Kilborn @Frank Hutterer
                  last edited by Alan Kilborn

                  @Frank-Hutterer said:

                  I don’t see the nesting in your examples

                  Seriously?

                  "did you hear, John asked 'why did you say "the end is nigh"?'"

                  Seems pretty clear to me the the end is nigh 's quoting is nested inside the quoting of the whole thing.

                  The rest of your posting doesn’t make much sense to me either; guess I just don’t “get it”.

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