chore: cleanup file lnum col

This commit is contained in:
Simon Hauser
2023-11-23 19:22:03 +01:00
parent 0dfe9e1edf
commit 64fc6c58f9
4 changed files with 34 additions and 30 deletions
+12
View File
@@ -1,3 +1,4 @@
local state = require "telescope.state"
local action_state = require "telescope.actions.state"
local action_set = require "telescope.actions.set"
local actions = require "telescope.actions"
@@ -385,6 +386,17 @@ files.find_files = function(opts)
.new(opts, {
prompt_title = "Find Files",
files_picker = true,
on_input_filter_cb = function(prompt, picker)
local filename, lnum, col = utils.separate_file_path_location(prompt)
if lnum or col then
picker:set_local_key("prompt_location", { row = lnum, col = col })
elseif state.get_global_key "prompt_location" then
picker:get_local_key("prompt_location", nil)
end
return { prompt = filename }
end,
finder = finders.new_oneshot_job(find_command, opts),
previewer = conf.file_previewer(opts),
sorter = conf.file_sorter(opts),