From 8783bea06e1e0dfa8dfd4834058923088471d832 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Mon, 11 Jan 2021 13:29:37 -0500 Subject: feat: quickfix (#293) * feat: quickfix (not implemented) * [WIP]: Wed 09 Dec 2020 11:11:30 PM EST * somewhat working linked list impl * getting closer * might be working * might be working for real * works and implemented basic example * dont forget to close prompt * fix descending and add more tests * test fixes * fix test * more logging * Fix some more tests * Fix logging messing up tests * fix: lint * fix: multi select stuffs --- lua/telescope/pickers/_test_helpers.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lua/telescope/pickers/_test_helpers.lua') diff --git a/lua/telescope/pickers/_test_helpers.lua b/lua/telescope/pickers/_test_helpers.lua index a430fae..63d1a0f 100644 --- a/lua/telescope/pickers/_test_helpers.lua +++ b/lua/telescope/pickers/_test_helpers.lua @@ -22,9 +22,15 @@ test_helpers.get_results = function() return vim.api.nvim_buf_get_lines(test_helpers.get_results_bufnr(), 0, -1, false) end -test_helpers.get_last_result = function() +test_helpers.get_best_result = function() local results = test_helpers.get_results() - return results[#results] + local picker = test_helpers.get_picker () + + if picker.sorting_strategy == 'ascending' then + return results[1] + else + return results[#results] + end end test_helpers.get_selection = function() @@ -41,7 +47,7 @@ test_helpers.make_globals = function() GetPrompt = test_helpers.get_prompt -- luacheck: globals GetPrompt GetResults = test_helpers.get_results -- luacheck: globals GetResults - GetLastResult = test_helpers.get_last_result -- luacheck: globals GetLastResult + GetBestResult = test_helpers.get_best_result -- luacheck: globals GetBestResult GetSelection = test_helpers.get_selection -- luacheck: globals GetSelection GetSelectionValue = test_helpers.get_selection_value -- luacheck: globals GetSelectionValue -- cgit v1.2.3