Replies: 4 comments 19 replies
|
Hi @felpafel, I read your post with interest. Thanks!
I can't reproduce that behavior using nightly. I tried with MiniMax, and also with an "empty" init.lua. The quickfix always opens below, occupying the full width.
You are comparing maintenance by users versus maintenance by the mini.nvim team. Also, by allowing the user to override Perhaps it is a bit too much to have both the override and the configuration options. |
|
Hello @abeldekat, thanks for the response. Yeah, Nightly changed the default behavior compared to nvim stable and vim, but the window modifiers like vertical_copen_120.mp4
I didn't understand what you mean. The ability to override and the configuration options are already implemented, for example to send marked items to the location list (instead of the quickfix list) the user must do: local minipick = require('mini.pick')
minipick.setup({
source = {
choose_marked = function(items)
minipick.default_choose_marked(items, { list_type = 'location' })
end
}
})My issue is that the function call |
While the guys from the team are responding to you, I have a simple question: is there any reason not to change the window properties after opening? Do you see the difference? P.S. Sorry, I'll wait for your reply so I don't cause more confusion. |
|
Thanks for the suggestion! As others noted, adding new configurations to any 'mini.nvim' module is usually a hard decision, but for 'mini.pick' it is especially so due to its size. My initial reaction is that this might be reasonable for two reasons:
My second reaction was that I don't think that 'mini.pick' has to even decide how to open quickfix/loclist. Is it reasonable for the user to have 'mini.pick' open quickfix/loclist differently than it is usually done? I think the answer is no. So the solution here should be to configure quickfix to always open as you'd prefer. For example, something like this should fix this problem: local fix_quickfix = function(ev)
local qf_data = vim.fn.getqflist({ qfbufnr = true, size = true, winid = true })
if qf_data.qfbufnr ~= ev.buf then return end
vim.api.nvim_win_call(qf_data.winid, function()
vim.cmd('wincmd J')
vim.api.nvim_win_set_height(0, math.min(qf_data.size, 5))
end)
end
vim.api.nvim_create_autocmd('FileType', { pattern = 'qf', callback = fix_quickfix, desc = 'Fix quickfix' })@felpafel, does this solve the issue for you? |
Uh oh!
There was an error while loading. Please reload this page.
Hello, I want to propose a small feature to the
MiniPick.default_choose_marked()so the user can control the quickfix/location list position and height/width.Reasoning
copen behavior
Sometimes,
:copen's split behavior is not desired by the user.For example, at a vertical split
:copenwill open below the last created window instead of the current window.Vim solution to this problem
Vim solve this problem by letting the user combine
:copen/:lopenwith commands like:vertical,:horizontaland more (the full list of commands start with the tag:h verticalup to:h botrightin the:h windows.txtfile). It's even possible to combine multiple of those commands, like::vertical topleft copen 120(Open a vertical split at the left occupying the full height and width equals 120).Current limitations using MiniPick.default_choose_marked()
It's not possible to specify the height before opening the quickfix/location list (It's possible to change the height after opened using an autocmd/filetype config).
The window position is always the default behavior of
:copen/:lopen.Solution
Extend the
optsparameter inMiniPick.default_choose_marked()so it accepts two more fields. One for the split behavior, and other for the width/height modifier.Since
copenandlopenare called only once in the codebase, the following changes suffice:Code usage (user side) comparison:
I have tested the proposed solution locally without any issues.
Let me know what you think, and thanks for your time.
All reactions