summaryrefslogtreecommitdiff
path: root/lua/telescope/builtin/files.lua
diff options
context:
space:
mode:
authorFabian David Schmidt <fabian.david.schmidt@gmail.com>2021-08-13 17:32:01 +0200
committerSimon Hauser <Simon-Hauser@outlook.de>2022-07-01 18:13:25 +0200
commitef9137d85c935b83ec513db23214c7d9a0bd2b45 (patch)
treec9e7ed6905ef0663299ff834977b25e5a172212d /lua/telescope/builtin/files.lua
parenta0a038170dbb5e4b69a50f648a8cf5cae6a910a3 (diff)
feat: refine with new_table
Diffstat (limited to 'lua/telescope/builtin/files.lua')
-rw-r--r--lua/telescope/builtin/files.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/lua/telescope/builtin/files.lua b/lua/telescope/builtin/files.lua
index 599dc55..94639f6 100644
--- a/lua/telescope/builtin/files.lua
+++ b/lua/telescope/builtin/files.lua
@@ -111,6 +111,16 @@ files.live_grep = function(opts)
-- TODO: It would be cool to use `--json` output for this
-- and then we could get the highlight positions directly.
sorter = sorters.highlighter_only(opts),
+ attach_mappings = function(_, map)
+ map("i", "<c-space>", function(prompt_bufnr)
+ local line = action_state.get_current_line()
+ require("telescope.actions.generate").refine(prompt_bufnr, {
+ prompt_title = "Find Word (" .. line .. ")",
+ sorter = conf.generic_sorter(opts),
+ })
+ end)
+ return true
+ end,
}):find()
end