summaryrefslogtreecommitdiff
path: root/src/popupmnu.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-11-06 04:04:33 +0100
committerBram Moolenaar <Bram@vim.org>2013-11-06 04:04:33 +0100
commit4c1e626103397f8ac84ab7ca29cc74d0b3cc06e6 (patch)
treee1235b4dcac8f377024f62b87afdbd2646706891 /src/popupmnu.c
parent84dbb62fca26784eb706f5309f9285464d1a2989 (diff)
downloadvim-git-4c1e626103397f8ac84ab7ca29cc74d0b3cc06e6.tar.gz
updated for version 7.4.072v7.4.072
Problem: Crash when using Insert mode completion. Solution: Avoid going past the end of pum_array. (idea by Fransisco Lopes)
Diffstat (limited to 'src/popupmnu.c')
-rw-r--r--src/popupmnu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/popupmnu.c b/src/popupmnu.c
index 44ed87804..8ff0711cc 100644
--- a/src/popupmnu.c
+++ b/src/popupmnu.c
@@ -282,6 +282,10 @@ pum_redraw()
int round;
int n;
+ /* Never display more than we have */
+ if (pum_first > pum_size - pum_height)
+ pum_first = pum_size - pum_height;
+
if (pum_scrollbar)
{
thumb_heigth = pum_height * pum_height / pum_size;
@@ -672,10 +676,6 @@ pum_set_selected(n, repeat)
#endif
}
- /* Never display more than we have */
- if (pum_first > pum_size - pum_height)
- pum_first = pum_size - pum_height;
-
if (!resized)
pum_redraw();