feat: Support Line Column in file pickers

Original issue: When selecting files in telescope iti is impossible to
enter paths from compiler that includes cursor locations, you need to clear it from the path.

This commit fixes the problem by stripping out the location from path
(important: only for file pickes) and using this location to set the
cursor when openning the file and highlight the line or poisition in the
previewer.

This feature requires a new option for a picker, whichi for now is basically
enabling location stripping but it is helpful for any file picker
builtin or external one.

By default equals `false` becuase most of pickers like live grep,
current buffer fuzy are messed up with locations stripping. It is only
useful for file searches.

Added test suite that covers alghoritm of stripping the location to the
`utils_spec.lua`
This commit is contained in:
Dmitriy Kovalenko
2023-11-18 18:46:16 +01:00
parent 18774ec792
commit 0dfe9e1edf
6 changed files with 142 additions and 2 deletions
+1
View File
@@ -384,6 +384,7 @@ files.find_files = function(opts)
pickers
.new(opts, {
prompt_title = "Find Files",
files_picker = true,
finder = finders.new_oneshot_job(find_command, opts),
previewer = conf.file_previewer(opts),
sorter = conf.file_sorter(opts),