#184 Paste in mode "Rectangular Selection" should paste into rows

open
nobody
core (195)
5
2007-11-20
2007-11-20
Tom Kieffer
No

In "Rectangular Selection" mode, if you paste what you previously copied, new rows are added with the copied content. This is the same than paste in normal selection mode. In rectangular selection mode, paste should insert the copied content at the cursor position into all following rows instead of inserting new rows. See example.

copied rows:

*
*
*

Paste before:
text1
text2
text3

What command does now (normal paste):

*
*
*text1
text2
text3

What command should do (rectangular paste):

*text1
*text2
*text3

Discussion

1 2 > >> (Page 1 of 2)
  • Logged In: YES
    user_id=1477607
    Originator: NO

    Sorry, but I disagree. I think the current behavior is the one most users would expect. With your suggestion, what would happen in the following case:

    Before pasting:
    abcdefgh
    a
    a
    a

    And now you put the caret after 'e' and paste. What should happen in the following rows, which only contain one character? In my opinion, the behavior you expect can be added as a feature request, as a "special type of paste", but it should not be specified as a bug, and should not replace the current paste behavior but rather extend it. Note that the Rectangular Selection mode is about selection, not about copy & paste. Of course, what you copy is the selection, and when you paste, the pasted text replaces the current selection (or inserts text at the caret location if there is no selection).

     
  • Robert Schwenn
    Robert Schwenn
    2007-11-20

    • labels: 102668 -->
     
  • Robert Schwenn
    Robert Schwenn
    2007-11-20

    Logged In: YES
    user_id=1486645
    Originator: NO

    Of course the current behavior is not a bug, because it has "ever" been so and - so I think - it's also a question of taste and desires.

    But like Tom I'd like to see the inserted rectangular selection appearing as a rectangle rather than anything else. It's more intuitive for me. In UltraEdit the last example/question results in:

    abcde*fgh
    a *
    a *
    a

    This would be fine, wouldn't it? I will change this item to a feature request.

     
  • Robert Schwenn
    Robert Schwenn
    2007-11-20

    • milestone: 101608 -->
     
  • Robert Schwenn
    Robert Schwenn
    2007-11-20

    • labels: --> core
     
  • Dale Anson
    Dale Anson
    2007-11-21

    Logged In: YES
    user_id=187628
    Originator: NO

    I'm not even sure this warrants a feature request. To do what you're trying to you, you need to select a rectangular paste area to match up with your rectangular selection area. It's really no trouble at all to paste the starts in front of the text:

    Copied:
    *
    *
    *

    Paste before:
    text1
    text2
    text3

    Select rectangular (using pipes to represent the selection, but in reality, this is a 0-width selection):
    |text1
    |text2
    |text3

    After paste:
    *text1
    *text2
    *text3

    Since what you want is easily doable, and the default behavior is often desirable, I'm not sure what the request is.

     
  • Logged In: YES
    user_id=1477607
    Originator: NO

    It does. The example I gave below demonstrates a case where it would not be possible to easily select a rectangular area for the paste action (since the lines need to be enlarged). Also, it is much easier just to place the caret in the position of the paste than to do the rectangular selection even if no further action is required.

     
  • Dale Anson
    Dale Anson
    2007-11-21

    Logged In: YES
    user_id=187628
    Originator: NO

    Shlomy, see Robert's example following your example:

    abcde*fgh
    a *
    a *
    a

    Is that the behavior you expect? If so, this is easily doable right now in jEdit with no changes. This is why I question the need for an enhancement.

     
  • Dale Anson
    Dale Anson
    2007-11-21

    Logged In: YES
    user_id=187628
    Originator: NO

    Hi Shlomy, please see Robert's example following your example:

    abcde*fgh
    a *
    a *
    a

    Is that the behavior you expect? If so, this is easily doable right now in jEdit with no changes. This is why I question the need for an enhancement.

     
  • Logged In: YES
    user_id=1477607
    Originator: NO

    You are right, sorry, I didn't notice jEdit allows rectangular selection to extend beyond the end of line. Note however that the expected behavior is still much easier to do by just placing the caret at the paste location than by creating yet another rectangular selection for the paste area. Note that in the later case (when you use rectangular selection to be replaced by the paste action), you need to select the exact number of lines, or otherwise you get either a subset of the lines pasted or a wrap-around of the paste content if you selected too many lines. But you're right, this is more-or-less easily achieved with the current jEdit features.

     
1 2 > >> (Page 1 of 2)