mirror of
https://github.com/soywod/himalaya.git
synced 2024-11-25 20:40:24 +00:00
improve mbox telescope picker sorter
This commit is contained in:
parent
17df485e19
commit
f1e339d720
2 changed files with 8 additions and 3 deletions
|
@ -44,13 +44,18 @@ function! s:native_picker(mboxes)
|
|||
call himalaya#mbox#post_input(a:mboxes[choice])
|
||||
endfunction
|
||||
|
||||
let s:pickers = {"telescope": function("s:telescope_picker"), "fzf": function("s:fzf_picker"), "native": function("s:native_picker")}
|
||||
let s:pickers = {
|
||||
\"telescope": function("s:telescope_picker"),
|
||||
\"fzf": function("s:fzf_picker"),
|
||||
\"native": function("s:native_picker"),
|
||||
\}
|
||||
|
||||
function! himalaya#mbox#input()
|
||||
try
|
||||
let mboxes = map(s:cli("mailboxes", [], "Fetching mailboxes", 0), "v:val.name")
|
||||
|
||||
if exists("g:himalaya_mailbox_picker") " Get user choice for picker, otherwise check runtimepath
|
||||
" Get user choice for picker, otherwise check runtimepath
|
||||
if exists("g:himalaya_mailbox_picker")
|
||||
let mbox_picker = g:himalaya_mailbox_picker
|
||||
else
|
||||
if &rtp =~ "telescope"
|
||||
|
|
|
@ -40,7 +40,7 @@ M.mbox_picker = function(mboxes)
|
|||
pickers.new {
|
||||
results_title = 'Mailboxes',
|
||||
finder = finders.new_table(finder_opts),
|
||||
sorter = sorters.fuzzy_with_index_bias(),
|
||||
sorter = sorters.get_generic_fuzzy_sorter(),
|
||||
attach_mappings = function(prompt_bufnr)
|
||||
actions.select_default:replace(function()
|
||||
local selection = action_state.get_selected_entry()
|
||||
|
|
Loading…
Reference in a new issue