Skip to content

[mini.pick] Is it possible to get the file name at the start? #1082

Closed Answered by echasnovski
lsig asked this question in Q&A
Discussion options

You must be logged in to vote

This should be possible by overriding source.show() for picker you want this behavior (presumably, builtin.files).
However, I think it will be a tough challenge to do while preserving all features of default_show(). Primarily, adding icons and current/match/marked highlighting.

As I think showing matched characters is really important and having file name first makes it at least very complex, I don't think this will be made built-in or showed here in full capability. Here is an example of how the backbone can look like:

local show_filename_first = function(buf_id, item_arr, query)
  local lines = {}
  for i, item in ipairs(item_arr) do
    local directory, basename = vim.fs.dirname(item), v…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lsig
Comment options

Answer selected by echasnovski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants