micro icon indicating copy to clipboard operation
micro copied to clipboard

modify `duplicateLine` to keep cursor still

Open notwithering opened this issue 10 months ago • 3 comments

see https://github.com/zyedidia/micro/pull/3635

  • when duplicating line it will keep the cursor still, this allows for bindings similar to DuplicateLine,CursorDown to duplicate down or just DuplicateLine for duplicating up

i'm also having trouble implementing a "selection down" action that moves the entire selection down, it will only move the selection down one line while DuplicateLine may add more than one line

notwithering avatar Jan 30 '25 21:01 notwithering

@dmaluka what are your thoughts on the "selection down" action?

notwithering avatar Jan 30 '25 21:01 notwithering

also fixes issue where undo

Does it?

what are your thoughts on the "selection down" action?

I remember you suggested it in https://github.com/zyedidia/micro/pull/3635#issuecomment-2623181017 but it doesn't make a lot of sense to me to have such a "generic" action independent of Duplicate*. The text below the selection is generally not the same text as where the selection is, it is a completely different text. So if we move the selection down, what happens? Some random part of this text gets selected, which is hardly useful.

dmaluka avatar Feb 02 '25 17:02 dmaluka

not entirely sure anymore, i think its safe for this to put in as is. maybe keeping the cursor still is all that should be merged

notwithering avatar Feb 02 '25 21:02 notwithering