-
Notifications
You must be signed in to change notification settings - Fork 513
feat(window): add support for vim.o.winborder #1957
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
base: main
Are you sure you want to change the base?
Changes from all commits
564e5ab
15f1f76
232be12
34514b9
ae2fe94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,7 +53,7 @@ function M:init(opts) | |
| self.opts = vim.tbl_deep_extend("force", { | ||
| size = Config.options.ui.size, | ||
| style = "minimal", | ||
| border = Config.options.ui.border or "none", | ||
| border = Config.options.ui.border or vim.o.winborder or "none", | ||
| backdrop = Config.options.ui.backdrop or 60, | ||
| zindex = 50, | ||
| }, opts or {}) | ||
|
|
@@ -66,7 +66,7 @@ function M:init(opts) | |
| self.win_opts = { | ||
| relative = "editor", | ||
| style = self.opts.style ~= "" and self.opts.style or nil, | ||
| border = self.opts.border, | ||
| border = self.opts.border or vim.o.winborder, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not needed. The line I posted in the other comment will just have the |
||
| zindex = self.opts.zindex, | ||
| noautocmd = self.opts.noautocmd, | ||
| title = self.opts.title, | ||
|
|
@@ -92,7 +92,7 @@ function M:layout() | |
| self.win_opts.row = math.floor((vim.o.lines - self.win_opts.height) / 2) | ||
| self.win_opts.col = math.floor((vim.o.columns - self.win_opts.width) / 2) | ||
|
|
||
| if self.opts.border ~= "none" then | ||
| if self.opts.border ~= "none" or vim.o.winborder then | ||
| self.win_opts.row = self.win_opts.row - 1 | ||
| self.win_opts.col = self.win_opts.col - 1 | ||
| end | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something like: local border = self.opts.border or vim.fn.exists("&winborder") == 1 and vim.o.winborder or "none"
if border ~= "none" or border ~= "" thenshould work.
|
||
|
|
@@ -149,6 +149,7 @@ function M:mount() | |
| row = 0, | ||
| col = 0, | ||
| style = "minimal", | ||
| border = "none", | ||
| focusable = false, | ||
| zindex = self.opts.zindex - 1, | ||
| }) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work properly with winborder now supporting custom borderchars. See here for example for how it can be supported: saghen/blink.cmp#1984
It will also probably error for users that are not using nvim 0.11. I think something like this might work: