8000 feat: add pumborder by glepnir · Pull Request #17091 · vim/vim · GitHub
[go: up one dir, main page]

Skip to content

feat: add pumborder #17091

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

feat: add pumborder #17091

wants to merge 1 commit into from

Conversation

glepnir
Copy link
Member
@glepnir glepnir commented Apr 10, 2025

set pumborder=rounded hi PmenuBorder ctermfg=blue ctermbg=NONE

image

set pumborder=+,-,+,\|,+,-,+,\|

image

set wildoptions=pum

image

@glepnir glepnir marked this pull request as draft April 10, 2025 12:44
@chrisbra
Copy link
Member

Thanks, that looks nice. However this:

set pumborder=rounded
or
set pumborder=+,-,+,|,+,-,+,|

That looks inconsistent (using a single word vs. several single characters). Also I think would make sense to model it after the popup borderchars option (for popups). We could then later re-use this option for the popup borders as well, so perhaps call it just borderchars option then.

@girishji
Copy link
Contributor
girishji commented Apr 11, 2025

The right border wall should be shifted one cell to the right, placing the scrollbar inside the border—consistent with the behavior of popup_create(). In fact, all other aspects should align with popup_create(), including support for border, padding, borderchars, borderhighlight, and so on. There’s no justification for introducing inconsistent/confusing special case UI like "rounded". Instead use borderchars as intended.

@glepnir
Copy link
Member Author
glepnir commented Apr 11, 2025

That looks inconsistent (using a single word vs. several single characters)

single word is some built-in border types. Neovim has some built-in border types. This provides some convenience, borderchar is not easy to port to neovim. I implemented winborder option in neovim to set float window (vim is popup window) border, but it is only used for windows, not pum. Pum and popup are different things. Is it appropriate to use popup fields?

@zeertzjq
Copy link
Member
zeertzjq commented Apr 25, 2025

I think this feature is not worth adding. The code for computing popupmenu position and size is already quite complicated, and adding a border to the popupmenu will even further complicate the code and introduce more edge cases.

@glepnir
8000 Copy link
Member Author
glepnir commented Apr 25, 2025

Not entirely correct. When the height is sufficient, we add an extra border. When the screen space is insufficient, the upper edge and width of the current pum are additionally occupied. code is not complicated

@zeertzjq
Copy link
Member
zeertzjq commented Apr 25, 2025

Also, mouse select position is currently off-by-one in right-click menu with 'pumborder' enabled:

source $VIMRUNTIME/menu.vim
set mousemodel=popup
set pumborder=rounded

@glepnir
Copy link
Member Author
glepnir commented Apr 25, 2025

fixed .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0