mirror of
https://github.com/neovim/neovim.git
synced 2026-02-21 09:50:19 +10:00
indent/rust.vim behaves incorrectly when a string literal contains the
substring "if".
For example, in this code:
let x = "
motif
";
struct X {
}
indent/rust.vim thinks that the closing "}" should line up with "motif".
This patch fixes the issue by checking whether the "if" is in a string
literal or comment before considering it to be a match for a subsequent
brace (and also by requiring it to start on a word boundary).
Add an indent test to ensure this does not regress.
closes: vim/vim#19265
663d809194
Co-authored-by: taylor.fish <contact@taylor.fish>
10 KiB
10 KiB