summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2022-09-14 05:33:15 +0300
committerChristian Duerr <contact@christianduerr.com>2022-09-17 14:31:31 +0000
commit5f02a83c36802ff493159836bfca4fd5709042e1 (patch)
treee9fb55811e9852f8a30980bf1540652848304640
parent9692a4f72a926e07fd136a9dc45002931c4e9b84 (diff)
downloadalacritty-5f02a83c36802ff493159836bfca4fd5709042e1.tar.gz
alacritty-5f02a83c36802ff493159836bfca4fd5709042e1.zip
Avoid text cursor location for hyperlink preview
Fixes #6325.
-rw-r--r--alacritty/src/display/mod.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/alacritty/src/display/mod.rs b/alacritty/src/display/mod.rs
index e48d2b68..aba674fb 100644
--- a/alacritty/src/display/mod.rs
+++ b/alacritty/src/display/mod.rs
@@ -1026,7 +1026,8 @@ impl Display {
// Draw hyperlink uri preview.
if has_highlighted_hint {
- self.draw_hyperlink_preview(config, vi_cursor_point, display_offset);
+ let cursor_point = vi_cursor_point.or(Some(cursor_point));
+ self.draw_hyperlink_preview(config, cursor_point, display_offset);
}
// Frame event should be requested before swaping buffers, since it requires surface
@@ -1234,7 +1235,7 @@ impl Display {
fn draw_hyperlink_preview(
&mut self,
config: &UiConfig,
- vi_cursor_point: Option<Point>,
+ cursor_point: Option<Point>,
display_offset: usize,
) {
let num_cols = self.size_info.columns();
@@ -1260,7 +1261,7 @@ impl Display {
// Prefer to show preview even when it'll likely obscure the highlighted hint, when
// there's no place left for it.
protected_lines.push(self.hint_mouse_point.map(|point| point.line));
- protected_lines.push(vi_cursor_point.map(|point| point.line));
+ protected_lines.push(cursor_point.map(|point| point.line));
}
// Find the line in viewport we can draw preview on without obscuring protected lines.