diff options
author | raichoo <raichoo@googlemail.com> | 2017-03-26 23:15:53 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-03-26 23:15:53 +0200 |
commit | edc80f6b46f51ea1137289301914c0f90db19295 (patch) | |
tree | 12ec598af9e03786d6853dd500ea30bf08d3e071 /src/nvim/ex_getln.c | |
parent | f9a31e98505c0f5e83dd3ba957fbd0f4b150d30c (diff) | |
download | rneovim-edc80f6b46f51ea1137289301914c0f90db19295.tar.gz rneovim-edc80f6b46f51ea1137289301914c0f90db19295.tar.bz2 rneovim-edc80f6b46f51ea1137289301914c0f90db19295.zip |
vim-patch:7.4.2357 (#6354)
Problem: Attempt to read history entry while not initialized.
Solution: Skip when the index is negative.
https://github.com/vim/vim/commit/46643713dc6bb04b4e84986b1763ef309e960161
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 58979c0e43..8758a63bce 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -4677,8 +4677,8 @@ add_to_history ( * down, only lines that were added. */ if (histype == HIST_SEARCH && in_map) { - if (maptick == last_maptick) { - /* Current line is from the same mapping, remove it */ + if (maptick == last_maptick && hisidx[HIST_SEARCH] >= 0) { + // Current line is from the same mapping, remove it hisptr = &history[HIST_SEARCH][hisidx[HIST_SEARCH]]; hist_free_entry(hisptr); --hisnum[histype]; |