feat(keybinds): add word deletion and half-page scrolling

Merged
CO
7d ago
+364-0

Add three configurable keybind actions shared by the app launcher,
dmenu, and cclip modes:

  • delete_word (default Ctrl+W, Ctrl+Backspace, Ctrl+H) removes the last
    word of the query, or of the tag prompt in cclip mode. Ctrl+H is bound
    because most terminals send Ctrl+Backspace as ^H.
  • half_page_up / half_page_down (default Ctrl+U / Ctrl+D) move the
    selection half a visible page, clamped at the list ends. Grid layouts
    step by whole rows and rotated layouts flip direction like up/down.

Summary by cubic

Adds three configurable keybind actions shared by the app launcher, dmenu, and cclip modes: delete_word, half_page_up, and half_page_down.

  • delete_word (default Ctrl+W, Ctrl+Backspace, Ctrl+H) removes the last word of the query, or of the tag prompt in cclip mode. Ctrl+H is also bound because most terminals send Ctrl+Backspace as ^H. The previous query is only cloned when debug logging is enabled, and is now a shared helper in src/ui/editing.rs.
  • half_page_up / half_page_down (default Ctrl+U / Ctrl+D) move the selection half a visible page, clamped at the list ends. Grid layouts step by whole rows, and rotated layouts flip direction like up/down.
  • Updates USAGE.md, the man page, and the example config.toml / keybinds.toml to document the new defaults.
  • Moves src/core/state/mod.rs to src/core/state.rs to satisfy the repository's module layout rule.
  • Allows clippy's deprecated fetch_update calls with #[allow(deprecated)] at both call sites, since try_update needs Rust 1.95 but MSRV is 1.94.

RetriggerView in GreptileConfidence Score: 4/5

The reported issues violate explicit repository requirements and must be addressed before merging; none establishes a security failure.

Findings

  1. P2 Touched module keeps forbidden layout ▶
  2. P2 Direction name changes meaning ▶
  3. P2 Word deletion copies unused text ▶
Fix with agent prompt
### Issue 1
src/core/state/mod.rs:181-182
Adding `Message::DeleteWord` touches `src/core/state/mod.rs` without the required file move. `CODE_STANDARDS.md` says existing `mod.rs` files must be migrated when their module is touched. Move this file to `src/core/state.rs`, keeping its children under `src/core/state/`. This repository requirement must be satisfied before merging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 2
src/modes/app_launcher/events.rs:162
`move_half_page` reuses `forward` for a different meaning: the requested direction becomes the direction after rotation. `CODE_STANDARDS.md` forbids shadowing in maintained code. Use a distinct name such as `oriented_forward`. The same pattern appears in the dmenu handler and with `row_len` in `half_page_step`. This repository requirement must be satisfied before merging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

### Issue 3
src/core/state/update.rs:58
`delete_word` clones the entire query on every call, even when debug logging is off. Only the debug log needs `old_query`. `CODE_STANDARDS.md` explicitly calls out unnecessary `clone()` calls as avoidable cost. Save the old query only when logging is enabled. This repository requirement must be satisfied before merging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds configurable word deletion and half-page movement to the launcher, dmenu, and clipboard modes.

  • A key press removes the last word from searches and cclip prompts.
  • Paging keys move the selection about half a visible list.

These repository requirements must be satisfied before merging.

Reviews (1) · Last reviewed commit: "feat(keybinds): add word deletion and ha..." · Reviewed by Greptile