diff --git a/docs/changelog.md b/docs/changelog.md index 62ad30e9c..9c63a553b 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -55,6 +55,7 @@ As features stabilize some brief notes about them will accumulate here. * Fixed: wezterm can now match bitmap fonts that are spread across multiple font files [#1189](https://github.com/wez/wezterm/issues/1189) * Improved: [use_cap_height_to_scale_fallback_fonts](config/lua/config/use_cap_height_to_scale_fallback_fonts.md) now computes *cap-height* based on the rasterized glyph bitmap which means that the data is accurate in more cases, including for bitmap fonts. Scaling is now also applied across varying text styles; previously it only applied to a font within an `wezterm.font_with_fallback` font list. * Fixed: ssh config parser incorrectly split `Host` patterns with commas instead of whitespace [#1196](https://github.com/wez/wezterm/issues/1196) +* Fixed: search now auto-updates when the pane content changes [#1205](https://github.com/wez/wezterm/issues/1205) ### 20210814-124438-54e29167 diff --git a/wezterm-gui/src/overlay/search.rs b/wezterm-gui/src/overlay/search.rs index 554326120..3fc726836 100644 --- a/wezterm-gui/src/overlay/search.rs +++ b/wezterm-gui/src/overlay/search.rs @@ -37,6 +37,7 @@ struct SearchRenderable { /// The most recently queried set of matches results: Vec, by_line: HashMap>, + last_result_seqno: SequenceNo, viewport: Option, last_bar_pos: Option, @@ -68,6 +69,7 @@ impl SearchOverlay { dirty_results: RangeSet::default(), viewport, last_bar_pos: None, + last_result_seqno: SEQ_ZERO, window, result_pos: None, width: dims.cols, @@ -292,6 +294,10 @@ impl Pane for SearchOverlay { fn get_lines(&self, lines: Range) -> (StableRowIndex, Vec) { let mut renderer = self.renderer.borrow_mut(); + if self.delegate.get_current_seqno() > renderer.last_result_seqno { + renderer.update_search(); + } + renderer.check_for_resize(); let dims = self.get_dimensions(); @@ -436,6 +442,7 @@ impl SearchRenderable { let bar_pos = self.compute_search_row(); self.dirty_results.add(bar_pos); + self.last_result_seqno = self.delegate.get_current_seqno(); if !self.pattern.is_empty() { let pane: Rc = self.delegate.clone();