diff options
author | Daniil Rozanov <daniilrozzanov@gmail.com> | 2024-04-24 03:34:52 +0300 |
---|---|---|
committer | Daniil Rozanov <daniilrozzanov@gmail.com> | 2024-04-24 03:34:52 +0300 |
commit | f9b36bf730fda5488be87b91fd03a6f7cbf64e73 (patch) | |
tree | d8a7da573111d40c0e51c9e9954a3bb1977dd39c /lua/cmake-explorer/telescope/test.lua | |
parent | 672f0d32e322b79661b5d7959887adaa9e41ad98 (diff) |
refactor: full rewrite
Diffstat (limited to 'lua/cmake-explorer/telescope/test.lua')
-rw-r--r-- | lua/cmake-explorer/telescope/test.lua | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/lua/cmake-explorer/telescope/test.lua b/lua/cmake-explorer/telescope/test.lua deleted file mode 100644 index 7b8bb00..0000000 --- a/lua/cmake-explorer/telescope/test.lua +++ /dev/null @@ -1,46 +0,0 @@ -local pickers = require("telescope.pickers") -local finders = require("telescope.finders") -local conf = require("telescope.config").values -local actions = require("telescope.actions") -local action_state = require("telescope.actions.state") - --- our picker function: colors -local colors = function(opts) - opts = opts or {} - pickers - .new(opts, { - prompt_title = "colors", - finder = finders.new_table({ - results = { - { "red", "#ff0000" }, - { "green", "#00ff00" }, - { "blue", "#0000ff" }, - }, - entry_maker = function(entry) - return { - value = entry, - display = entry[1], - ordinal = entry[1], - } - end, - }), - sorter = conf.generic_sorter(opts), - attach_mappings = function(prompt_bufnr, map) - map({ "i", "n" }, "<C-r>", function(_prompt_bufnr) - print("You typed <C-r>") - end) - - actions.select_default:replace(function() - actions.close(prompt_bufnr) - local selection = action_state.get_selected_entry() - -- print(vim.inspect(selection)) - vim.api.nvim_put({ selection[1] }, "", false, true) - end) - return true - end, - }) - :find() -end - --- to execute the function -colors() |