Skip to content

Commit

Permalink
remove duplicate search bindings and render full lines once have sear…
Browse files Browse the repository at this point in the history
…ch (closes #785)
  • Loading branch information
raphamorim committed Nov 16, 2024
1 parent 00f7b2c commit 1743eee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
14 changes: 2 additions & 12 deletions frontends/rioterm/src/bindings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ pub fn default_key_bindings(
"n", ModifiersState::SHIFT, +BindingMode::VI, ~BindingMode::SEARCH; SearchAction::SearchFocusPrevious;
Key::Named(Enter), +BindingMode::SEARCH, ~BindingMode::VI; SearchAction::SearchFocusNext;
Key::Named(Enter), +BindingMode::SEARCH, +BindingMode::VI; SearchAction::SearchConfirm;
Key::Named(Escape), +BindingMode::SEARCH; SearchAction::SearchCancel;
Key::Named(Enter), ModifiersState::SHIFT, +BindingMode::SEARCH, ~BindingMode::VI; SearchAction::SearchFocusPrevious;
"i", +BindingMode::VI, ~BindingMode::SEARCH; Action::ToggleViMode;
"c", ModifiersState::CONTROL, +BindingMode::VI; Action::ToggleViMode;
Key::Named(Escape), +BindingMode::VI; Action::ClearSelection;
Expand Down Expand Up @@ -1056,10 +1058,6 @@ pub fn platform_key_bindings(
// Search
"f", ModifiersState::SUPER, ~BindingMode::SEARCH; Action::SearchForward;
"b", ModifiersState::SUPER, ~BindingMode::SEARCH; Action::SearchBackward;
Key::Named(Escape), +BindingMode::SEARCH; SearchAction::SearchCancel;
Key::Named(Enter), +BindingMode::SEARCH, ~BindingMode::VI; SearchAction::SearchFocusNext;
Key::Named(Enter), +BindingMode::SEARCH, +BindingMode::VI; SearchAction::SearchConfirm;
Key::Named(Enter), ModifiersState::SHIFT, +BindingMode::SEARCH, ~BindingMode::VI; SearchAction::SearchFocusPrevious;
"c", ModifiersState::CONTROL, +BindingMode::SEARCH; SearchAction::SearchCancel;
"u", ModifiersState::CONTROL, +BindingMode::SEARCH; SearchAction::SearchClear;
"w", ModifiersState::CONTROL, +BindingMode::SEARCH; SearchAction::SearchDeleteWord;
Expand Down Expand Up @@ -1139,10 +1137,6 @@ pub fn platform_key_bindings(
// Search
"f", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::SEARCH; Action::SearchForward;
"b", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::SEARCH; Action::SearchBackward;
Key::Named(Escape), +BindingMode::SEARCH; SearchAction::SearchCancel;
Key::Named(Enter), +BindingMode::SEARCH, ~BindingMode::VI; SearchAction::SearchFocusNext;
Key::Named(Enter), +BindingMode::SEARCH, +BindingMode::VI; SearchAction::SearchConfirm;
Key::Named(Enter), ModifiersState::SHIFT, +BindingMode::SEARCH, ~BindingMode::VI; SearchAction::SearchFocusPrevious;
"c", ModifiersState::CONTROL, +BindingMode::SEARCH; SearchAction::SearchCancel;
"u", ModifiersState::CONTROL, +BindingMode::SEARCH; SearchAction::SearchClear;
"w", ModifiersState::CONTROL, +BindingMode::SEARCH; SearchAction::SearchDeleteWord;
Expand Down Expand Up @@ -1208,10 +1202,6 @@ pub fn platform_key_bindings(
// Search
"f", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::SEARCH; Action::SearchForward;
"b", ModifiersState::CONTROL | ModifiersState::SHIFT, ~BindingMode::SEARCH; Action::SearchBackward;
Key::Named(Escape), +BindingMode::SEARCH; SearchAction::SearchCancel;
Key::Named(Enter), +BindingMode::SEARCH, ~BindingMode::VI; SearchAction::SearchFocusNext;
Key::Named(Enter), +BindingMode::SEARCH, +BindingMode::VI; SearchAction::SearchConfirm;
Key::Named(Enter), ModifiersState::SHIFT, +BindingMode::SEARCH, ~BindingMode::VI; SearchAction::SearchFocusPrevious;
"c", ModifiersState::CONTROL, +BindingMode::SEARCH; SearchAction::SearchCancel;
"u", ModifiersState::CONTROL, +BindingMode::SEARCH; SearchAction::SearchClear;
"w", ModifiersState::CONTROL, +BindingMode::SEARCH; SearchAction::SearchDeleteWord;
Expand Down
7 changes: 6 additions & 1 deletion frontends/rioterm/src/renderer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,13 @@ impl Renderer {
}

let display_offset = renderable_content.display_offset;
let strategy = if is_active && hints.is_some() {
&RenderableContentStrategy::Full
} else {
&renderable_content.strategy
};

match &renderable_content.strategy {
match strategy {
RenderableContentStrategy::Full => {
content.sel(rich_text_id);
content.clear();
Expand Down

0 comments on commit 1743eee

Please sign in to comment.