-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
feat: add pumborder #17091
Conversation
|
Thanks, that looks nice. However this:
That looks inconsistent (using a single word vs. several single characters). Also I think would make sense to model it after the popup |
|
The right border wall should be shifted one cell to the right, placing the scrollbar inside the border—consistent with the behavior of |
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? |
|
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. |
|
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 |
|
Also, mouse select position is currently off-by-one in right-click menu with source $VIMRUNTIME/menu.vim
set mousemodel=popup
set pumborder=rounded |
|
fixed . |
Problem: not possible to style popup borders globally
Solution: Add the 'pumborder' option (Girish Palya)
This commit introduces a new global option, 'pumborder' ('pb'), that
allows users to define borders and optional decorations for the
completion popup menu.
```
Defines a border and optional decorations for the popup menu in
completion. The value is a comma-separated list of keywords.
Border styles (at most one):
"single"singleuse thin box-drawing characters
"double"doubleuse double-line box-drawing characters
"round"rounduse rounded corners
"ascii"asciiuse ASCII characters (-, |, +)
"custom:XXXXXXXX"
use eight characters given after "custom:",
in order: top, right, bottom, left,
topleft, topright, botright, botleft
Additional flags:
"margin"marginadds one-cell spacing inside the left and right border
"shadow"shadowdraws a shadow at the right and bottom edges
Highlight groups:
|hl-PmenuBorder|hl-PmenuBorderused for the border characters
|hl-PmenuShadow|hl-PmenuShadowused for the shadow
Examples: >
:set pumborder=single
:set pumborder=double,margin,shadow
:set pumborder=custom:─│─│┌┐┘└,shadow
Border styles using box-drawing characters ("single", "double",
"round") are only available when |'encoding'| is "utf-8" and
|'ambiwidth'| is "single". "margin" requires a border style.
See also: |ins-completion-menu|.
```
fixes: vim#18441 (comment)
closes: vim#18486
closes: vim#17091
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
set pumborder=roundedhi PmenuBorder ctermfg=blue ctermbg=NONEset pumborder=+,-,+,\|,+,-,+,\|set wildoptions=pum