mirror of
https://github.com/wez/wezterm.git
synced 2024-12-22 21:01:36 +03:00
Fix text cursor position when using multiple panes
This commit is contained in:
parent
53b9a68a9c
commit
9b5c887874
@ -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),
|
||||
),
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user