Page 1 of 1

Pressing space when selection is active

Posted: Sun Jul 22, 2012 12:20 am
by qoshinator
When I select text from multiple lines and press space, the text is indented instead of replaced. How do I change this behavior?

Posted: Sun Jul 22, 2012 12:47 am
by Instructor
Hotkeys plugin

Name: "Insert space"
Command: Insert(" ")
Hotkey: Space

Posted: Tue Jul 24, 2012 9:34 pm
by foliator
Instructor wrote:Hotkeys plugin

Name: "Insert space"
Command: Insert(" ")
Hotkey: Space
I had the same problem for a long time, Instructor, and your instructions solved it. However, I've assigned Alt Space as the hotkey, because assigning just Space by itself will disable a very useful function of the spacebar in AkelPad: It can indent a whole paragraph one space at a time, or in the case of columns, it can move a whole column to the right one space at a time. Very handy!

Posted: Wed Jul 25, 2012 11:57 am
by Visitor7
foliator, on standard keyboard easier to use the Del or Backspace.

Posted: Fri Jul 27, 2012 4:41 am
by qoshinator
Maybe "auto-indentation with multi-line selection" would be better if it only triggered when you selected every character in the multiple lines, rather than whenever you select multiple lines. So: if you select "ABC\nDEF" below, indentation will trigger, but if you select "C\nDEF", it will not, since the "AB" is missing.

ABC
DEF

One problem with the existing behavior is that the entire lines are selected. For example, if you select "C\nDEF", press space, then start typing, then the entire "ABC\nDEF" will be erased rather than just "C\nDEF". If the user doesn't realize this quickly, then the deletion of "AB" can be buried below a huge edit history or even worse, lost after saving.

However, I don't find the indentation feature useful in general. Alt+select already implements multi-line indentation, and more robustly too because you can indent in any column rather than just the first column. Also, with auto-indentation, the user must look at the screen to figure out if selecting and typing will replace text or indent it; this causes paranoia which is no good.
Since auto-indentation with multi-line causes headaches and is strictly worse than alt-select, I don't think it should be the default behavior. Perhaps it could be moved into a plugin? Just my two cents.

Posted: Tue Jul 31, 2012 4:35 am
by qoshinator
qoshinator wrote:Alt+select already implements multi-line indentation, and more robustly too because you can indent in any column rather than just the first column.
Actually, I just discovered this wasn't true. In Visual Studio, if you use Alt+Select to select a block of characters, and then type "a", then the character "a" will appear in each selected row. This isn't implemented in AkelPad.