@@ -1699,8 +1699,8 @@ MiniPick.get_picker_query = function() return vim.deepcopy((H.pickers.active or
16991699--- @see also |MiniPick.get_picker_items ()| and |MiniPick.get_picker_stritems ()|
17001700MiniPick .set_picker_items = function (items , opts )
17011701 if not H .islist (items ) then H .error (' `items` should be an array.' ) end
1702- if not MiniPick .is_picker_active () then return end
17031702 opts = vim .tbl_deep_extend (' force' , { do_match = true , querytick = nil }, opts or {})
1703+ if not MiniPick .is_picker_active () then return end
17041704
17051705 -- Set items in async because computing lower `stritems` can block much time
17061706 coroutine.wrap (H .picker_set_items )(H .pickers .active , items , opts )
@@ -1728,11 +1728,11 @@ end
17281728---
17291729--- @see also |MiniPick.get_picker_items ()| and |MiniPick.get_picker_stritems ()|
17301730MiniPick .set_picker_items_from_cli = function (command , opts )
1731- if not MiniPick .is_picker_active () then return end
17321731 local is_valid_command = H .is_array_of (command , ' string' ) and # command >= 1
17331732 if not is_valid_command then H .error (' `command` should be an array of strings.' ) end
17341733 local default_opts = { postprocess = H .cli_postprocess , set_items_opts = {}, spawn_opts = {} }
17351734 opts = vim .tbl_deep_extend (' force' , default_opts , opts or {})
1735+ if not MiniPick .is_picker_active () then return end
17361736
17371737 local executable , args = command [1 ], vim .list_slice (command , 2 , # command )
17381738 local process , pid , stdout = nil , nil , vim .loop .new_pipe ()
@@ -1779,10 +1779,11 @@ end
17791779---
17801780--- @see also |MiniPick.get_picker_matches ()|
17811781MiniPick .set_picker_match_inds = function (match_inds , match_type )
1782- if not MiniPick .is_picker_active () then return end
17831782 if not H .is_array_of (match_inds , ' number' ) then H .error (' `match_inds` should be an array of numbers.' ) end
17841783 local set = H .picker_set_inds [match_type or ' all' ]
17851784 if set == nil then H .error (' `match_type` should be one of "all", "marked", "current"' ) end
1785+ if not MiniPick .is_picker_active () then return end
1786+
17861787 set (H .pickers .active , match_inds )
17871788 H .picker_update (H .pickers .active , false )
17881789end
@@ -1807,8 +1808,8 @@ end
18071808---
18081809--- @see also |MiniPick.get_picker_state ()|
18091810MiniPick .set_picker_target_window = function (win_id )
1810- if not MiniPick .is_picker_active () then return end
18111811 if not H .is_valid_win (win_id ) then H .error (' `win_id` is not a valid window identifier.' ) end
1812+ if not MiniPick .is_picker_active () then return end
18121813 H .pickers .active .windows .target = win_id
18131814end
18141815
@@ -1818,8 +1819,8 @@ end
18181819---
18191820--- @see also |MiniPick.get_picker_query ()|
18201821MiniPick .set_picker_query = function (query )
1821- if not MiniPick .is_picker_active () then return end
18221822 if not H .is_array_of (query , ' string' ) then H .error (' `query` should be an array of strings.' ) end
1823+ if not MiniPick .is_picker_active () then return end
18231824
18241825 H .pickers .active .query , H .pickers .active .caret = vim .deepcopy (query ), # query + 1
18251826 H .querytick = H .querytick + 1
0 commit comments