Pressing space when selection is active

English main discussion
Post Reply
  • Author
  • Message
Offline
Posts: 36
Joined: Wed Apr 11, 2012 8:05 pm

Pressing space when selection is active

Post 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?

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

Hotkeys plugin

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

Offline
Posts: 23
Joined: Sun Nov 13, 2011 5:40 pm

Post 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!

Offline
Posts: 88
Joined: Sun Jun 03, 2012 8:15 am

Post by Visitor7 »

foliator, on standard keyboard easier to use the Del or Backspace.

Offline
Posts: 36
Joined: Wed Apr 11, 2012 8:05 pm

Post 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.

Offline
Posts: 36
Joined: Wed Apr 11, 2012 8:05 pm

Post 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.
Post Reply