mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.4968: reading past end of the line when C-indenting
Problem: Reading past end of the line when C-indenting.
Solution: Check for NUL.
60ae0e7149
This commit is contained in:
parent
b8c0eeaa30
commit
26c906f54d
@ -150,7 +150,7 @@ static const char_u *skip_string(const char_u *p)
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (p[i] == '\'') { // check for trailing '
|
if (p[i - 1] != NUL && p[i] == '\'') { // check for trailing '
|
||||||
p += i;
|
p += i;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -5311,6 +5311,13 @@ func Test_cindent_case()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" This was reading past the end of the line
|
||||||
|
func Test_cindent_check_funcdecl()
|
||||||
|
new
|
||||||
|
sil norm o0('\0=L
|
||||||
|
bwipe!
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_cindent_scopedecls()
|
func Test_cindent_scopedecls()
|
||||||
new
|
new
|
||||||
setl cindent ts=4 sw=4
|
setl cindent ts=4 sw=4
|
||||||
|
Loading…
Reference in New Issue
Block a user