AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

behave like Notepad space w/mulitple lines of selected text

 
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English)
View previous topic :: View next topic  
Author Message
Hanging



Joined: 25 Mar 2013
Posts: 13

PostPosted: Mon Mar 25, 2013 8:07 am    Post subject: behave like Notepad space w/mulitple lines of selected text Reply with quote

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.
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6089

PostPosted: Mon Mar 25, 2013 8:51 am    Post subject: Reply with quote

Hanging
http://akelpad.sourceforge.net/forum/viewtopic.php?p=18763
Back to top
View user's profile Send private message Send e-mail
Hanging



Joined: 25 Mar 2013
Posts: 13

PostPosted: Tue Mar 26, 2013 9:30 am    Post subject: Reply with quote

Instructor wrote:
Hanging
http://akelpad.sourceforge.net/forum/viewtopic.php?p=18763
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").

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.
Back to top
View user's profile Send private message
Instructor
Site Admin


Joined: 06 Jul 2006
Posts: 6089

PostPosted: Tue Mar 26, 2013 9:42 am    Post subject: Reply with quote

Hanging
"Command:" it is field name. You should input Insert(" ") in this field Smile
Back to top
View user's profile Send private message Send e-mail
Hanging



Joined: 25 Mar 2013
Posts: 13

PostPosted: Tue Mar 26, 2013 9:13 pm    Post subject: Reply with quote

Instructor wrote:
"Command:" it is field name. You should input Insert(" ") in this field :)
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".

Now the space is working the way I want. Excellent! What a wonderful application--thanks very much for creating it.
Back to top
View user's profile Send private message
valexiev



Joined: 05 Jan 2016
Posts: 3

PostPosted: Tue Jan 05, 2016 11:17 am    Post subject: replace selection on Space? Reply with quote

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
Back to top
View user's profile Send private message
opk44



Joined: 16 Jan 2010
Posts: 429

PostPosted: Tue Jan 05, 2016 3:00 pm    Post subject: Reply with quote

valexiev
Back to top
View user's profile Send private message
valexiev



Joined: 05 Jan 2016
Posts: 3

PostPosted: Tue Jan 05, 2016 3:23 pm    Post subject: Reply with quote

Thanks!
For the uninitaited: to make this effective after restarting Akelpad, add this

Code:
/Call("Hotkeys::Main",10)


to \\\reg\HKEY_CURRENT_USER\Software\Akelsoft\AkelPad\Options\CmdLineEnd or the respective akelpad.ini key
Back to top
View user's profile Send private message
opk44



Joined: 16 Jan 2010
Posts: 429

PostPosted: Wed Jan 06, 2016 1:19 am    Post subject: Reply with quote

valexiev
just add the plugin to autostart:
Alt+P (Plug-ins...) and select check-box ("Hotkeys::Main") for plugin autoload.
Back to top
View user's profile Send private message
valexiev



Joined: 05 Jan 2016
Posts: 3

PostPosted: Wed Jan 06, 2016 8:41 am    Post subject: Reply with quote

Autostart isn't good because it leaves the Hotkeys dialog open.
"10"in the /Call above tells it to keep the dialog hidden.
Back to top
View user's profile Send private message
opk44



Joined: 16 Jan 2010
Posts: 429

PostPosted: Wed Jan 06, 2016 11:29 am    Post subject: Reply with quote

valexiev wrote:
Autostart isn't good because it leaves the Hotkeys dialog open.
I've never seen that.
Back to top
View user's profile Send private message
KDJ



Joined: 06 Mar 2010
Posts: 1745
Location: Poland

PostPosted: Wed Jan 06, 2016 1:10 pm    Post subject: Reply with quote

valexiev
If you set autoload Hotkeys plugin, it doesn't show this plugin dialog.
Call("Hotkeys::Main", 10) is generally intended for external calls, eg. from the scripts.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Discussion (English) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group