Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion doc/mini-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ Callback for each file action event will receive `data` field
- <to> - full path of entry after action (`nil` for permanent "delete" action).

------------------------------------------------------------------------------
*MiniFiles-examples*
# Toggle explorer ~

Use a combination of |MiniFiles.open()| and |MiniFiles.close()|: >lua
Expand Down Expand Up @@ -405,6 +404,11 @@ updated internally. Use `MiniFilesWindowUpdate` event for them: >lua
-- Ensure fixed height
config.height = 10

------------------------------------------------------------------------------
*MiniFiles-examples*
-- Ensure style
config.style = nil

-- Ensure no title padding
local n = #config.title
config.title[1][1] = config.title[1][1]:gsub('^ ', '')
Expand Down
3 changes: 3 additions & 0 deletions lua/mini/files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,9 @@
---
--- -- Ensure fixed height
--- config.height = 10

--- -- Ensure style
--- config.style = nil
---
--- -- Ensure no title padding
--- local n = #config.title
Expand Down
2 changes: 2 additions & 0 deletions tests/test_files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5523,6 +5523,8 @@ T['Events']['`MiniFilesWindowUpdate` can customize internally set window config
local config = vim.api.nvim_win_get_config(args.data.win_id)
-- Ensure fixed height
config.height = 5
-- Ensure style
config.style = nil
-- Ensure title padding
local n = #config.title
config.title[1][1] = config.title[1][1]:gsub('^ ', '')
Expand Down
8 changes: 6 additions & 2 deletions tests/test_map.lua
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,13 @@ T['open()']['correctly computes window config'] = function()
map_open()
local win_id = get_map_win_id()

local hide, mouse, border
local hide, mouse, border, style
if child.fn.has('nvim-0.10') == 1 then hide = false end
if child.fn.has('nvim-0.11') == 1 then mouse = false end
if child.fn.has('nvim-0.12') == 1 then border = 'none' end
if child.fn.has('nvim-0.12') == 1 then
border = 'none'
style = 'minimal'
end
eq(child.api.nvim_win_get_config(win_id), {
anchor = 'NE',
border = border,
Expand All @@ -400,6 +403,7 @@ T['open()']['correctly computes window config'] = function()
mouse = mouse,
relative = 'editor',
row = 0,
style = style,
width = 10,
zindex = 10,
})
Expand Down