fix: only render the first line of multiline diagnistics inline
fixes #51
This commit is contained in:
parent
3b4c81c706
commit
d804203760
1 changed files with 5 additions and 4 deletions
|
@ -935,9 +935,11 @@ pub const Editor = struct {
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_diagnostic_message(self: *Self, message: []const u8, y: usize, max_space: usize, style: Widget.Theme.Style) void {
|
fn render_diagnostic_message(self: *Self, message_: []const u8, y: usize, max_space: usize, style: Widget.Theme.Style) void {
|
||||||
self.plane.set_style(style);
|
self.plane.set_style(style);
|
||||||
_ = self.plane.print_aligned_right(@intCast(y), "{s}", .{message[0..@min(max_space, message.len)]}) catch {};
|
var iter = std.mem.splitScalar(u8, message_, '\n');
|
||||||
|
if (iter.next()) |message|
|
||||||
|
_ = self.plane.print_aligned_right(@intCast(y), "{s}", .{message[0..@min(max_space, message.len)]}) catch {};
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fn render_diagnostic_cell(self: *Self, style: Widget.Theme.Style) void {
|
inline fn render_diagnostic_cell(self: *Self, style: Widget.Theme.Style) void {
|
||||||
|
@ -4078,8 +4080,7 @@ pub const EditorWidget = struct {
|
||||||
if (try m.match(.{ "M", tp.extract(&x), tp.extract(&y), tp.extract(&xpx), tp.extract(&ypx) })) {
|
if (try m.match(.{ "M", tp.extract(&x), tp.extract(&y), tp.extract(&xpx), tp.extract(&ypx) })) {
|
||||||
const hover_y, const hover_x = self.editor.plane.abs_yx_to_rel(y, x);
|
const hover_y, const hover_x = self.editor.plane.abs_yx_to_rel(y, x);
|
||||||
if (hover_y != self.hover_y or hover_x != self.hover_x) {
|
if (hover_y != self.hover_y or hover_x != self.hover_x) {
|
||||||
self.hover_y, self.hover_x = .{
|
self.hover_y, self.hover_x = .{ hover_y, hover_x };
|
||||||
hover_y, hover_x };
|
|
||||||
if (self.editor.jump_mode)
|
if (self.editor.jump_mode)
|
||||||
self.update_hover_timer(.init);
|
self.update_hover_timer(.init);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue