aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/display
diff options
context:
space:
mode:
authorAyose <ayosec@gmail.com>2022-07-12 22:39:50 +0100
committerAyose <ayosec@gmail.com>2022-07-12 22:39:50 +0100
commitf796ba2afa445254da02157765344164d04f7dad (patch)
treea288459671e37e838b692ccf7c4e27d9b98c0e10 /alacritty/src/display
parentb73717649bbc61cc9a3f62b530d724cf9731dc10 (diff)
downloadr-alacritty-f796ba2afa445254da02157765344164d04f7dad.tar.gz
r-alacritty-f796ba2afa445254da02157765344164d04f7dad.tar.bz2
r-alacritty-f796ba2afa445254da02157765344164d04f7dad.zip
Highlight graphics to show hints.
Similar to the underline line rendered when the cursor is over an hyperlink, for graphics we now render a border around the graphic.
Diffstat (limited to 'alacritty/src/display')
-rw-r--r--alacritty/src/display/mod.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/alacritty/src/display/mod.rs b/alacritty/src/display/mod.rs
index c87cc124..195164bf 100644
--- a/alacritty/src/display/mod.rs
+++ b/alacritty/src/display/mod.rs
@@ -819,6 +819,8 @@ impl Display {
// Underline hints hovered by mouse or vi mode cursor.
let point = term::viewport_to_point(display_offset, cell.point);
+ let mut show_hint = false;
+
if has_highlighted_hint {
let hyperlink =
cell.extra.as_ref().and_then(|extra| extra.hyperlink.as_ref());
@@ -829,6 +831,7 @@ impl Display {
.as_ref()
.map_or(false, |hint| hint.should_highlight(point, hyperlink))
{
+ show_hint = true;
cell.flags.insert(Flags::UNDERLINE);
}
}
@@ -837,17 +840,17 @@ impl Display {
lines.update(&cell);
// Track any graphic present in the cell.
- graphics_list.update(&cell);
+ graphics_list.update(&cell, show_hint);
cell
}),
);
}
- self.renderer.graphics_draw(graphics_list, &size_info);
-
let mut rects = lines.rects(&metrics, &size_info);
+ self.renderer.graphics_draw(graphics_list, &size_info, &mut rects, &metrics);
+
if let Some(vi_cursor_point) = vi_cursor_point {
// Indicate vi mode by showing the cursor's position in the top right corner.
let line = (-vi_cursor_point.line.0 + size_info.bottommost_line().0) as usize;