fix: change default border config to nil (#643)
Neovim 0.11 introduced the winborder option, which serves the same purpose. By defaulting the border to nil, we will use whatever value the user has configured with winborder. --------- Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
This commit is contained in:
parent
919e155fdf
commit
200df01e4b
3 changed files with 26 additions and 15 deletions
10
README.md
10
README.md
|
|
@ -262,7 +262,7 @@ require("oil").setup({
|
|||
-- max_width and max_height can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
max_width = 0,
|
||||
max_height = 0,
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
|
|
@ -307,7 +307,7 @@ require("oil").setup({
|
|||
min_height = { 5, 0.1 },
|
||||
-- optionally define an integer/float for the exact height of the preview window
|
||||
height = nil,
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
|
|
@ -320,7 +320,7 @@ require("oil").setup({
|
|||
max_height = { 10, 0.9 },
|
||||
min_height = { 5, 0.1 },
|
||||
height = nil,
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
minimized_border = "none",
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
|
|
@ -328,11 +328,11 @@ require("oil").setup({
|
|||
},
|
||||
-- Configuration for the floating SSH window
|
||||
ssh = {
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
},
|
||||
-- Configuration for the floating keymaps help window
|
||||
keymaps_help = {
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
},
|
||||
})
|
||||
```
|
||||
|
|
|
|||
10
doc/oil.txt
10
doc/oil.txt
|
|
@ -144,7 +144,7 @@ CONFIG *oil-confi
|
|||
-- max_width and max_height can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
max_width = 0,
|
||||
max_height = 0,
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
|
|
@ -189,7 +189,7 @@ CONFIG *oil-confi
|
|||
min_height = { 5, 0.1 },
|
||||
-- optionally define an integer/float for the exact height of the preview window
|
||||
height = nil,
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
|
|
@ -202,7 +202,7 @@ CONFIG *oil-confi
|
|||
max_height = { 10, 0.9 },
|
||||
min_height = { 5, 0.1 },
|
||||
height = nil,
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
minimized_border = "none",
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
|
|
@ -210,11 +210,11 @@ CONFIG *oil-confi
|
|||
},
|
||||
-- Configuration for the floating SSH window
|
||||
ssh = {
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
},
|
||||
-- Configuration for the floating keymaps help window
|
||||
keymaps_help = {
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
},
|
||||
})
|
||||
<
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ local default_config = {
|
|||
-- max_width and max_height can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
max_width = 0,
|
||||
max_height = 0,
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
|
|
@ -172,7 +172,7 @@ local default_config = {
|
|||
min_height = { 5, 0.1 },
|
||||
-- optionally define an integer/float for the exact height of the preview window
|
||||
height = nil,
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
|
|
@ -185,7 +185,7 @@ local default_config = {
|
|||
max_height = { 10, 0.9 },
|
||||
min_height = { 5, 0.1 },
|
||||
height = nil,
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
minimized_border = "none",
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
|
|
@ -193,11 +193,11 @@ local default_config = {
|
|||
},
|
||||
-- Configuration for the floating SSH window
|
||||
ssh = {
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
},
|
||||
-- Configuration for the floating keymaps help window
|
||||
keymaps_help = {
|
||||
border = "rounded",
|
||||
border = nil,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -412,6 +412,17 @@ M.setup = function(opts)
|
|||
end
|
||||
end
|
||||
|
||||
-- Backwards compatibility for old versions that don't support winborder
|
||||
if vim.fn.has("nvim-0.11") == 0 then
|
||||
new_conf = vim.tbl_deep_extend("keep", new_conf, {
|
||||
float = { border = "rounded" },
|
||||
confirmation = { border = "rounded" },
|
||||
progress = { border = "rounded" },
|
||||
ssh = { border = "rounded" },
|
||||
keymaps_help = { border = "rounded" },
|
||||
})
|
||||
end
|
||||
|
||||
-- Backwards compatibility. We renamed the 'preview' window config to be called 'confirmation'.
|
||||
if opts.preview and not opts.confirmation then
|
||||
new_conf.confirmation = vim.tbl_deep_extend("keep", opts.preview, default_config.confirmation)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue