Closed beauwilliams closed 3 years ago
references #48
I've just fixed a bug, so that when the untracked files returns an empty list, we fallback and return just tracked files.
I think this is ready to merge now. @camspiers
FYI, example if wondering what I mean --> I think this is going to be great with the new mappings api. One can have try => gitfiles else files and not ever worry about files not being searchable.
This is for later to work on. I have a preference that when you are in a git repo, you can be in any folder within the repo, but when we get the list from git.files, we get all files in the repo.
I have it working with this line return general(request, {args = {"ls-tree", "-r", "--full-tree", "--name-only", "HEAD"}})
But it leads to a lot of file not found errors because the pwd is not the root of the git repo so the previewer (bat/cat etc) gets upset.
The PR is ready to commit, but perhaps we can add this feature in the future too!
Concatenating the general
producers like that doesn't look right to me. Are you sure this is working?
I think it is working just in virtue of invoking two producers. But the concatenation is just converting things the strings.
I did test it and it's working for me. I can pull latest changes when I get home and give it another shot just to make sure.
I must admit I wrote this in Lua first and it was slightly more clear, then went and did it with fennel but the Lua I got back after make confuses me like it looks like it shouldn't work but it did still work. I'll double check
I've just fixed the return statement nesting @camspiers sorry about that misplaced a parenthesis in the file.fnl
fixed in 2da8617c4a292fefa9d60320ed3667c4cbd0780c
This PR adds untracked files to the git.files producer output, to mimic the behaviour of many other git files finders which by default make untracked files searchable e.g telescope.nvim