mirror of
https://github.com/wez/wezterm.git
synced 2024-12-25 14:22:37 +03:00
search: auto-update when the pane content changes
refs: https://github.com/wez/wezterm/issues/1205
This commit is contained in:
parent
87ea33f2f8
commit
4eef20320d
@ -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)
|
* 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.
|
* 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: 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
|
### 20210814-124438-54e29167
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ struct SearchRenderable {
|
|||||||
/// The most recently queried set of matches
|
/// The most recently queried set of matches
|
||||||
results: Vec<SearchResult>,
|
results: Vec<SearchResult>,
|
||||||
by_line: HashMap<StableRowIndex, Vec<MatchResult>>,
|
by_line: HashMap<StableRowIndex, Vec<MatchResult>>,
|
||||||
|
last_result_seqno: SequenceNo,
|
||||||
|
|
||||||
viewport: Option<StableRowIndex>,
|
viewport: Option<StableRowIndex>,
|
||||||
last_bar_pos: Option<StableRowIndex>,
|
last_bar_pos: Option<StableRowIndex>,
|
||||||
@ -68,6 +69,7 @@ impl SearchOverlay {
|
|||||||
dirty_results: RangeSet::default(),
|
dirty_results: RangeSet::default(),
|
||||||
viewport,
|
viewport,
|
||||||
last_bar_pos: None,
|
last_bar_pos: None,
|
||||||
|
last_result_seqno: SEQ_ZERO,
|
||||||
window,
|
window,
|
||||||
result_pos: None,
|
result_pos: None,
|
||||||
width: dims.cols,
|
width: dims.cols,
|
||||||
@ -292,6 +294,10 @@ impl Pane for SearchOverlay {
|
|||||||
|
|
||||||
fn get_lines(&self, lines: Range<StableRowIndex>) -> (StableRowIndex, Vec<Line>) {
|
fn get_lines(&self, lines: Range<StableRowIndex>) -> (StableRowIndex, Vec<Line>) {
|
||||||
let mut renderer = self.renderer.borrow_mut();
|
let mut renderer = self.renderer.borrow_mut();
|
||||||
|
if self.delegate.get_current_seqno() > renderer.last_result_seqno {
|
||||||
|
renderer.update_search();
|
||||||
|
}
|
||||||
|
|
||||||
renderer.check_for_resize();
|
renderer.check_for_resize();
|
||||||
let dims = self.get_dimensions();
|
let dims = self.get_dimensions();
|
||||||
|
|
||||||
@ -436,6 +442,7 @@ impl SearchRenderable {
|
|||||||
|
|
||||||
let bar_pos = self.compute_search_row();
|
let bar_pos = self.compute_search_row();
|
||||||
self.dirty_results.add(bar_pos);
|
self.dirty_results.add(bar_pos);
|
||||||
|
self.last_result_seqno = self.delegate.get_current_seqno();
|
||||||
|
|
||||||
if !self.pattern.is_empty() {
|
if !self.pattern.is_empty() {
|
||||||
let pane: Rc<dyn Pane> = self.delegate.clone();
|
let pane: Rc<dyn Pane> = self.delegate.clone();
|
||||||
|
Loading…
Reference in New Issue
Block a user