Compare commits

...

2 commits

3 changed files with 5 additions and 9 deletions

View file

@ -459,7 +459,6 @@ pub fn build_exe(
.{ .name = "cbor", .module = cbor_mod }, .{ .name = "cbor", .module = cbor_mod },
.{ .name = "thespian", .module = thespian_mod }, .{ .name = "thespian", .module = thespian_mod },
.{ .name = "input", .module = input_mod }, .{ .name = "input", .module = input_mod },
// TODO: we should be able to work without these modules
.{ .name = "vaxis", .module = vaxis_mod }, .{ .name = "vaxis", .module = vaxis_mod },
.{ .name = "color", .module = color_mod }, .{ .name = "color", .module = color_mod },
.{ .name = "gui_config", .module = gui_config_mod }, .{ .name = "gui_config", .module = gui_config_mod },
@ -478,7 +477,6 @@ pub fn build_exe(
.{ .name = "thespian", .module = thespian_mod }, .{ .name = "thespian", .module = thespian_mod },
.{ .name = "input", .module = input_mod }, .{ .name = "input", .module = input_mod },
.{ .name = "gui", .module = gui_mod }, .{ .name = "gui", .module = gui_mod },
// TODO: we should be able to work without these modules
.{ .name = "tuirenderer", .module = tui_renderer_mod }, .{ .name = "tuirenderer", .module = tui_renderer_mod },
.{ .name = "vaxis", .module = vaxis_mod }, .{ .name = "vaxis", .module = vaxis_mod },
}, },

View file

@ -1,7 +1,3 @@
//TODO figure out how keybindings should be configured
//TODO figure out how to handle bindings that can take a numerical prefix
const std = @import("std"); const std = @import("std");
const tp = @import("thespian"); const tp = @import("thespian");
const cbor = @import("cbor"); const cbor = @import("cbor");

View file

@ -1483,6 +1483,7 @@ pub const Editor = struct {
} }
fn render_whitespace_map(self: *Self, theme: *const Widget.Theme, cell_map: CellMap) !void { fn render_whitespace_map(self: *Self, theme: *const Widget.Theme, cell_map: CellMap) !void {
const col_offset = self.view.col;
const char = whitespace.char; const char = whitespace.char;
const frame = tracy.initZone(@src(), .{ .name = "editor whitespace map" }); const frame = tracy.initZone(@src(), .{ .name = "editor whitespace map" });
defer frame.deinit(); defer frame.deinit();
@ -1525,12 +1526,13 @@ pub const Editor = struct {
_ = self.plane.at_cursor_cell(&cell) catch return; _ = self.plane.at_cursor_cell(&cell) catch return;
switch (self.render_whitespace) { switch (self.render_whitespace) {
.indent => { .indent => {
if (leading and x % self.indent_size == 0) const col = x + col_offset;
const is_indent_col = col % self.indent_size == 0;
if (leading and is_indent_col)
cell.cell.char.grapheme = char.indent; cell.cell.char.grapheme = char.indent;
if (is_blank and x < prev_indent and x % self.indent_size == 0) if (is_blank and col < prev_indent and is_indent_col)
cell.cell.char.grapheme = char.indent; cell.cell.char.grapheme = char.indent;
}, },
.leading => { .leading => {
if (leading) { if (leading) {
if (get_whitespace_char(cell_type, next_cell_type)) |c| if (get_whitespace_char(cell_type, next_cell_type)) |c|