#147 Select line from gutter

v5.2
closed-fixed
core (195)
5
2013-12-09
2007-06-04
matt
No

It would be very convenient to be able to select an entire line of text, including the return character, by simply clicking in the gutter. Even better, select multiple lines by clicking and dragging in the gutter. Several lesser editors have this feature. Any chance of having this added?

Discussion

  • Robert Schwenn
    Robert Schwenn
    2007-06-04

    Logged In: YES
    user_id=1486645
    Originator: NO

    Actually one single line can be selected by triple-clicking anywhere in the line, and one ore more
    entire lines can be selected by clicking the first caret position of a line and dragging down there.

    Does it make a difference between clicking the gutter or about 1 mm right of that?
    Propably compatibility to other text processors does. But I'm afraid that interferences with fold handling will come along with such a feature...

     
  • matt
    matt
    2007-06-11

    Logged In: YES
    user_id=1442031
    Originator: YES

    I appreciate the response. Clicking the first caret position works, but that means positioning the mouse in a narrow range (just a few pixels). When I am moving a lot of lines around, it can be tedious. What if line selection was limited to the area of the gutter with line numbers? It would only be available when line numbering is enabled, but that makes sense to me.

     
  • Marcelo Vanzin
    Marcelo Vanzin
    2007-06-11

    Logged In: YES
    user_id=75113
    Originator: NO

    Matt, you don't need to triple-click on the first character of the line. You can triple-click anywhere on the physical area of the line, even if there are no characters there, and the line will be selected.

    I think it's a lot easier to hit than the gutter, too.

     
  • matt
    matt
    2007-06-15

    Logged In: YES
    user_id=1442031
    Originator: YES

    I don't mind triple-clicking for a single line, but it is a little tedious to select multiple lines. Maybe I am just uncoordinated, or impatient. It takes me longer than it should to align the mouse over the first character (selecting multiple lines). I consistently miss the first character of the first line, or pick up the first character of the line after my intended selection.

     
  • A patch to allow selection from the gutter

     
    • assigned_to: nobody --> shlomy
     
  • Added a patch that enables this. If line numbers are displayed, the line number area is the one used for line selection. If line numbers are not displayed, a small area is added to the gutter for that purpose.
    In addition, the markers in the buffer are now limited to that area and do not span to the fold markers as well.

     
  • The patch handles also selection of collapsed folds. Clicking the selection area of the gutter in a collapsed fold will select the entire fold. Same for dragging across a collapsed fold.

    What's left to be added to the patch are the following:
    1. An option to toggle off the gutter (since now it's wider if line numbers are not displayed).
    2. Scrolling when the dragging goes vertically outside the gutter.

    Please let me know if this works well.

     
  • Committed as patch #2763968.

     
    • status: open --> closed-fixed