diff options
Diffstat (limited to 'core/edit.zig')
| -rw-r--r-- | core/edit.zig | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/edit.zig b/core/edit.zig index e68f8d38..fa442fca 100644 --- a/core/edit.zig +++ b/core/edit.zig @@ -682,9 +682,10 @@ pub fn setEditTextEnd(e: Editor, t: *Text, new: []u8, known_end: ?modal.Cursor) fn setEditTextSpan(e: Editor, t: *Text, new: []u8, known_end: ?modal.Cursor, span: ?panes.File.Span) Error!void { if (t.what == .tag) { // A tag is edited as it is shown, but only what follows its - // prefix is its own: an edit that changed the prefix is refused. - // The shown text stays alive until the next such edit, since every - // caller reads the new text back, as a body's is kept. + // prefix (its path and computed words, UX K'1) is its own: an edit + // that changed the prefix is refused. The shown text stays alive + // until the next such edit, since every caller reads the new text + // back, as a body's is kept. defer retireEditText(e, new); const pane = t.pane() orelse return; // Out of rest the tag shows its head, which is no one's to edit. @@ -692,7 +693,7 @@ fn setEditTextSpan(e: Editor, t: *Text, new: []u8, known_end: ?modal.Cursor, spa t.refused = true; return; } - const prefix = try tagline.pathPrefix(e.p, e.scratch, pane); + const prefix = try tagline.restPrefix(e.p, e.scratch, pane); if (!std.mem.startsWith(u8, new, prefix)) { t.refused = true; return; |
