summaryrefslogtreecommitdiffstats
path: root/alacritty_terminal
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty_terminal')
-rw-r--r--alacritty_terminal/src/term/mod.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs
index a898ecc4..b853ceba 100644
--- a/alacritty_terminal/src/term/mod.rs
+++ b/alacritty_terminal/src/term/mod.rs
@@ -1829,14 +1829,19 @@ impl RenderableCursor {
fn new<T>(term: &Term<T>) -> Self {
// Cursor position.
let vi_mode = term.mode().contains(TermMode::VI);
- let point = if vi_mode { term.vi_mode_cursor.point } else { term.grid().cursor.point };
+ let mut point = if vi_mode {
+ term.vi_mode_cursor.point
+ } else {
+ let mut point = term.grid.cursor.point;
+ point.line += term.grid.display_offset();
+ point
+ };
// Cursor shape.
- let absolute_line = term.screen_lines() - point.line - 1;
- let display_offset = term.grid().display_offset();
let shape = if !vi_mode
- && (!term.mode().contains(TermMode::SHOW_CURSOR) || absolute_line.0 < display_offset)
+ && (!term.mode().contains(TermMode::SHOW_CURSOR) || point.line >= term.screen_lines())
{
+ point.line = Line(0);
CursorShape::Hidden
} else {
term.cursor_style().shape
' href='#n34'>34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89