feat: add whitespace_mode external
This commit is contained in:
parent
741096cb43
commit
2ca1a742a1
3 changed files with 15 additions and 1 deletions
|
|
@ -114,6 +114,7 @@ pub const WhitespaceMode = enum {
|
|||
leading,
|
||||
eol,
|
||||
tabs,
|
||||
external,
|
||||
visible,
|
||||
full,
|
||||
none,
|
||||
|
|
|
|||
|
|
@ -1562,6 +1562,18 @@ pub const Editor = struct {
|
|||
cell.cell.char.grapheme = c;
|
||||
}
|
||||
},
|
||||
.external => {
|
||||
if (leading) {
|
||||
if (get_whitespace_char(cell_type, next_cell_type)) |c|
|
||||
cell.cell.char.grapheme = c;
|
||||
}
|
||||
if (cell_type == .eol)
|
||||
cell.cell.char.grapheme = char.eol;
|
||||
if (cell_type == .tab or cell_type == .extension) {
|
||||
if (get_whitespace_char(cell_type, next_cell_type)) |c|
|
||||
cell.cell.char.grapheme = c;
|
||||
}
|
||||
},
|
||||
.visible => {
|
||||
if (get_whitespace_char(cell_type, next_cell_type)) |c|
|
||||
cell.cell.char.grapheme = c;
|
||||
|
|
|
|||
|
|
@ -1002,7 +1002,8 @@ const cmds = struct {
|
|||
.indent => .leading,
|
||||
.leading => .eol,
|
||||
.eol => .tabs,
|
||||
.tabs => .visible,
|
||||
.tabs => .external,
|
||||
.external => .visible,
|
||||
.visible => .full,
|
||||
.full => .none,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue