feat: add modes_can_change_cursor configuration option
This commit is contained in:
parent
c1707b132e
commit
690498fdcc
2 changed files with 8 additions and 1 deletions
|
|
@ -26,6 +26,7 @@ enable_format_on_save: bool = false,
|
||||||
restore_last_cursor_position: bool = true,
|
restore_last_cursor_position: bool = true,
|
||||||
follow_cursor_on_buffer_switch: bool = false, //scroll cursor into view on buffer switch
|
follow_cursor_on_buffer_switch: bool = false, //scroll cursor into view on buffer switch
|
||||||
default_cursor: CursorShape = .default,
|
default_cursor: CursorShape = .default,
|
||||||
|
modes_can_change_cursor: bool = true,
|
||||||
enable_auto_save: bool = false,
|
enable_auto_save: bool = false,
|
||||||
limit_auto_save_file_types: ?[]const []const u8 = null, // null means *all*
|
limit_auto_save_file_types: ?[]const []const u8 = null, // null means *all*
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1778,7 +1778,13 @@ fn set_terminal_style(self: *Self, theme_: *const Widget.Theme) void {
|
||||||
pub fn get_cursor_shape() renderer.CursorShape {
|
pub fn get_cursor_shape() renderer.CursorShape {
|
||||||
const self = current();
|
const self = current();
|
||||||
const default_cursor = self.config_.default_cursor;
|
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_;
|
const shape = if (self.rdr_.vx.caps.multi_cursor and shape_ == .default) .beam_blink else shape_;
|
||||||
return switch (shape) {
|
return switch (shape) {
|
||||||
.default => .default,
|
.default => .default,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue