diff options
| author | TJ DeVries <devries.timothyj@gmail.com> | 2021-04-16 11:11:40 -0400 |
|---|---|---|
| committer | TJ DeVries <devries.timothyj@gmail.com> | 2021-04-16 11:11:40 -0400 |
| commit | d27907b0dac658dfa2fb7e63103675d1832f33e0 (patch) | |
| tree | 5189199271e8ec4bf7bf8ab7109bfc0ff5fe861f /lua | |
| parent | f2c3f724ad8c05f7001eb0f091ed210f02a62ca2 (diff) | |
fix: Default to an empty sorter, so we always have one
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/pickers.lua | 2 | ||||
| -rw-r--r-- | lua/telescope/sorters.lua | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua index 00e1049..3a5baf7 100644 --- a/lua/telescope/pickers.lua +++ b/lua/telescope/pickers.lua @@ -73,7 +73,7 @@ function Picker:new(opts) _on_input_filter_cb = opts.on_input_filter_cb or function() end, finder = opts.finder, - sorter = opts.sorter, + sorter = opts.sorter or require('telescope.sorters').empty(), previewer = opts.previewer, default_selection_index = opts.default_selection_index, diff --git a/lua/telescope/sorters.lua b/lua/telescope/sorters.lua index bf4a735..46a6cc8 100644 --- a/lua/telescope/sorters.lua +++ b/lua/telescope/sorters.lua @@ -465,6 +465,12 @@ sorters.highlighter_only = function(opts) } end +sorters.empty = function() + return Sorter:new { + scoring_function = function() return 0 end, + } +end + -- Bad & Dumb Sorter sorters.get_levenshtein_sorter = function() return Sorter:new { |
