1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 06:54:45 +03:00

avoid panic when attempting to search the launcher menu

refs: https://github.com/wez/wezterm/issues/2529
This commit is contained in:
Wez Furlong 2022-09-18 13:06:29 -07:00
parent 754d80db85
commit 5a754e44e7
3 changed files with 12 additions and 7 deletions

View File

@ -45,6 +45,8 @@ As features stabilize some brief notes about them will accumulate here.
* Panic when processing a sixel with inconsistent width information
[#2500](https://github.com/wez/wezterm/issues/2500)
* Cells with the invisible/hidden attribute are now invisible
* Panic when trying to activate the search overlay when the launcher menu is
active [#2529](https://github.com/wez/wezterm/issues/2529)
#### Changed
* Removed Last Resort fallback font

View File

@ -94,7 +94,7 @@ impl CopyOverlay {
term_window: &TermWindow,
pane: &Rc<dyn Pane>,
params: CopyModeParams,
) -> Rc<dyn Pane> {
) -> anyhow::Result<Rc<dyn Pane>> {
let mut cursor = pane.get_cursor_position();
cursor.shape = termwiz::surface::CursorShape::SteadyBlock;
cursor.visibility = CursorVisibility::Visible;
@ -102,9 +102,12 @@ impl CopyOverlay {
let (_domain, _window, tab_id) = mux::Mux::get()
.expect("called on main thread")
.resolve_pane_id(pane.pane_id())
.expect("pane to have a containing tab");
.ok_or_else(|| anyhow::anyhow!("no tab contains the current pane"))?;
let window = term_window.window.clone().unwrap();
let window = term_window
.window
.clone()
.ok_or_else(|| anyhow::anyhow!("failed to clone window handle"))?;
let dims = pane.get_dimensions();
let mut render = CopyRenderable {
cursor,
@ -141,10 +144,10 @@ impl CopyOverlay {
render.dirty_results.add(search_row);
render.update_search();
Rc::new(CopyOverlay {
Ok(Rc::new(CopyOverlay {
delegate: Rc::clone(pane),
render: RefCell::new(render),
})
}))
}
pub fn get_params(&self) -> CopyModeParams {

View File

@ -2452,7 +2452,7 @@ impl TermWindow {
pattern: self.resolve_search_pattern(pattern.clone(), &pane),
editing_search: true,
},
);
)?;
self.assign_overlay_for_pane(pane.pane_id(), search);
}
self.pane_state(pane.pane_id())
@ -2501,7 +2501,7 @@ impl TermWindow {
pattern: MuxPattern::default(),
editing_search: false,
},
);
)?;
self.assign_overlay_for_pane(pane.pane_id(), copy);
}
self.pane_state(pane.pane_id())