Skip to content

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

Merged
Mjoyufull merged 3 commits into
Mjoyufull:devfrom
coko7:feat/word-erase-half-page
Oct 26, 2026
Merged

Mjoyufull merged 3 commits into
Mjoyufull:devfrom
coko7:feat/word-erase-half-page

Conversation

@coko7

@coko7 coko7 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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.

Written for commit ed1d5a2. Summary will update on new commits.

View guided diff

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

Comment thread src/core/state.rs Resolved
Comment thread src/modes/app_launcher/events.rs Resolved
Comment thread src/core/state/update.rs Resolved
@Mjoyufull
Mjoyufull changed the base branch from main to dev October 21, 2026 20:47
@Mjoyufull

Copy link
Copy Markdown
Owner

remove commits not in dev and not part of this pr plz

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.
@coko7
coko7 force-pushed the feat/word-erase-half-page branch from 5848f6b to 6ccec55 Compare October 22, 2026 05:58
@coko7

coko7 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

remove commits not in dev and not part of this pr plz

My bad. I should have checked CONTRIBUTING.md...
Should be fixed now.

coko7 added 2 commits October 22, 2026 08:41
Rust 1.99 deprecates AtomicX::fetch_update in favor of try_update, which
fails clippy under -D warnings. try_update is only stable since 1.95 and
the crate's MSRV is 1.94, so allow the deprecation at both call sites
instead of renaming.
@coko7
coko7 force-pushed the feat/word-erase-half-page branch from 6ccec55 to ed1d5a2 Compare October 22, 2026 06:41
@Mjoyufull

Copy link
Copy Markdown
Owner

LGTM

@Mjoyufull
Mjoyufull merged commit a8bc6c0 into Mjoyufull:dev Oct 26, 2026
11 checks passed
@coko7
coko7 deleted the feat/word-erase-half-page branch October 26, 2026 08:52
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

Successfully merging this pull request may close these issues.

3 participants