puni
puni copied to clipboard
puni-slurp-forward unexpected behavior for <>
This happens in rust-mode
. |
is where cursor is.
Option<|>Result<i64>
// puni-slurp-forward,expected
Option<|Result><i64>
// puni-slurp-forward,unexpected,it should be Option<|Result<i64>>
Option<|Result<>i64>
Looks like a rust-mode
bug to me.
Option<Result>|<i64>
// `forward-sexp`
Option<Result><i64|>
// `backward-sexp`
Option<Result><|i64>
puni-strict-forward-sexp
thinks the <
after point is a balanced sexp, because it thinks it's just a punctuation. Puni does this because forward-sexp
often flies over the following punctuation, see this (in text-mode
):
Bar|. Foo bar.
// `forward-sexp`
Bar. Foo| bar.
// `backward-sexp`
Bar. |Foo bar.
And, puni does nothing wrong since it actually is a punctuation!
Option|<Result><i64>
// `describe-char` outputs:
// ... syntax: (> which means: open, matches > ...
Option<Result>|<i64>
// `describe-char` outputs:
// ... syntax: . which means: punctuation
My guess is it's a rust-mode
bug, or the intermediate state Option<Result><i64>
is not valid rust code so rust-mode
can't parse it. If this is the case, currently I don't know how to fix it on Puni's side.