Merge pull request #52436 from daniel-mcclintock/fix-out-of-bounds-completion-crash

Fix crash during completion lookback
This commit is contained in:
Max Hilbrunner 2021-09-07 19:25:40 +02:00 committed by GitHub
commit 06b4a48444
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2744,7 +2744,7 @@ void CodeEdit::_filter_code_completion_candidates_impl() {
/* If we have a space, previous word might be a keyword. eg "func |". */
} else if (cofs > 0 && line[cofs - 1] == ' ') {
int ofs = cofs - 1;
while (ofs >= 0 && line[ofs] == ' ') {
while (ofs > 0 && line[ofs] == ' ') {
ofs--;
}
prev_is_word = _is_char(line[ofs]);