diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-01-23 22:30:28 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-01-23 22:30:28 +0000 |
commit | 7df351eb8aecf8e542c7ebecc4ec734107a8aacb (patch) | |
tree | 84346fa33458434296592b3f8c7987e6b94514fb /src/popupmenu.c | |
parent | 09df3127f43aa9804e077726ac1bf17cb9e2c85f (diff) | |
download | vim-7df351eb8aecf8e542c7ebecc4ec734107a8aacb.zip |
updated for version 7.0186
Diffstat (limited to 'src/popupmenu.c')
-rw-r--r-- | src/popupmenu.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/popupmenu.c b/src/popupmenu.c index acc111ec2..a129d146a 100644 --- a/src/popupmenu.c +++ b/src/popupmenu.c @@ -240,12 +240,14 @@ pum_set_selected(n) if (pum_first > pum_selected - 4) { /* scroll down; when we did a jump it's probably a PageUp then - * scroll to put the selected entry at the bottom */ + * scroll a whole page */ if (pum_first > pum_selected - 2) { - pum_first = pum_selected - pum_height + 1; + pum_first -= pum_height - 2; if (pum_first < 0) pum_first = 0; + else if (pum_first > pum_selected) + pum_first = pum_selected; } else pum_first = pum_selected; @@ -253,9 +255,13 @@ pum_set_selected(n) else if (pum_first < pum_selected - pum_height + 5) { /* scroll up; when we did a jump it's probably a PageDown then - * scroll to put the selected entry at the top */ + * scroll a whole page */ if (pum_first < pum_selected - pum_height + 1 + 2) - pum_first = pum_selected; + { + pum_first += pum_height - 2; + if (pum_first < pum_selected - pum_height + 1) + pum_first = pum_selected - pum_height + 1; + } else pum_first = pum_selected - pum_height + 1; } |