• Login
Community
  • Login

Highlighting matched single and double quotes.

Scheduled Pinned Locked Moved General Discussion
7 Posts 4 Posters 2.7k 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
    Frank Hutterer
    last edited by Jul 28, 2019, 11:23 PM

    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?

    E 1 Reply Last reply Jul 29, 2019, 11:35 AM Reply Quote 0
    • E
      Ekopalypse @Frank Hutterer
      last edited by Jul 29, 2019, 11:35 AM

      @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
      • F
        Frank Hutterer
        last edited by Jul 29, 2019, 12:39 PM

        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
        • P
          PeterJones
          last edited by PeterJones Jul 29, 2019, 1:31 PM Jul 29, 2019, 1:30 PM

          @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
          • F
            Frank Hutterer
            last edited by Jul 29, 2019, 10:32 PM

            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.

            A 1 Reply Last reply Jul 30, 2019, 12:06 AM Reply Quote 0
            • F
              Frank Hutterer
              last edited by Jul 29, 2019, 11:31 PM

              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
              • A
                Alan Kilborn @Frank Hutterer
                last edited by Alan Kilborn Jul 30, 2019, 12:09 AM Jul 30, 2019, 12:06 AM

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