id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	branch_state	votes
1489	Block (aka multi-line) indent	dborca	angel_il	"I really liked the new feature of multi-line indent with non-persistent selections.  BUT, as it is, it's cumbersome.

1. Usually, I just need to quickly indent a block of code, and going into Options to turn Persistent selections off takes a lot of keypresses.  So I'd rather manually indent the block of code, than changing persistent selections off and on.  And I need selections.  And it is easy to forget which is which. :)

2. Backspace/Del with non-persistent selections is superfluous, because there is F8 for that.  With persistent selections.

3. Indenting should behave EXACTLY like Tab/Backspace will behave when used on a single, non-selected line.


Ok, so I came up with an idea, inspired from slackware-12.2/source/ap/mc/mc-4.6.1_20070623_utf8_mls_r2008-08-28.diff.gz

1. I removed the persistent selection code (except the Option setting itself, because I'm lazy)

2. Selections made with F3/Shift-F3 were left alone.

3. Selections made with Shift + movement keys are considered ""indentable"", until a key other than Tab, Ctrl-Tab, Backspace, M-i or Undo is pressed.  This is indicated in the status bar with an 'S' (as opposed to a 'B' for a regular selection).

4. An ""indentable"" selection can be operated in the following ways:
a. Tab will indent the block, honoring tabs, halftabs and tabs vs spaces stuff.  It behaves like Tab would behave on a single, non-selected line.  It maintains an ""indent depth"", so Undo works.  Empty lines are left alone.
b. BackSpace will unindent the block.  If ""indent depth"" (from a sequence of Tab keys) is available, it tries to unindent the block using backspace commands (behaving exacly like Tab would behave on a single, non-selected line).  Otherwise it tries to unindent the block using delete commands, applied at the beginning of each line (that is, it works like implemented in 4.7.0-pre1).
c. Ctrl-Tab will indent the block, always inserting (half)tabs at the beginning of the line.  It works like implemented in 4.7.0-pre1 and does not honor tabs vs spaces stuff.  Empty lines are left alone.  Note: if used after Tab, it will reset its ""indent depth"" and Tab will start over at the beginning of the line.
d. M-i wil indent the block, always inserting (half)tabs at the beginning of text, if any.  Mostly useful when indenting code which has a mix of spaces and tabs.  Empty lines are left alone.  Note: if used after Tab, it will reset its ""indent depth"" and Tab will start over at the beginning of the line.


It's the best I could come up with to make things painless.  Ideas and suggestions are welcomed.  Anyway, here's the patch (against 4.7.0-pre1)."	enhancement	closed	major	4.7.0-pre4	mcedit	4.7.0-pre1	fixed		dborca@…				committed-master
