Menu

#1493 Moving with arrow keys in column (rectangular) mode editing

Initial
open
nobody
4
2023-08-24
2023-08-20
Vic
No

Column mode is lots of fun :) , thank you.

I wonder why do we have the limitation that once you press Arrow:-Left/Right/Up/Down , the column mode vanishes?
Would it be possible to instead have those keys move the whole vertical set of carets in the respective direction?
For escaping the column mode, how about ESC key? (In addition to the other existing ways to escape, like clicking in text. )

Discussion

  • Vic

    Vic - 2023-08-20

    ... just like it's possible in case of multi-editing (multi-caret, with ctrl+click) mode.

     
  • Vic

    Vic - 2023-08-20

    I found this discussion true multi caret editing, where Neil said:

    An option to allow left/right with rectangular selection may be reasonable if someone contributes an implementation.

    That's good. I suppose up/down too?

    On how the feature would work:
    I think should allow any kinds of arrow movements that still preserve the vertical allignment, as well as the initial count, of the carets.

    In a first, simpler implementation , could allow:
    * Left just till start of lines
    * Right till EOL of the shortest line in the group.
    * Up/Down till first line that is shorter than column of carets

    Then later, if the/an implementer is willing, could make it more general. (For example, if moving up and encounter a line than where caret is => move carets to left till at same column as last char in that upper encountered line).

    EDIT: could also be naturally extended to Home and End keys, and perhaps few other ways to move the caret, naturally.

     

    Last edit: Vic 2023-08-20
  • Neil Hodgson

    Neil Hodgson - 2023-08-22

    Pressing right/left is the common way to deselect text so it was implemented the same in rectangular selection mode. Moving a rectangular selection up/down seems less common then left/right.

     
  • Vic

    Vic - 2023-08-24

    I understand that Right/Left will deselect, and that can be kept.
    But what I'm refering to in this Feature is not to destroy / collapse the tall vertical caret (the multiple component carets) when you press the arrow keys.

     
  • Neil Hodgson

    Neil Hodgson - 2023-08-24

    But what I'm refering to in this Feature is not to destroy / collapse the tall vertical caret (the multiple component carets) when you press the arrow keys.

    While there is always a selection in Scintilla, an empty rectangular selection is considered more of a selection than the simple empty single caret so exiting from rectangular to simple can be seen as deselection.

     
  • Vic

    Vic - 2023-08-24

    OK. But it doesn't have to be the other way around, does it? I.e, deselection does not have to imply exiting rectangular mode.
    Just like when keep Alt+Shift pressed, it's possible to deselect (make selection empty) with the arrows.

     

    Last edit: Vic 2023-08-25

Log in to post a comment.