Skip to content
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

feature: Add ctrl-w and ctrl-h support in the search #409

Merged
merged 3 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add README and help menu for ctrl-w and ctrl-h
  • Loading branch information
ClementTsang committed Feb 16, 2021
commit 1aaf22ff60ea0464de49ba828b35798ac0f23dbc
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- [#406](https://github.com/ClementTsang/bottom/pull/406): Adds the Nord colour scheme, as well as a light variant.

- [#409](https://github.com/ClementTsang/bottom/pull/409): Adds `Ctrl-w` and `Ctrl-h` shortcuts in search, to delete a word and delete a character respectively.

## Changes

- [#372](https://github.com/ClementTsang/bottom/pull/372): Hides the SWAP graph and legend in normal mode if SWAP is 0.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ Use `btm --help` for more information.
| `Ctrl-a` | Skip to the start of the search query |
| `Ctrl-e` | Skip to the end of the search query |
| `Ctrl-u` | Clear the current search query |
| `Ctrl-w` | Delete a word behind the cursor |
| `Ctrl-h` | Delete the character behind the cursor |
| `Backspace` | Delete the character behind the cursor |
| `Delete` | Delete the character at the cursor |
| `Alt-c`, `F1` | Toggle matching case |
Expand Down
4 changes: 3 additions & 1 deletion src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,15 @@ pub const PROCESS_HELP_TEXT: [&str; 14] = [
"+, -, click Collapse/expand a branch while in tree mode",
];

pub const SEARCH_HELP_TEXT: [&str; 46] = [
pub const SEARCH_HELP_TEXT: [&str; 48] = [
"4 - Process search widget",
"Tab Toggle between searching for PID and name",
"Esc Close the search widget (retains the filter)",
"Ctrl-a Skip to the start of the search query",
"Ctrl-e Skip to the end of the search query",
"Ctrl-u Clear the current search query",
"Ctrl-w Delete a word behind the cursor",
"Ctrl-h Delete the character behind the cursor",
"Backspace Delete the character behind the cursor",
"Delete Delete the character at the cursor",
"Alt-c, F1 Toggle matching case",
Expand Down