diff options
-rw-r--r-- | src/nvim/misc1.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index a871d424c6..8c19a2de66 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -277,7 +277,7 @@ int get_last_leader_offset(char_u *line, char_u **flags) // whitespace. Otherwise we would think we are inside a // comment if the middle part appears somewhere in the middle // of the line. E.g. for C the "*" appears often. - for (j = 0; ascii_iswhite(line[j]) && j <= i; j++) { + for (j = 0; j <= i && ascii_iswhite(line[j]); j++) { } if (j < i) { continue; |