Rev 9cafc3e: nice additions to move-lines-up/down

22 views
Skip to first unread message

Edward K. Ream

unread,
Mar 26, 2017, 7:12:40 AM3/26/17
to leo-editor
These commands (bound to ctrl-up/down by default) now work at the top or bottom of the body pane. The move-lines-up command inserts a new line below the selected line/lines when the lines are at the top of the body text.  Similarly, the move-lines-down command inserts a line before the moved lines when at the bottom of the body text. Imo, this is a natural and useful.

I would also like to extend the idea to ctrl-left/right, inserting or deleting leading indentation on all lines containing selected text. Just like tab and shift-tab when there are lines selected.

And just like tab, there is a problem if there is no selected text. Do we want to insert a tab, or change leading indentation?  This is a common, difficult, case. Maybe the solution is to bind ctrl-tab and ctrl-shift-tab to (new?) commands that work regardless of whether any text is selected...

Edward

Edward K. Ream

unread,
Mar 26, 2017, 11:54:20 AM3/26/17
to leo-editor
On Sunday, March 26, 2017 at 6:12:40 AM UTC-5, Edward K. Ream wrote:

I would also like to extend the idea to ctrl-left/right, inserting or deleting leading indentation on all lines containing selected text. Just like tab and shift-tab when there are lines selected.

And just like tab, there is a problem if there is no selected text. Do we want to insert a tab, or change leading indentation?  This is a common, difficult, case. Maybe the solution is to bind ctrl-tab and ctrl-shift-tab to (new?) commands that work regardless of whether any text is selected...

The indent-region and unindent-region  commands do almost exactly what is desired, so this is only a binding question.  However, imo, these commands should not change the selection, especially if there is none.  I'll fix this soon.

Edward

Edward K. Ream

unread,
Mar 26, 2017, 12:27:24 PM3/26/17
to leo-editor
On Sunday, March 26, 2017 at 10:54:20 AM UTC-5, Edward K. Ream wrote:

The indent-region and unindent-region  commands do almost exactly what is desired
...
imo, these commands should not change the selection, especially if there is none.  I'll fix this soon.

Done at e117a76.

Edward
Reply all
Reply to author
Forward
0 new messages