fix: oil.select respects splitbelow and splitright (#233)
This commit is contained in:
parent
e89a8f8ade
commit
636989b603
1 changed files with 7 additions and 3 deletions
|
|
@ -431,12 +431,16 @@ M.select = function(opts, callback)
|
|||
callback(err)
|
||||
end
|
||||
end
|
||||
if opts.horizontal or opts.vertical or opts.preview then
|
||||
opts.split = opts.split or "belowright"
|
||||
end
|
||||
if opts.preview and not opts.horizontal and opts.vertical == nil then
|
||||
opts.vertical = true
|
||||
end
|
||||
if not opts.split and (opts.horizontal or opts.vertical or opts.preview) then
|
||||
if opts.horizontal then
|
||||
opts.split = vim.o.splitbelow and "belowright" or "aboveleft"
|
||||
else
|
||||
opts.split = vim.o.splitright and "belowright" or "aboveleft"
|
||||
end
|
||||
end
|
||||
if opts.tab and (opts.preview or opts.split) then
|
||||
return finish("Cannot set preview or split when tab = true")
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue