You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently it's only allowed to use an integer value for path truncation. It's IMO pretty hard to find a value that works well for small and large picker windows.
Describe the solution you'd like
It would be great to have user defined truncate functions. For example:
formatters= {
file= {
truncate=function(path, picker)
-- normalize go pkg paths and turn-- /home/buz/.gvm/pkgsets/go1.24.0/global/pkg/mod/go.opentelemetry.io/otel/[email protected]/tracer.go-- into go.opentelemetry.io/otel/[email protected]/tracer.gopath=path:match("pkg/mod/(.+@.+)$") orpath-- use 80% of the available window widthlocalwidth=math.max(vim.api.nvim_win_get_width(picker.list.win.win) *0.8, 40)
returnSnacks.picker.util.truncpath(path, width, { cwd=picker:cwd() })
end,
},
},
Describe alternatives you've considered
Allowing a percentage value like truncate = 0.8 would be an improvement as well
Additional context
No response
The text was updated successfully, but these errors were encountered:
Did you check the docs?
Is your feature request related to a problem? Please describe.
Currently it's only allowed to use an integer value for path truncation. It's IMO pretty hard to find a value that works well for small and large picker windows.
Describe the solution you'd like
It would be great to have user defined truncate functions. For example:
Describe alternatives you've considered
Allowing a percentage value like
truncate = 0.8
would be an improvement as wellAdditional context
No response
The text was updated successfully, but these errors were encountered: