Merge branch 'master' into zig-0.15.0

This commit is contained in:
CJ van den Berg 2025-07-01 21:14:13 +02:00
commit 8fb3602594
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 5 additions and 2 deletions

View file

@ -19,6 +19,7 @@ animation_min_lag: usize = 0, //milliseconds
animation_max_lag: usize = 150, //milliseconds
enable_format_on_save: bool = false,
restore_last_cursor_position: bool = true,
follow_cursor_on_buffer_switch: bool = false, //scroll cursor into view on buffer switch
default_cursor: []const u8 = "default",
indent_size: usize = 4,

View file

@ -433,7 +433,8 @@ pub const Editor = struct {
return error.RestoreFindHistory;
self.push_find_history(value);
}
self.clamp();
if (tui.config().follow_cursor_on_buffer_switch)
self.clamp();
}
fn init(self: *Self, allocator: Allocator, n: Plane, buffer_manager: *Buffer.Manager) void {
@ -4715,7 +4716,8 @@ pub const Editor = struct {
var file_path: []const u8 = undefined;
if (ctx.args.match(.{tp.extract(&file_path)}) catch false) {
try self.open(file_path);
self.clamp();
if (tui.config().follow_cursor_on_buffer_switch)
self.clamp();
} else return error.InvalidOpenBufferFromFileArgument;
}
pub const open_buffer_from_file_meta: Meta = .{ .arguments = &.{.string} };