telescope.nvim icon indicating copy to clipboard operation
telescope.nvim copied to clipboard

fix(oldfiles) : delete duplicated items in Windows

Open Jaehaks opened this issue 1 year ago • 1 comments

Description

  1. 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

  1. 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?

  1. Taking gsub('/', '\') all files from neovim lua api.

  2. Add additional condition which checks whether the file is listed in results (='results_other')

  3. separate results variable 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)

Jaehaks avatar May 15 '24 11:05 Jaehaks

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

Conni2461 avatar May 27 '24 21:05 Conni2461

Closed in favor of https://github.com/nvim-telescope/telescope.nvim/pull/3260

jamestrew avatar Sep 22 '24 03:09 jamestrew