Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLPUM doesn't appear if some options are set #2

Closed
ichizok opened this issue Nov 27, 2015 · 2 comments
Closed

CLPUM doesn't appear if some options are set #2

ichizok opened this issue Nov 27, 2015 · 2 comments
Labels

Comments

@ichizok
Copy link

ichizok commented Nov 27, 2015

&conceallevel > 0 の状態で cursorline, cursorcolumn, relativenumber のいずれかを設定すると、
<C-D> で CLPUM が表示されないことがあります。

[repro steps]

vimrc:

if exists('+clpum')
    set clpum
    set clpumheight=40
    set clcompleteopt+=noinsert
endif
set cole=1 cul
vim -u vimrc -N
:set <C-D>

expected: CLPUM が表示される
actual: CLPUM が表示されない

内部的には処理が実行されているので、<C-N> 等で候補選択すると CLPUM が表示されます。

[investigation]

vim/src/main.c

Line 1196 in 60422e6

conceal_update_lines = TRUE;

&conceallevel > 0 のとき conceal_update_lines = TRUE

vim/src/main.c

Line 1299 in 60422e6

curwin->w_valid &= ~VALID_CROW;

で、curwin->w_valid &= ~VALID_CROW となる

vim/src/move.c

Line 970 in 60422e6

if (!(curwin->w_valid & VALID_CROW))

vim/src/move.c

Line 795 in 60422e6

redraw_for_cursorline(curwin);

そのため、CLPUM 実行時に curs_columns > curs_rows > redraw_for_cursorline と呼ばれ、

vim/src/move.c

Line 145 in 60422e6

redraw_win_later(wp, SOME_VALID);

ここで、cursorline, relativenumber がセットされていると redraw_win_later(wp, SOME_VALID) が呼ばれるため、この後の再描画で CLPUM が消去されてしまいます。

[solution proposal]

vim/src/move.c

Line 142 in 60422e6

&& !pum_visible()

vim/src/move.c

Line 824 in 60422e6

&& !pum_visible()

vim/src/move.c

Line 1197 in 60422e6

&& !pum_visible()

上記箇所の判定に && !clpum_visible() を追加することで領域の再描画を回避できました。

@h-east h-east added the bug label Nov 28, 2015
h-east added a commit that referenced this issue Nov 28, 2015
@h-east
Copy link
Owner

h-east commented Nov 28, 2015

@ichizok Thanks for the clear explanation. I fixed.
Please check a new patch.

ありがとう

@ichizok
Copy link
Author

ichizok commented Nov 30, 2015

👍 Thank you!

@h-east h-east added the fixed label Nov 30, 2015
@h-east h-east closed this as completed Nov 30, 2015
h-east added a commit that referenced this issue Nov 30, 2015
h-east added a commit that referenced this issue Dec 1, 2015
h-east added a commit that referenced this issue Dec 1, 2015
h-east added a commit that referenced this issue Dec 2, 2015
h-east added a commit that referenced this issue Dec 4, 2015
h-east added a commit that referenced this issue Feb 13, 2016
h-east pushed a commit that referenced this issue Apr 2, 2016
Fix build errors and warnings
h-east added a commit that referenced this issue Feb 17, 2019
h-east added a commit that referenced this issue Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants