Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configurable Home key behavoir #16

Open
unxed opened this issue Apr 11, 2021 · 4 comments
Open

configurable Home key behavoir #16

unxed opened this issue Apr 11, 2021 · 4 comments

Comments

@unxed
Copy link
Contributor

unxed commented Apr 11, 2021

In most editors, Home key means "go to the 1st character of a string". In turbo, Home key means "go to the 1st non-space character of a string if pressed once, and go to the 1st character of a string if pressed for the second time".

Can this behavior be made configurable to make turbo react on Home key just like all other editors? Thanks!

@magiblot
Copy link
Owner

Hey unxed,

I'm all for customization, although this is easier said than done. This issue is similar to #9: most of the work lies in integrating a configuration system and designing the interface to choose the settings. This project is a hobby, so all I can promise is: I'll do it some day. But I acknowledge that being useful and making users feel comfortable is a top priority, so getting this done would be a great accomplishment.

I am surprised, though, that your experience with text editors is so different from mine. The Home key behaviour in Turbo is the same as in:

@unxed
Copy link
Contributor Author

unxed commented Apr 12, 2021

Can you please suggest where to look for Home key behavior definition in the code? Hardcode will suit my personal needs for the near future :)

@magiblot
Copy link
Owner

Okay :). The default key bindings are defined in scintilla/src/Editor.cxx. But the Home key binding is concidentally overriden in src/editwindow.cc. Apply the following change near line 132:

-   editor.WndProc(SCI_ASSIGNCMDKEY, SCK_HOME | (SCI_NORM << 16), SCI_VCHOMEWRAP);
-   editor.WndProc(SCI_ASSIGNCMDKEY, SCK_HOME | (SCI_SHIFT << 16), SCI_VCHOMEWRAPEXTEND);
+   editor.WndProc(SCI_ASSIGNCMDKEY, SCK_HOME | (SCI_NORM << 16), SCI_HOMEWRAP);
+   editor.WndProc(SCI_ASSIGNCMDKEY, SCK_HOME | (SCI_SHIFT << 16), SCI_HOMEWRAPEXTEND);

Cheers.

@unxed
Copy link
Contributor Author

unxed commented Apr 12, 2021

Thank you very much! Indeed, the configuration interface is not so important to me as the ability to customize the behavior to suit my (perhaps a little bit strange) habits. Now it has become quite good for me to use turbo instead of the tilde, and I like it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants