diff options
Diffstat (limited to 'src/ninep')
| -rw-r--r-- | src/ninep/pane.zig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig index 8e827fba..245e0bb4 100644 --- a/src/ninep/pane.zig +++ b/src/ninep/pane.zig @@ -893,6 +893,19 @@ test "truncating the tag clears its editable tail" { try testing.expectEqual(Status.ok, cleared.reply.status); try testing.expectEqualStrings("", pane.tag.own.?); try testing.expect(std.mem.indexOf(u8, rd(p, tag, 0, 4096).bytes, " Mine") == null); + + // Written back without a leading space, the text still stands apart + // from the path: the computed prefix brings the separator, so Look and + // Exec find `Get`, not `test.txtGet`. + _ = wr(p, tag, "Get"); + try testing.expectEqualStrings("Get", pane.tag.own.?); + const whole = rd(p, tag, 0, 4096).bytes; + try testing.expectEqualStrings("/test.txt Get", whole); + const word = config.wordBounds(whole, whole.len - "Get".len); + try testing.expectEqualStrings("Get", whole[word.lo..word.hi]); + // and the keyboard's first column of the text is the G + const at = tagline.tagOffsetAt(p, pane, 0, "/test.txt ".len).?; + try testing.expectEqual(@as(usize, 0), at.col); } test "name reads the file name and writing it promotes a scratch without touching its body" { |
