Merge pull request #270 from mitchellh/cc-hidden-inactive-cursor

Don't show hollow cursor in inactive windows when cursor is hidden.
This commit is contained in:
Mitchell Hashimoto
2023-08-11 08:56:06 -07:00
committed by GitHub
2 changed files with 24 additions and 26 deletions

View File

@ -528,8 +528,6 @@ pub fn render(
state.mutex.lock();
defer state.mutex.unlock();
// Setup our cursor state
if (self.focused) {
self.cursor_visible = visible: {
// If the cursor is explicitly not visible in the state,
// then it is not visible.
@ -541,9 +539,10 @@ pub fn render(
// Otherwise, adhere to our current state.
break :visible self.cursor_visible;
};
if (self.focused) {
self.cursor_style = renderer.CursorStyle.fromTerminal(state.cursor.style) orelse .box;
} else {
self.cursor_visible = true;
self.cursor_style = .box_hollow;
}

View File

@ -728,8 +728,6 @@ pub fn render(
state.mutex.lock();
defer state.mutex.unlock();
// Setup our cursor state
if (self.focused) {
self.cursor_visible = visible: {
// If the cursor is explicitly not visible in the state,
// then it is not visible.
@ -741,9 +739,10 @@ pub fn render(
// Otherwise, adhere to our current state.
break :visible self.cursor_visible;
};
if (self.focused) {
self.cursor_style = renderer.CursorStyle.fromTerminal(state.cursor.style) orelse .box;
} else {
self.cursor_visible = true;
self.cursor_style = .box_hollow;
}