Compare commits
No commits in common. "a288945609df08b6efefd980936ee3826c9575dc" and "c37848bfb3d17499889ba7a5e957d89a2f371bfd" have entirely different histories.
a288945609
...
c37848bfb3
3 changed files with 3 additions and 17 deletions
|
@ -3993,20 +3993,6 @@ pub const Editor = struct {
|
||||||
}
|
}
|
||||||
pub const smart_insert_line_after_meta = .{ .description = "Insert line after (smart)" };
|
pub const smart_insert_line_after_meta = .{ .description = "Insert line after (smart)" };
|
||||||
|
|
||||||
pub fn smart_buffer_append(self: *Self, ctx: Context) Result {
|
|
||||||
var chars: []const u8 = undefined;
|
|
||||||
if (!try ctx.args.match(.{tp.extract(&chars)}))
|
|
||||||
return error.InvalidInsertCharsArgument;
|
|
||||||
const b = try self.buf_for_update();
|
|
||||||
var root = b.root;
|
|
||||||
var cursel: CurSel = .{};
|
|
||||||
cursel.cursor.move_buffer_end(root, self.metrics);
|
|
||||||
root = try self.insert(root, &cursel, chars, b.allocator);
|
|
||||||
try self.update_buf(root);
|
|
||||||
self.clamp();
|
|
||||||
}
|
|
||||||
pub const smart_buffer_append_meta = .{ .arguments = &.{.string} };
|
|
||||||
|
|
||||||
pub fn enable_fast_scroll(self: *Self, _: Context) Result {
|
pub fn enable_fast_scroll(self: *Self, _: Context) Result {
|
||||||
self.fast_scroll = true;
|
self.fast_scroll = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -265,8 +265,7 @@ inline fn render_diff_symbols(self: *Self, diff_symbols: *[]Symbol, pos: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_diagnostics(self: *Self, theme: *const Widget.Theme) void {
|
fn render_diagnostics(self: *Self, theme: *const Widget.Theme) void {
|
||||||
if (tui.config().inline_diagnostics)
|
for (self.editor.diagnostics.items) |*diag| self.render_diagnostic(diag, theme);
|
||||||
for (self.editor.diagnostics.items) |*diag| self.render_diagnostic(diag, theme);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_diagnostic(self: *Self, diag: *const ed.Diagnostic, theme: *const Widget.Theme) void {
|
fn render_diagnostic(self: *Self, diag: *const ed.Diagnostic, theme: *const Widget.Theme) void {
|
||||||
|
|
|
@ -847,7 +847,8 @@ const cmds = struct {
|
||||||
return error.InvalidShellOutputArgument;
|
return error.InvalidShellOutputArgument;
|
||||||
const buffer = self.buffer_manager.buffer_from_ref(buffer_ref) orelse return;
|
const buffer = self.buffer_manager.buffer_from_ref(buffer_ref) orelse return;
|
||||||
if (self.get_active_editor()) |editor| if (editor.buffer) |eb| if (eb == buffer) {
|
if (self.get_active_editor()) |editor| if (editor.buffer) |eb| if (eb == buffer) {
|
||||||
editor.smart_buffer_append(command.fmt(.{output})) catch {};
|
editor.move_buffer_end(.{}) catch {};
|
||||||
|
editor.insert_chars(command.fmt(.{output})) catch {};
|
||||||
tui.need_render();
|
tui.need_render();
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue