renderer: do not blink explicit steady cursor styles

This commit is contained in:
Mitchell Hashimoto
2023-07-10 11:27:37 -07:00
parent 1028d517e4
commit ea268bae5e
2 changed files with 14 additions and 2 deletions

View File

@ -530,7 +530,13 @@ pub fn render(
// Setup our cursor state
if (self.focused) {
self.cursor_visible = self.cursor_visible and state.cursor.visible;
self.cursor_visible = visible: {
// If the cursor isn't a blinking style, then never blink.
if (!state.cursor.style.blinking()) break :visible true;
// Otherwise, adhere to our current state.
break :visible self.cursor_visible and state.cursor.visible;
};
self.cursor_style = renderer.CursorStyle.fromTerminal(state.cursor.style) orelse .box;
} else {
self.cursor_visible = true;

View File

@ -724,7 +724,13 @@ pub fn render(
// Setup our cursor state
if (self.focused) {
self.cursor_visible = self.cursor_visible and state.cursor.visible;
self.cursor_visible = visible: {
// If the cursor isn't a blinking style, then never blink.
if (!state.cursor.style.blinking()) break :visible true;
// Otherwise, adhere to our current state.
break :visible self.cursor_visible and state.cursor.visible;
};
self.cursor_style = renderer.CursorStyle.fromTerminal(state.cursor.style) orelse .box;
} else {
self.cursor_visible = true;