feat: Support Line Column in file pickers (#2791)

This implements a experimental interface for allowing prompts like this `file.txt:3:4`. It is already enabled on default for `find_files` and `git_files`.

Be wary of breaking changes for the interface if you plan to manually enable it.
This commit is contained in:
Dmitriy Kovalenko
2024-01-09 09:35:26 +01:00
committed by GitHub
parent 87e92ea31b
commit 0bf09d05ab
6 changed files with 117 additions and 6 deletions

View File

@@ -384,8 +384,9 @@ files.find_files = function(opts)
pickers
.new(opts, {
prompt_title = "Find Files",
__locations_input = true,
finder = finders.new_oneshot_job(find_command, opts),
previewer = conf.file_previewer(opts),
previewer = conf.grep_previewer(opts),
sorter = conf.file_sorter(opts),
})
:find()

View File

@@ -46,6 +46,7 @@ git.files = function(opts)
pickers
.new(opts, {
prompt_title = "Git Files",
__locations_input = true,
finder = finders.new_oneshot_job(
vim.tbl_flatten {
opts.git_command,
@@ -54,7 +55,7 @@ git.files = function(opts)
},
opts
),
previewer = conf.file_previewer(opts),
previewer = conf.grep_previewer(opts),
sorter = conf.file_sorter(opts),
})
:find()