diff options
Diffstat (limited to 'core/Core.zig')
| -rw-r--r-- | core/Core.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/Core.zig b/core/Core.zig index 2c04cc64..e43f9e83 100644 --- a/core/Core.zig +++ b/core/Core.zig @@ -2010,7 +2010,10 @@ pub fn sync(p: *Pardes) void { var wrap_fba = std.heap.FixedBufferAllocator.init(&wrap_room); const wa = wrap_fba.allocator(); const prefix: ?[]const u8 = tagline.prefixIn(p, wa, pane) catch null; - const lead = if (prefix) |made| made.len else pane.tag_lead; + // The tag's cursor and selections are offsets in its text at rest: + // a head shown over its own text moves none of them (UX D1). + const at_rest = if (pardes.Trail.outOfRest(p, pane)) tagline.restPrefix(p, wa, pane) catch null else prefix; + const lead = if (at_rest) |made| made.len else pane.tag_lead; if (lead != pane.tag_lead) { const t = &pane.tag; const old: i32 = @intCast(pane.tag_lead); |
