I think that this is tricky, because what is the "right" way?  For a single 
line, it seems obvious that the line should be moved, whether or not it has 
been selected.  The hard case is when several lines have been selected and 
then the cursor is on another line.  Should only the selected lines move, 
or should the cursor line also be included?  My preference is that the line 
the cursor is on should be included in the move with the selected lines.  
Otherwise sometimes the cursor line moves and other times it does not, and 
I think that is confusing.  

IIUC, @jkn would like the rule to be:

1. If no line is selected, the cursor line gets moved;
2. If some lines are selected, even partially, then *only* the  lines with 
visible selection move, and the cursor line is not moved if its line is not 
selected.**

** A entire line gets moved even if it is only partly selected.

If we are looking at it at this level of detail, then we could also ask if 
a blank line should get moved when the cursor is on it.
On Tuesday, July 19, 2022 at 6:24:56 AM UTC-4 jkn wrote:

> I understand your point (I said "I can see how this occurs"), but IMO
> it would be better (more generally useful) if this was special-cased.
> As I say, the behaviour of Delete/Ctrl-X is different from 'move-lines'.
>
> I am happy if this opens up a discussion as to the benefits of each
> approach.
>
> J^n
>
>
> On Tuesday, July 19, 2022 at 11:00:25 AM UTC+1 spike wrote:
>
>> The KWrite editor works almost exactly the same way, just
>> Ctrl-Shift-Up/Down, and it doesn't insert blank lines if you try to go
>> past the top or bottom of the file.
>>
>> It can be a bit surprising that it works this way, but it's consistent
>> because you highlighted the newline character at the end of the upper
>> line. If you cut, it gets cut, too.
>>
>> Try highlighting between the 'i' and 'n' characters instead of at the
>> end to see why that makes sense.
>>
>> Cheers.
>>
>> On 2022-07-19 03:24, jkn wrote:
>> > Hi all
>> > I have been using the 'move-lines-up' and 'move-lines-down' commands
>> > (Ctrl-up and Ctrl-down) quite a bit recently. They are very handy and I 
>> miss
>> > them in other editors I use ;-)
>> > 
>> > I have seen a small inconsistency though; I flag it here for 
>> consideration
>> > as an enhancement. It's to do with how the lines to move are selected.
>> > 
>> > Lets say I have three lines:
>> > 
>> > line1
>> > line2
>> > line3
>> > 
>> > - if I have my cursor on line 1, then Ctrl-up/down moves just line 1
>> > (fine)
>> > 
>> > - if I have my cursor at the beginning of line 1, then press shift-down,
>> > the whole of line 1 is selected, and my cursor is at the beginning of 
>> > line2
>> > (fine so far)
>> > 
>> > - but if I then press Ctrl-up, both Line 1 *and* line 2 move: not what 
>> I 
>> > expect!
>> > I have to move my cursor 'left' (to be on the end of line 1), for only
>> > line 1 to move.
>> > 
>> > I can see how this occurs, but it is different if, say, having selected
>> > line 1 in the same way, I were to Ctrl-x (cut) it. Only the selected 
>> text
>> > in line 1 would be cut, not line 2 as well.
>> > 
>> > If possible I would request that this behaviour is changed. However
>> > it's pretty low priority, I would agree.
>> > 
>> > Thanks for Leo!
>> > Jon N
>> > 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/5dc4b37b-e3d4-4cf4-b478-c21442b0d912n%40googlegroups.com.

Reply via email to