aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/popupmnu.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-03-28 13:54:28 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-03-29 18:29:25 -0400
commit375f957af65509bcf80c073362fae1d95bb32380 (patch)
tree9052916efcbf0efe9a3040b17091142ccff0aa6f /src/nvim/popupmnu.c
parent3dbcf69888b0f44c06b9ede3928fcd9d68f65739 (diff)
downloadrneovim-375f957af65509bcf80c073362fae1d95bb32380.tar.gz
rneovim-375f957af65509bcf80c073362fae1d95bb32380.tar.bz2
rneovim-375f957af65509bcf80c073362fae1d95bb32380.zip
vim-patch:8.1.0989: various small code ugliness
Problem: Various small code ugliness. Solution: Remove pointless NULL checks. Fix function calls. Fix typos. (Dominique Pelle, closes vim/vim#4060) https://github.com/vim/vim/commit/bdace838c67c1bd94e55e34270a8325933891466
Diffstat (limited to 'src/nvim/popupmnu.c')
-rw-r--r--src/nvim/popupmnu.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c
index 68abf57413..32c9750628 100644
--- a/src/nvim/popupmnu.c
+++ b/src/nvim/popupmnu.c
@@ -398,7 +398,7 @@ void 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;
@@ -449,11 +449,11 @@ void pum_redraw(void)
}
if (pum_scrollbar) {
- thumb_heigth = pum_height * pum_height / pum_size;
- if (thumb_heigth == 0) {
- thumb_heigth = 1;
+ thumb_height = pum_height * pum_height / pum_size;
+ if (thumb_height == 0) {
+ thumb_height = 1;
}
- thumb_pos = (pum_first * (pum_height - thumb_heigth)
+ thumb_pos = (pum_first * (pum_height - thumb_height)
+ (pum_size - pum_height) / 2)
/ (pum_size - pum_height);
}
@@ -616,11 +616,11 @@ void pum_redraw(void)
if (pum_scrollbar > 0) {
if (pum_rl) {
grid_putchar(&pum_grid, ' ', row, col_off - pum_width,
- i >= thumb_pos && i < thumb_pos + thumb_heigth
+ i >= thumb_pos && i < thumb_pos + thumb_height
? attr_thumb : attr_scroll);
} else {
grid_putchar(&pum_grid, ' ', row, col_off + pum_width,
- i >= thumb_pos && i < thumb_pos + thumb_heigth
+ i >= thumb_pos && i < thumb_pos + thumb_height
? attr_thumb : attr_scroll);
}
}