feat: add modes_can_change_cursor configuration option

This commit is contained in:
CJ van den Berg 2025-11-26 16:25:52 +01:00
parent c1707b132e
commit 690498fdcc
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 8 additions and 1 deletions

View file

@ -1778,7 +1778,13 @@ fn set_terminal_style(self: *Self, theme_: *const Widget.Theme) void {
pub fn get_cursor_shape() renderer.CursorShape {
const self = current();
const default_cursor = self.config_.default_cursor;
const shape_ = if (self.input_mode_) |mode| mode.cursor_shape orelse default_cursor else default_cursor;
const shape_ = if (self.config_.modes_can_change_cursor)
if (self.input_mode_) |mode|
mode.cursor_shape orelse default_cursor
else
default_cursor
else
default_cursor;
const shape = if (self.rdr_.vx.caps.multi_cursor and shape_ == .default) .beam_blink else shape_;
return switch (shape) {
.default => .default,