From ce3f67d565d9598f68f73a4ab1663c588f7cd356 Mon Sep 17 00:00:00 2001 From: abeldekat <58370433+abeldekat@users.noreply.github.com> Date: Wed, 4 Mar 2026 10:25:48 +0100 Subject: [PATCH] test(ALL): on Nightly `nvim_win_get_config()` always returns "style" See PR 38122 in neovim/neovim Details: - This also affects the documentation as one test is about the officially documented example in MiniFiles-examples --- doc/mini-files.txt | 6 +++++- lua/mini/files.lua | 3 +++ tests/test_files.lua | 2 ++ tests/test_map.lua | 8 ++++++-- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/doc/mini-files.txt b/doc/mini-files.txt index e567b235..cfd7ea68 100644 --- a/doc/mini-files.txt +++ b/doc/mini-files.txt @@ -367,7 +367,6 @@ Callback for each file action event will receive `data` field - - 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 @@ -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('^ ', '') diff --git a/lua/mini/files.lua b/lua/mini/files.lua index 1776a65c..6196c201 100644 --- a/lua/mini/files.lua +++ b/lua/mini/files.lua @@ -398,6 +398,9 @@ --- --- -- Ensure fixed height --- config.height = 10 + +--- -- Ensure style +--- config.style = nil --- --- -- Ensure no title padding --- local n = #config.title diff --git a/tests/test_files.lua b/tests/test_files.lua index 1af238b3..ac834701 100644 --- a/tests/test_files.lua +++ b/tests/test_files.lua @@ -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('^ ', '') diff --git a/tests/test_map.lua b/tests/test_map.lua index 8e1d9637..89fe0db7 100644 --- a/tests/test_map.lua +++ b/tests/test_map.lua @@ -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, @@ -400,6 +403,7 @@ T['open()']['correctly computes window config'] = function() mouse = mouse, relative = 'editor', row = 0, + style = style, width = 10, zindex = 10, })