diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 08:12:29 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 12:15:01 -0300 |
| commit | 6535f3a59bb2454a0e945d840c083b2423a80b44 (patch) | |
| tree | dbf7e91609275efadc4c9bac7ac9e8e9056d7312 /src/edit.zig | |
| parent | 0db7861d9da09e059fa1b9e40fff5cd52add27f2 (diff) | |
| parent | 690c504391e07a0767df8255e288ffe39296af22 (diff) | |
| download | pardes-6535f3a59bb2454a0e945d840c083b2423a80b44.tar.gz pardes-6535f3a59bb2454a0e945d840c083b2423a80b44.zip | |
integration: the editor library's indent from the handed-in parse, with the rest
A merge of pardes-next (pumzrknp) and editor-lib (uuuzkvmv), no conflicts; the one change it brings is compiled out of pardes's own panes. On tui core-test 811/950 (139 skipped), shell-test 990/993, lib-test, hxdiff 658 and hxlib 538 with 0 mismatches; on gui core-test 811/950.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/edit.zig')
| -rw-r--r-- | src/edit.zig | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/edit.zig b/src/edit.zig index 32943c19..fe644541 100644 --- a/src/edit.zig +++ b/src/edit.zig @@ -762,8 +762,13 @@ pub fn retireEditText(e: Editor, new: []u8) void { } /// helix's indent for a line opened after byte `at` of `row` (indent.zig), -/// from the file's tree, where its grammar has an indent query. +/// from the file's tree, where its grammar has an indent query; in the +/// library, from the parse handed in (normal.nodeTree), its `Language`'s. fn treeIndent(e: Editor, t: *Text, text: []const u8, row: usize, at: usize) Error!?[]const u8 { + if (comptime Editor.lib) { + const tree = normal.nodeTree(e, t, text) orelse return null; + return indents.forNewline(e.scratch, indents.lang(tree.path) orelse return null, tree.root, text, row, at); + } const f = bodyFile(t) orelse return null; const l = indents.lang(f.path) orelse return null; const tree = normal.fileTree(e.p, f) orelse return null; |
