fix(oldfiles) : delete duplicated items in Windows
Description
- Duplicated items are listed in oldfiles because of neovim problem. Example is like below.
c:\Users\USERS\test\telescope.lua
c:\Users\USERS/test/telescope.lua
c:/Users/USERS/test/telescope.lua
slash(/) makes neovim lua api cannot work properly in windows. and string comparison don't distinguish it is the same path
This makes file ~= current_file condition cannot filter although it is same with the file
- oldfiles show current session files in the list also.
Fixes #1683
Type of change
Please delete options that are not relevant.
- Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
-
Taking gsub('/', '\') all files from neovim lua api.
-
Add additional condition which checks whether the file is listed in results (='results_other')
-
separate
resultsvariable to 2 parts. First, 'results' as current session file list Second, 'results_other' as old file list which are filtered unnecessary file
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list relevant details about your configuration
There is nothing for the user to configure.
- [x] At startup which has no opened buffer
- [x] Some buffers are opened
- [x] Load from saved session.
Configuration:
- Neovim version (nvim --version): v0.9.5 and nvim-qt v0.2.17
- Operating system and version: Windows 10
Checklist:
- [ ] My code follows the style guidelines of this project (stylua)
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation (lua annotations)
technically yes, seems like an easy fix, we can include this. but can you reduce the comments by like 95% we only have to mention it once why we do gsub('/','\\').
and the formatting doesnt align with our style, this needs to be addressed as well
Closed in favor of https://github.com/nvim-telescope/telescope.nvim/pull/3260