Skip to content

Commit

Permalink
fix #106
Browse files Browse the repository at this point in the history
  • Loading branch information
dm0n3y committed Feb 2, 2025
1 parent 0f42469 commit 57a7785
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/editor/Modify.re
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,14 @@ let extend = (~side=Dir.R, s: string, tok: Token.t) =>
~default=Dir.pick(side, (("", tok.text), (tok.text, ""))),
);
let text = l ++ s ++ r;
Labeler.single(text) |> Option.map(_ => {...tok, text});
let n = Utf8.length(l ++ s);
Labeler.single(text)
|> Option.map(_ => {...tok, text})
|> Option.map(tok =>
n >= Token.length(tok)
? Token.clear_marks(tok)
: Token.put_cursor(Point(Caret.focus(n)), tok)
);
| Space(_)
| Grout(_) => None
| Tile((lbl, _)) =>
Expand Down

0 comments on commit 57a7785

Please sign in to comment.