sublime_merge icon indicating copy to clipboard operation
sublime_merge copied to clipboard

No subword navigation in commit message input field and command palette

Open themilkman opened this issue 3 years ago • 2 comments

Version info

  • OS: Kubuntu 22.04
  • Build: 2076

Description

Navigating in a string (like this_is_a_test_string ) is not possible in commit message and command palette input fields with alt+right/left, instead it performs the default navigate_back/navigate_forward commands in the background. alt+shift+right/left for selection of subwords albeit works. This is mainly why I consider it as bug, although I am not sure if this behavior has always been the case.

Expected behavior

In text inputs contexts the keybinding should be used for subword navigation, also to match Sublime Texts behavior.

Best case would be to have contexts for the edit commit message input and command palette that key bindings like that would work (not sure about the overlay_has_focus, but I think in ST this would be the solution):

    {
        "keys": ["alt+left"],
        "command": "move",
        "args": {"by": "subwords", "forward": false} ,
        "context": [{ "key": "overlay_has_focus", "operator": "equal", "operand": true }],
    },

themilkman avatar Aug 31 '22 12:08 themilkman

@themilkman, I think this is the right workaround:

Default.sublime-keymap:
[
    {
        "keys": ["alt+left"],
        "context": [{ "key": "control", "operator": "equal", "operand": "text_control" }],
        "command": "move",
        "args": {"by": "subwords", "forward": false}
    },
    {
        "keys": ["alt+right"],
        "context": [{ "key": "control", "operator": "equal", "operand": "text_control" }],
        "command": "move",
        "args": {"by": "subword_ends", "forward": true}
    },
]

srbs avatar Sep 02 '22 06:09 srbs

Thank you very much @srbs, this seems to work

themilkman avatar Sep 07 '22 13:09 themilkman