diff --git a/crates/vim/src/command.rs b/crates/vim/src/command.rs index 1886ddd0ab..d12cf6152f 100644 --- a/crates/vim/src/command.rs +++ b/crates/vim/src/command.rs @@ -282,7 +282,7 @@ fn generate_positions(string: &str, query: &str) -> Vec { return positions; }; - for (i, c) in string.chars().enumerate() { + for (i, c) in string.char_indices() { if c == current { positions.push(i); if let Some(c) = chars.next() {