feat: add auto_save_mode option with new on_input_idle and on_focus_change modes

The original auto_save mode is now called on_document_change. The new
default is on_focus_change.

closes #481
This commit is contained in:
CJ van den Berg 2026-02-02 17:13:52 +01:00
parent 1317de3f72
commit 70b60a15fa
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 75 additions and 21 deletions

View file

@ -33,6 +33,7 @@ follow_cursor_on_buffer_switch: bool = false, //scroll cursor into view on buffe
default_cursor: CursorShape = .default,
modes_can_change_cursor: bool = true,
enable_auto_save: bool = false,
auto_save_mode: AutoSaveMode = .on_focus_change,
limit_auto_save_file_types: ?[]const []const u8 = null, // null means *all*
enable_prefix_keyhints: bool = true,
enable_auto_find: bool = true,
@ -149,6 +150,12 @@ pub const WhitespaceMode = enum {
none,
};
pub const AutoSaveMode = enum {
on_input_idle,
on_focus_change,
on_document_change,
};
pub const CursorShape = enum {
default,
block_blink,