Merge branch 'master' into zig-0.15.0
This commit is contained in:
commit
8fb3602594
2 changed files with 5 additions and 2 deletions
|
@ -19,6 +19,7 @@ animation_min_lag: usize = 0, //milliseconds
|
||||||
animation_max_lag: usize = 150, //milliseconds
|
animation_max_lag: usize = 150, //milliseconds
|
||||||
enable_format_on_save: bool = false,
|
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
|
||||||
default_cursor: []const u8 = "default",
|
default_cursor: []const u8 = "default",
|
||||||
|
|
||||||
indent_size: usize = 4,
|
indent_size: usize = 4,
|
||||||
|
|
|
@ -433,6 +433,7 @@ pub const Editor = struct {
|
||||||
return error.RestoreFindHistory;
|
return error.RestoreFindHistory;
|
||||||
self.push_find_history(value);
|
self.push_find_history(value);
|
||||||
}
|
}
|
||||||
|
if (tui.config().follow_cursor_on_buffer_switch)
|
||||||
self.clamp();
|
self.clamp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4715,6 +4716,7 @@ pub const Editor = struct {
|
||||||
var file_path: []const u8 = undefined;
|
var file_path: []const u8 = undefined;
|
||||||
if (ctx.args.match(.{tp.extract(&file_path)}) catch false) {
|
if (ctx.args.match(.{tp.extract(&file_path)}) catch false) {
|
||||||
try self.open(file_path);
|
try self.open(file_path);
|
||||||
|
if (tui.config().follow_cursor_on_buffer_switch)
|
||||||
self.clamp();
|
self.clamp();
|
||||||
} else return error.InvalidOpenBufferFromFileArgument;
|
} else return error.InvalidOpenBufferFromFileArgument;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue