feat: Add status, better debug, and some associated refactors

* [WIP]: Mon 28 Sep 2020 01:08:24 PM EDT

* add much much better tracking. so much less hax

* status updates, oneshot job updates, etc.

* remove temp function

* add status function

* asdfasdfasdf
This commit is contained in:
TJ DeVries
2020-09-29 22:52:38 -04:00
committed by GitHub
parent 2ce23696de
commit ae7fd0d27a
22 changed files with 981 additions and 439 deletions

View File

@@ -12,6 +12,8 @@ local function first_non_null(...)
end
end
local actions = require('telescope.actions')
-- TODO: Add other major configuration points here.
-- selection_strategy
@@ -42,6 +44,8 @@ function config.set_defaults(defaults)
set("border", {})
set("borderchars", { '', '', '', '', '', '', '', ''})
set("get_status_text", function(self) return string.format("%s / %s", self.stats.processed - self.stats.filtered, self.stats.processed) end)
-- Builtin configuration
-- List that will be executed.
@@ -51,6 +55,50 @@ function config.set_defaults(defaults)
-- TODO: Shortenpath
-- Decide how to propagate that to all the opts everywhere.
-- TODO: Add motions to keybindings
-- TODO: Add relative line numbers?
set("default_mappings", {
i = {
["<C-n>"] = actions.move_selection_next,
["<C-p>"] = actions.move_selection_previous,
["<C-c>"] = actions.close,
["<Down>"] = actions.move_selection_next,
["<Up>"] = actions.move_selection_previous,
["<CR>"] = actions.goto_file_selection_edit,
["<C-x>"] = actions.goto_file_selection_split,
["<C-v>"] = actions.goto_file_selection_vsplit,
["<C-t>"] = actions.goto_file_selection_tabedit,
["<C-u>"] = actions.preview_scrolling_up,
["<C-d>"] = actions.preview_scrolling_down,
-- TODO: When we implement multi-select, you can turn this back on :)
-- ["<Tab>"] = actions.add_selection,
},
n = {
["<esc>"] = actions.close,
["<CR>"] = actions.goto_file_selection_edit,
["<C-x>"] = actions.goto_file_selection_split,
["<C-v>"] = actions.goto_file_selection_vsplit,
["<C-t>"] = actions.goto_file_selection_tabedit,
-- TODO: This would be weird if we switch the ordering.
["j"] = actions.move_selection_next,
["k"] = actions.move_selection_previous,
["<Down>"] = actions.move_selection_next,
["<Up>"] = actions.move_selection_previous,
["<C-u>"] = actions.preview_scrolling_up,
["<C-d>"] = actions.preview_scrolling_down,
},
})
-- NOT STABLE. DO NOT USE
set("horizontal_config", {
get_preview_width = function(columns, _)