Menu

Suggestn:Double-click word boundary selection

Miamidot
2007-04-19
2012-11-13
  • Miamidot

    Miamidot - 2007-04-19

    Given the sentence,
    [The fixed brown frog humps over the underdog]

    In NPP, to select the phrase,
    [fixed brown frog],
    just double-click on [fixed] and move the cursor over to [frog].

    That is one of the nice editing features that Eclipse unfortunately lacks. (I have no idea how Eclipse lovers could continue to love Eclipse!) So when working on Eclipsed projects, I have to perform much of my editing outside of Eclipse in NPP or in Netbeans (kudos to NPP, and Netbeans).

    This is a suggestion on improving word boundary recognition in NPP.

    Given the line,
    <target name="build-projects" depends="check-projects-uptodate">

    in order to select [check-projects-uptodate]
    double click on [check] and move cursor to [uptodate].

    However, NPP does not allow me to double-click select the phrase
    ["check-projects-uptodate"].

    Double-click on ["](just before [check]) and move cursor to ["] (just after [uptodate] will select the phrase
    [="check-projects-uptodate">].

    Therefore, I have to code
    <target name = "build-projects" depends = "check-projects-uptodate" >
    in order to allow proper phrase selection in NPP.

    Is there any means for me to configure NPP word boundary preference?
    If not, I am putting in a suggestion that NPP allows user configuration of word boundary preference.

    Note:
    Actually, word boundary and selection in NPP is already better than that of Microsoft's. Double-clicking [update] and then moving cursor backwards to [check]:
    NPP would correctly select [check-projects-uptodate],
    but Microsoft products would blindly select [check-projects-].

     
  • BadData

    BadData - 2011-02-18

    Hey, I would also love to have the ability to customize the double click selection properties in notepad++… that would be super useful for me.

    In fact, what would be really great would be to be able to customize both double and triple clicking.  So, for example if I had the text

    check-projects-uptodate

    and I double clicked "projects" I'd like to select "projects."  If I triple clicked "projects" I'd like to select "check-projects-uptodate."  And then 4 clicks would select the line.

    Thanks!

     
  • cchris

    cchris - 2011-02-18

    Double click on first word, and then Shift-Right until the selection is complete. Also, moving the cursor to end and Shift+clicking will do.

    Support for triple/quadruple click would have to come from Scintilla, you need to ask this project for the enhancement.

    CChris

     
  • Piotr Puczyński

    Hi,
    I have a problem with method described by Chris:
    when I extend a selection, the selection color changes from red to yellowish and the "internal search" for occurrences of the same string is not working with it. It only works with double-clicked words…
    Can I activate it somehow so that Notepad++ will always internally search for selection?

    Cheers,

     
  • Piotr Puczyński

    Sorry I wanted to write "from green to yellowish"… :)

     
  • Piotr Puczyński

    I found out that this feature is called "smart highlighting" in settings.  Again, is it possible to activate it for more that double-clicked words?

     
  • cchris

    cchris - 2012-02-12

    Nope. You can highlight all instances of some selection using Search -> Mark All -> Using (nth) style, but you do have to tell N++ to work with your selection. If Notepad++ had to search the whole document whenever your selection changes, performance would suffer a bit I guess.

    CChris

     
  • Piotr Puczyński

    CChris,
    yes the performance is the issue.
    I am working with XML with lot of random identifiers and when I double click any of it, all occurrences are highlighted.
    The problem is that some of the identifiers contain "-" that is recognized as end of a word by N++.
    I didn't notice that performance is decreased in this case so I opt for adding this (optional) feature so that Notepad++ will always search and highlight when I change the selection.

    Cheers

     
  • cchris

    cchris - 2012-02-18

    You can post a request for such optional enhancement on IdeaTorrent. Note that, in the current state of N++, the search will fail if the selection doesn't fall on a single line. But this could change soon…

    CChris