1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-22 12:51:31 +03:00

Fix text cursor position when using multiple panes

This commit is contained in:
kumattau 2022-05-18 09:19:20 +09:00 committed by Wez Furlong
parent 53b9a68a9c
commit 9b5c887874
2 changed files with 7 additions and 6 deletions

View File

@ -1730,10 +1730,10 @@ impl TermWindow {
}
}
fn update_text_cursor(&mut self, pane: &Rc<dyn Pane>) {
let cursor = pane.get_cursor_position();
fn update_text_cursor(&mut self, pos: &PositionedPane) {
if let Some(win) = self.window.as_ref() {
let top = pane.get_dimensions().physical_top;
let cursor = pos.pane.get_cursor_position();
let top = pos.pane.get_dimensions().physical_top;
let tab_bar_height = if self.show_tab_bar && !self.config.tab_bar_at_bottom {
self.tab_bar_pixel_height().unwrap()
} else {
@ -1743,9 +1743,10 @@ impl TermWindow {
let r = Rect::new(
Point::new(
(cursor.x.max(0) as isize * self.render_metrics.cell_size.width)
(((cursor.x + pos.left) as isize).max(0) * self.render_metrics.cell_size.width)
.add(padding_left as isize),
((cursor.y - top).max(0) as isize * self.render_metrics.cell_size.height)
((cursor.y + pos.top as isize - top).max(0)
* self.render_metrics.cell_size.height)
.add(tab_bar_height as isize)
.add(padding_top as isize),
),

View File

@ -1625,7 +1625,7 @@ impl super::TermWindow {
for pos in panes {
if pos.is_active {
self.update_text_cursor(&pos.pane);
self.update_text_cursor(&pos);
if focused {
pos.pane.advise_focus();
mux::Mux::get()