mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.0.1522: popup menu is positioned in the wrong place
Problem: Popup menu is positioned in the wrong place. (Davit Samvelyan,
Boris Staletic)
Solution: Correct computation of the column and the conditions for that.
(Hirohito Higashi, closes vim/vim#2640)
4287ed33dd
This commit is contained in:
parent
ac85d1f52f
commit
d56f36f46c
@ -305,22 +305,25 @@ void pum_display(pumitem_T *array, int size, int selected, bool array_changed,
|
||||
&& (col < Columns - p_pw
|
||||
|| col < Columns - max_width))) {
|
||||
// align right pum edge with "col"
|
||||
if (curwin->w_p_rl) {
|
||||
if (curwin->w_p_rl
|
||||
&& col < max_width + pum_scrollbar + 1) {
|
||||
pum_col = col + max_width + pum_scrollbar + 1;
|
||||
if (pum_col >= Columns) {
|
||||
pum_col = Columns - 1;
|
||||
}
|
||||
} else {
|
||||
pum_col = col - max_width - pum_scrollbar;
|
||||
if (pum_col < 0) {
|
||||
pum_col = 0;
|
||||
} else if (!curwin->w_p_rl) {
|
||||
if (col > Columns - max_width - pum_scrollbar) {
|
||||
pum_col = col - max_width - pum_scrollbar;
|
||||
if (pum_col < 0) {
|
||||
pum_col = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (curwin->w_p_rl) {
|
||||
pum_width = W_ENDCOL(curwin) - pum_col - pum_scrollbar + 1;
|
||||
pum_width = pum_col - pum_scrollbar + 1;
|
||||
} else {
|
||||
pum_width = pum_col - pum_scrollbar;
|
||||
pum_width = Columns - pum_col - pum_scrollbar;
|
||||
}
|
||||
|
||||
if (pum_width < p_pw) {
|
||||
|
Loading…
Reference in New Issue
Block a user