Skip to content

Commit 9805603

Browse files
authored
Merge pull request #233 from Maxteabag/feat/expose-word-end-motion
Expose e/E (cursor_word_end) as customizable, unbound actions
2 parents 91ece39 + 37b796b commit 9805603

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎sqlit/core/keymap.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,11 @@ def _build_action_keys(self) -> list[ActionKeyDef]:
371371
ActionKeyDef("W", "cursor_WORD_forward", "query_normal"),
372372
ActionKeyDef("b", "cursor_word_back", "query_normal"),
373373
ActionKeyDef("B", "cursor_WORD_back", "query_normal"),
374+
# Unbound by default — users can bind in their keymap.json
375+
# (typically "e"/"E"), but they must also rebind whatever
376+
# `focus_explorer` action is currently using those keys.
377+
ActionKeyDef("", "cursor_word_end", "query_normal"),
378+
ActionKeyDef("", "cursor_WORD_end", "query_normal"),
374379
ActionKeyDef("0", "cursor_line_start", "query_normal"),
375380
ActionKeyDef("circumflex_accent", "cursor_first_non_blank", "query_normal"),
376381
ActionKeyDef("dollar_sign", "cursor_line_end", "query_normal"),

‎sqlit/domains/query/state/query_normal.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def _setup_actions(self) -> None:
3535
self.allows("cursor_WORD_forward", help="Move to next WORD")
3636
self.allows("cursor_word_back", help="Move to previous word")
3737
self.allows("cursor_WORD_back", help="Move to previous WORD")
38+
self.allows("cursor_word_end", help="Move to end of word")
39+
self.allows("cursor_WORD_end", help="Move to end of WORD")
3840
self.allows("cursor_first_non_blank", help="Move to first non-blank")
3941
self.allows("cursor_line_start", help="Move to line start")
4042
self.allows("cursor_line_end", help="Move to line end")

‎sqlit/domains/query/ui/mixins/query_editing_cursor.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ def action_cursor_WORD_back(self: QueryMixinHost) -> None:
131131
"""Move cursor to previous WORD (B)."""
132132
self._move_with_motion("B")
133133

134+
def action_cursor_word_end(self: QueryMixinHost) -> None:
135+
"""Move cursor to end of word (e). Unbound by default."""
136+
self._move_with_motion("e")
137+
138+
def action_cursor_WORD_end(self: QueryMixinHost) -> None:
139+
"""Move cursor to end of WORD (E). Unbound by default."""
140+
self._move_with_motion("E")
141+
134142
def action_cursor_first_non_blank(self: QueryMixinHost) -> None:
135143
"""Move cursor to first non-whitespace character (^)."""
136144
self._move_with_motion("^")

0 commit comments

Comments
 (0)