behave like Notepad space w/mulitple lines of selected text
- Author
- Message
-
Offline
- Posts: 16
- Joined: Mon Mar 25, 2013 7:38 am
behave like Notepad space w/mulitple lines of selected text
I love AkelPad but I'm not a programmer or sophisticated technical user. I have replaced Notepad with Akelpad using the Debugger registry key and am sailing merrily along except for one thing: I can't get used to Akelpad's behavior when multiple lines of text are selected and the space bar is pressed. Akelpad selects the entire paragraph (complete line) and then puts a single space at the beginning, whereas decades of use have accustomed me to the behavior of Notepad and every other text editor/word processor I've ever used: the selected text is deleted and only after that is a space added. Akelpad does this if text on a single line is selected, but not if the selection spans multiple lines. How can I make Akelpad's spacebar behave the same on text selections for multiple lines as it does within a single line?
In the Hotkeys plugin I attempted to achieve this by specifying "command(4156) command(4168)", but unfortunately if nothing is selected, the spacebar doesn't move at all (because the two commands cancel each other out, I assume). So I need a way for Akelpad to sense that text is selected, and only then should it do "command(4156) command(4168)". Otherwise it should simply execute command(4168) alone. But I searched through the help and the text file for Hotkeys and didn't find a command that would tell Akelpad whether or not text is selected, whether multiple lines or within a line.
I thought there might be a script available in the very large Scripts thread here, but I did a couple of searches, e.g. "change space hotkey", "space multiple selection" and "make space behave like notepad", but didn't find anything relevant. (If there is one, I assume that the manual tells how to apply a script to a key--otherwise I'll be asking about that too... ;)
Thanks for any help--what an awesome little app. The fact that I can ask this question and know that there's an answer speaks for itself.
In the Hotkeys plugin I attempted to achieve this by specifying "command(4156) command(4168)", but unfortunately if nothing is selected, the spacebar doesn't move at all (because the two commands cancel each other out, I assume). So I need a way for Akelpad to sense that text is selected, and only then should it do "command(4156) command(4168)". Otherwise it should simply execute command(4168) alone. But I searched through the help and the text file for Hotkeys and didn't find a command that would tell Akelpad whether or not text is selected, whether multiple lines or within a line.
I thought there might be a script available in the very large Scripts thread here, but I did a couple of searches, e.g. "change space hotkey", "space multiple selection" and "make space behave like notepad", but didn't find anything relevant. (If there is one, I assume that the manual tells how to apply a script to a key--otherwise I'll be asking about that too... ;)
Thanks for any help--what an awesome little app. The fact that I can ask this question and know that there's an answer speaks for itself.
-
Offline
- Posts: 16
- Joined: Mon Mar 25, 2013 7:38 am
Thanks very much. I can't get past a syntax error, however. In the Hotkeys plugin, the correct command to edit, if I'm not mistaken, is IDM_EDIT_INSERT_SPACE. However, when I try to replace the current command with Command: Insert(" "), AkelPad says "Syntax error" and does not make the change (same result if I delete the space between "Command:" and "Insert").Instructor wrote:Hanging
viewtopic.php?p=18763
I tried to replace IDM_EDIT_INSERT_SPACE with "Insert space", per the link, but Akelpad then says "Hotkey already assigned to IDM_EDIT_INSERT_SPACE" and I can't proceed. I tried to delete the whole command, but Akelpad won't do that either--the hotkey appears to be gone, but if I press "All keys", it shows up again. (Same with program restart.)
Sorry, I know I'm probably missing something easy, but sincerely don't know what to do next.
-
Offline
- Posts: 16
- Joined: Mon Mar 25, 2013 7:38 am
Aha! I was confused because of the native AkelPad commands that use the "Command(xxxx)" syntax. I thought perhaps other commands would also need the string "Command".Instructor wrote:"Command:" it is field name. You should input Insert(" ") in this field :)
Now the space is working the way I want. Excellent! What a wonderful application--thanks very much for creating it.
-
Offline
- Posts: 4
- Joined: Tue Jan 05, 2016 11:04 am
replace selection on Space?
Space replaces the selection if it's single line, but indents it if it's multiline. I find this annoying and want Space to always replace the selection.
I checked the standard key binding of Space (Alt+P, Hotkeys, All keys) and it's Command(4168).
I added a custom binding Command(4169), but there's no effect.
Can you help? Thanks!
BTW, the command descriptions are not very informative. Eg neither of these below says anything about replacing the selection:
4168 Insert space
4169 Insert space only if several lines selected
I checked the standard key binding of Space (Alt+P, Hotkeys, All keys) and it's Command(4168).
I added a custom binding Command(4169), but there's no effect.
Can you help? Thanks!
BTW, the command descriptions are not very informative. Eg neither of these below says anything about replacing the selection:
4168 Insert space
4169 Insert space only if several lines selected
-
Offline
- Posts: 4
- Joined: Tue Jan 05, 2016 11:04 am
Thanks!
For the uninitaited: to make this effective after restarting Akelpad, add this
to \\\reg\HKEY_CURRENT_USER\Software\Akelsoft\AkelPad\Options\CmdLineEnd or the respective akelpad.ini key
For the uninitaited: to make this effective after restarting Akelpad, add this
Code: Select all
/Call("Hotkeys::Main",10)