Просмотр исходного кода

feat(telecope): set show_untracked by default (#2984)

* feat: optionally show untracked files with find_project_files

* feat(telecope): set show_untracked by default

Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
Philipp Schmitt 2 лет назад
Родитель
Сommit
03ec31253f
2 измененных файлов с 7 добавлено и 3 удалено
  1. 3 0
      lua/lvim/core/telescope.lua
  2. 4 3
      lua/lvim/core/telescope/custom-finders.lua

+ 3 - 0
lua/lvim/core/telescope.lua

@@ -79,6 +79,9 @@ function M.config()
         --@usage don't include the filename in the search results
         only_sort_text = true,
       },
+      git_files = {
+        show_untracked = true,
+      },
     },
     extensions = {
       fzf = {

+ 4 - 3
lua/lvim/core/telescope/custom-finders.lua

@@ -88,11 +88,12 @@ end
 
 -- Smartly opens either git_files or find_files, depending on whether the working directory is
 -- contained in a Git repo.
-function M.find_project_files()
-  local ok = pcall(builtin.git_files)
+function M.find_project_files(opts)
+  opts = opts or {}
+  local ok = pcall(builtin.git_files, opts)
 
   if not ok then
-    builtin.find_files()
+    builtin.find_files(opts)
   end
 end