vim-patch:8.2.0316: ex_getln.c code has insufficient test coverage

Problem:    ex_getln.c code has insufficient test coverage.
Solution:   Add more tests. Fix a problem. (Yegappan Lakshmanan, closes vim/vim#5693)
8d588ccee5
This commit is contained in:
zeertzjq
2022-07-02 09:40:06 +08:00
parent d197e77a55
commit 7277543772
4 changed files with 119 additions and 1 deletions

View File

@@ -6293,7 +6293,7 @@ static int calc_hist_idx(int histype, int num)
wrapped = TRUE;
}
}
if (hist[i].hisnum == num && hist[i].hisstr != NULL) {
if (i >= 0 && hist[i].hisnum == num && hist[i].hisstr != NULL) {
return i;
}
} else if (-num <= hislen) {