diff --git a/README.md b/README.md index 04dc680..adc6dca 100644 --- a/README.md +++ b/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, }, }) ``` diff --git a/doc/oil.txt b/doc/oil.txt index fdc7ca5..7086ffe 100644 --- a/doc/oil.txt +++ b/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, }, }) < diff --git a/lua/oil/config.lua b/lua/oil/config.lua index 6797cc8..7b4e97c 100644 --- a/lua/oil/config.lua +++ b/lua/oil/config.lua @@ -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)