From 2a0d794ed699f7565f874235dae2e9e66c57ad88 Mon Sep 17 00:00:00 2001 From: kosay Date: Wed, 22 Nov 2023 03:15:41 +0900 Subject: [PATCH] feat(ui): Display cursor only when the search form or filter form are active. --- src/ui/widget/table.rs | 3 ++- src/ui/widget/text.rs | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ui/widget/table.rs b/src/ui/widget/table.rs index cab4d5c0..114f0cb7 100644 --- a/src/ui/widget/table.rs +++ b/src/ui/widget/table.rs @@ -656,7 +656,8 @@ impl RenderTrait for Table<'_> { } Mode::FilterInput | Mode::FilterConfirm => { - self.filter_widget.render(f, self.mode.is_filter_input()); + self.filter_widget + .render(f, self.mode.is_filter_input() && is_active); f.render_stateful_widget(widget, self.chunk(), &mut self.state); } diff --git a/src/ui/widget/text.rs b/src/ui/widget/text.rs index 92bf5b74..7b4f173f 100644 --- a/src/ui/widget/text.rs +++ b/src/ui/widget/text.rs @@ -30,7 +30,8 @@ use crate::{ use self::{ highlight_content::{HighlightArea, HighlightContent, Point}, item::TextItem, - render::{Render, Scroll}, search_form::SearchForm, + render::{Render, Scroll}, + search_form::SearchForm, }; use super::{ @@ -814,7 +815,7 @@ impl RenderTrait for Text { self.search_widget.render( f, - self.mode.is_search_input(), + self.mode.is_search_input() && is_active, self.item.highlight_status(), ); }