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

Home and End keys work counter-intuitively #3234

Open
halmai opened this Issue Oct 15, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@halmai

halmai commented Oct 15, 2018

  • Sequel Pro Version: 1.1.2 (build 4541, 602e11a)
  • macOS Version: 10.11.6
  • MySQL Version: (irrelevant)

Description
Home and End keys put the cursor to the beginning/end of the whole Query Tab, not of the current line.

Steps To Reproduce

  1. Write a multi-line query in the Query Tab.
  2. put the cursor in the middle of any line
  3. Press Home or End keys (the ones that are under F14, above the Cursor Up key)
  4. The cursor jumps to the beginning and end of the long query (first and last line of it)

Expected Behaviour
The cursor should jump to the beginning and the end of the current line.

Additional Context
My keyboard is an original Apple A1243 keyboard.

I admit, some Mac programs work this way (so this is not a bug, it is a change request) but some others don't. Most of the developer tools I use together with SequelPro, they don't (Sublime, PhpStorm, UltraEdit, etc.). So it would be nice to make it configurable under SequelPro -> Preferences -> Query Editor.

There should be a checkbox:
[_] Home/End works within current line, not the whole query
or a pair of radio buttons:
(o) Home/End moves to the first/last line of the query
(o) Home/End moves to the first/last position of the current line

Thanks.

@twoixter

This comment has been minimized.

twoixter commented Oct 16, 2018

@halmai This is old news on macOS. The problem is that Home / End and Page Up / Page Down keys works counter-intuitively for non Apple users (so, to be fair long time Mac users might say it otherwise). I think it should not be part of a keyboard preference, just use the one of the system.

The good news is that you can change it system-wise, you can copy and paste the following file into ~/Library/KeyBindings/DefaultKeyBinding.dict:

{
/* Put this file in ~/Library/KeyBindings/DefaultKeyBinding.dict */
/* Remap Home / End keys to be correct */
"\UF729" = "moveToBeginningOfLine:"; /* Home */
"\UF72B" = "moveToEndOfLine:"; /* End */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
"^\UF729" = "moveToBeginningOfDocument:"; /* Ctrl + Home */
"^\UF72B" = "moveToEndOfDocument:"; /* Ctrl + End */
"$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Shift + Ctrl + Home */
"$^\UF72B" = "moveToEndOfDocumentAndModifySelection:"; /* Shift + Ctrl + End */
"\UF72C"  = "pageUp:"; /* Page Up */
"\UF72D"  = "pageDown:"; /* Page Down */
}

Then reboot and you're clear to go. All applications should behave like regular Home / End keys. I've also added my configuration for Page Up / Page Down.

This is my 2 cents, hope it works for you!


For more information visit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment