summaryrefslogtreecommitdiff
path: root/src/popupmnu.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-03-02 10:13:42 +0100
committerBram Moolenaar <Bram@vim.org>2019-03-02 10:13:42 +0100
commitbdace838c67c1bd94e55e34270a8325933891466 (patch)
treecf80ca41305e4c04a2ccb293b6634b20fb235fbe /src/popupmnu.c
parentd82a81cad93708a6c180e59119db4818cc38c1a9 (diff)
downloadvim-git-bdace838c67c1bd94e55e34270a8325933891466.tar.gz
patch 8.1.0989: various small code uglinessv8.1.0989
Problem: Various small code ugliness. Solution: Remove pointless NULL checks. Fix function calls. Fix typos. (Dominique Pelle, closes #4060)
Diffstat (limited to 'src/popupmnu.c')
-rw-r--r--src/popupmnu.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/popupmnu.c b/src/popupmnu.c
index 755dba45a..7be8a9be4 100644
--- a/src/popupmnu.c
+++ b/src/popupmnu.c
@@ -405,7 +405,7 @@ pum_redraw(void)
char_u *p = NULL;
int totwidth, width, w;
int thumb_pos = 0;
- int thumb_heigth = 1;
+ int thumb_height = 1;
int round;
int n;
@@ -423,10 +423,10 @@ pum_redraw(void)
if (pum_scrollbar)
{
- thumb_heigth = pum_height * pum_height / pum_size;
- if (thumb_heigth == 0)
- thumb_heigth = 1;
- thumb_pos = (pum_first * (pum_height - thumb_heigth)
+ thumb_height = pum_height * pum_height / pum_size;
+ if (thumb_height == 0)
+ thumb_height = 1;
+ thumb_pos = (pum_first * (pum_height - thumb_height)
+ (pum_size - pum_height) / 2)
/ (pum_size - pum_height);
}
@@ -600,12 +600,12 @@ pum_redraw(void)
#ifdef FEAT_RIGHTLEFT
if (curwin->w_p_rl)
screen_putchar(' ', row, pum_col - pum_width,
- i >= thumb_pos && i < thumb_pos + thumb_heigth
+ i >= thumb_pos && i < thumb_pos + thumb_height
? attr_thumb : attr_scroll);
else
#endif
screen_putchar(' ', row, pum_col + pum_width,
- i >= thumb_pos && i < thumb_pos + thumb_heigth
+ i >= thumb_pos && i < thumb_pos + thumb_height
? attr_thumb : attr_scroll);
}