How to set default source.preview for MiniExtra.pickers? #1799
-
Contributing guidelines
Module(s)mini.extra, mini.pick QuestionI prefer my previews to center the line instead of the default top position, so I have this in my config: require("mini.pick").setup({
source = {
preview = function(buf_id, item)
return MiniPick.default_preview(buf_id, item, { line_position = "center" })
end
}
}) This works for pickers defined in 'mini.pick' (grep for example), but it does not seem to apply to the pickers defined in 'mini.extra' (buf_lines for example). What would be the recommended way of setting the default options for Thanks! p.s. And, out of curiosity, why is top the default? I prefer to have context both before and afterwards when previewing. And I'm legitimately surprised that someone would not, but I'm probably not thinking of some use case that I just don't use. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I think this line prevents the override. When I remove that line, the configured line_position is applied. EDIT: Perhaps the fallback is not needed in |
Beta Was this translation helpful? Give feedback.
-
This was indeed a 'mini.extra' issue and now should be fixed on latest
In my mind, it mostly depends on which type context is useful more frequently. I remember having frequent troubles with "before-after" context (as that is what Telescope did) as usually for me what goes afterwards is more important (like function body, variable assigned value, etc.). I do indeed find myself occasionally having to scroll back in preview because I need more "before" context, but not sure if that is frequent enough for me. I might test the "center" preview approach for a bit and see if there are any issues with it. But in general I am not fond of the idea of making change of default values. We'll see. |
Beta Was this translation helpful? Give feedback.
This was indeed a 'mini.extra' issue and now should be fixed on latest
main
. @abeldekat, yes removingfallback
altogether was enough and doesn't seem to break anything (I was cautious because there could have been a reason for this, just not tested).In my mind, it mostly depends on which type context is useful more frequently. I remember having frequent troubles with "before-after" context (as that is what Telescope did) as usually for me what …