Skip to content

Commit 200df01

Browse files
seblyngstevearc
andauthored
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>
1 parent 919e155 commit 200df01

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ require("oil").setup({
262262
-- max_width and max_height can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
263263
max_width = 0,
264264
max_height = 0,
265-
border = "rounded",
265+
border = nil,
266266
win_options = {
267267
winblend = 0,
268268
},
@@ -307,7 +307,7 @@ require("oil").setup({
307307
min_height = { 5, 0.1 },
308308
-- optionally define an integer/float for the exact height of the preview window
309309
height = nil,
310-
border = "rounded",
310+
border = nil,
311311
win_options = {
312312
winblend = 0,
313313
},
@@ -320,19 +320,19 @@ require("oil").setup({
320320
max_height = { 10, 0.9 },
321321
min_height = { 5, 0.1 },
322322
height = nil,
323-
border = "rounded",
323+
border = nil,
324324
minimized_border = "none",
325325
win_options = {
326326
winblend = 0,
327327
},
328328
},
329329
-- Configuration for the floating SSH window
330330
ssh = {
331-
border = "rounded",
331+
border = nil,
332332
},
333333
-- Configuration for the floating keymaps help window
334334
keymaps_help = {
335-
border = "rounded",
335+
border = nil,
336336
},
337337
})
338338
```

doc/oil.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ CONFIG *oil-confi
144144
-- max_width and max_height can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
145145
max_width = 0,
146146
max_height = 0,
147-
border = "rounded",
147+
border = nil,
148148
win_options = {
149149
winblend = 0,
150150
},
@@ -189,7 +189,7 @@ CONFIG *oil-confi
189189
min_height = { 5, 0.1 },
190190
-- optionally define an integer/float for the exact height of the preview window
191191
height = nil,
192-
border = "rounded",
192+
border = nil,
193193
win_options = {
194194
winblend = 0,
195195
},
@@ -202,19 +202,19 @@ CONFIG *oil-confi
202202
max_height = { 10, 0.9 },
203203
min_height = { 5, 0.1 },
204204
height = nil,
205-
border = "rounded",
205+
border = nil,
206206
minimized_border = "none",
207207
win_options = {
208208
winblend = 0,
209209
},
210210
},
211211
-- Configuration for the floating SSH window
212212
ssh = {
213-
border = "rounded",
213+
border = nil,
214214
},
215215
-- Configuration for the floating keymaps help window
216216
keymaps_help = {
217-
border = "rounded",
217+
border = nil,
218218
},
219219
})
220220
<

lua/oil/config.lua

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ local default_config = {
127127
-- max_width and max_height can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
128128
max_width = 0,
129129
max_height = 0,
130-
border = "rounded",
130+
border = nil,
131131
win_options = {
132132
winblend = 0,
133133
},
@@ -172,7 +172,7 @@ local default_config = {
172172
min_height = { 5, 0.1 },
173173
-- optionally define an integer/float for the exact height of the preview window
174174
height = nil,
175-
border = "rounded",
175+
border = nil,
176176
win_options = {
177177
winblend = 0,
178178
},
@@ -185,19 +185,19 @@ local default_config = {
185185
max_height = { 10, 0.9 },
186186
min_height = { 5, 0.1 },
187187
height = nil,
188-
border = "rounded",
188+
border = nil,
189189
minimized_border = "none",
190190
win_options = {
191191
winblend = 0,
192192
},
193193
},
194194
-- Configuration for the floating SSH window
195195
ssh = {
196-
border = "rounded",
196+
border = nil,
197197
},
198198
-- Configuration for the floating keymaps help window
199199
keymaps_help = {
200-
border = "rounded",
200+
border = nil,
201201
},
202202
}
203203

@@ -412,6 +412,17 @@ M.setup = function(opts)
412412
end
413413
end
414414

415+
-- Backwards compatibility for old versions that don't support winborder
416+
if vim.fn.has("nvim-0.11") == 0 then
417+
new_conf = vim.tbl_deep_extend("keep", new_conf, {
418+
float = { border = "rounded" },
419+
confirmation = { border = "rounded" },
420+
progress = { border = "rounded" },
421+
ssh = { border = "rounded" },
422+
keymaps_help = { border = "rounded" },
423+
})
424+
end
425+
415426
-- Backwards compatibility. We renamed the 'preview' window config to be called 'confirmation'.
416427
if opts.preview and not opts.confirmation then
417428
new_conf.confirmation = vim.tbl_deep_extend("keep", opts.preview, default_config.confirmation)

0 commit comments

Comments
 (0)