#498 Delimiter select: respect escaped quotation marks


In the discussion forum, cchris raised the point that delimiter select should be able to handle escaped quotation marks. This is a good idea. The patch adds special handling for this case.

I haven't added any options for it, because I don't think it's worth it: If you're not a programmer, then you don't care about escape characters at all. If you're a programmer and set both delimiters to ", then you are very likely to want it to handle escaped quotes.

1 Attachments


  • Don HO

    Don HO - 2013-07-08

    Thank you Andreas.
    Could you provide me the sample please?


  • Don HO

    Don HO - 2013-07-08
    • status: open --> accepted
    • Priority: 5 --> 7
  • Andreas Jonsson

    Andreas Jonsson - 2013-07-08

    A sample for testing? If you set both delimiters to ", and Ctrl+DblClick inside the quote in something like this:

    string zzz = "test \"test\" some more test \"\"\"nested\"";

    Then (with the patch) the entire string will be selected.

    • Don HO

      Don HO - 2013-07-10

      Thank you for the explanation.
      However, in v6.4.2 Ctrl+DblClick inside the quote don't selecting all words in the quotes:
      "w1 w2 w3"
      if you ctrl+double click on '2', only w2 will be selected.

      Am I missing somethings?


  • Andreas Jonsson

    Andreas Jonsson - 2013-07-10

    Works as expected here; all of 'w1 w2 w3' is selected. Have you changed the delimiters to quotation marks? Without a GUI it needs to be done either when the user settings are loaded (and not just in the constructor of NppParameters), or with a small hack in NppNotification.cpp around line 435:

        case SCN_DOUBLECLICK :
            if(notification->modifiers == SCMOD_CTRL)
                NppGUI nppGUI = NppParameters::getInstance()->getNppGUI(); // Changed
                nppGUI._rightmostDelimiter = '"'; // Changed
                nppGUI._leftmostDelimiter = '"'; // Changed

    If your delimiters still parentheses, then double clicking on w2 will give the result you're getting. In this case, no delimiters can be located and the "normal" double-clicking code is run.

    • Don HO

      Don HO - 2013-07-11

      OK, I see.

      I'll make GUI concerning this part available in the next release.

      Thank you Andreas.


  • Don HO

    Don HO - 2013-07-12
    • status: accepted --> closed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks