Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicates path entries on Windows #1683

Closed
kishikaisei opened this issue Jan 12, 2022 · 1 comment · May be fixed by #3103
Closed

Duplicates path entries on Windows #1683

kishikaisei opened this issue Jan 12, 2022 · 1 comment · May be fixed by #3103
Labels
bug Something isn't working

Comments

@kishikaisei
Copy link

kishikaisei commented Jan 12, 2022

Description

There is duplication of entries when we are talking of paths, as seen in the screenshot below:
image

Neovim version

NVIM v0.7.0-dev+793-g991e872d8
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Operating system and version

Windows 11

checkhealth telescope

telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - OK: nvim-treesitter installed.

## Checking external dependencies
  - OK: rg: found ripgrep 13.0.0 (rev af6b6c543b)
  - OK: fd: found fd 8.3.0

## ===== Installed extensions =====

## Telescope Extension: `projects`
  - INFO: No healthcheck provided

Steps to reproduce

  1. On windows, open a file a few times.
  2. At some point it will duplicated in old_files, as there will be two path, one containing \ the other having \\.

Expected behavior

No duplication of paths, every folder/file have a single entry

Actual behavior

Files and folders are sometimes duplicated due to having single or double forward slashes (as per screenshot in description)

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'nvim-telescope/telescope.nvim',
        requires = {
          'nvim-lua/plenary.nvim',
          { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' },
        },
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('telescope').setup()
  require('telescope').load_extension('fzf')
  -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing Telescope and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
@Conni2461
Copy link
Member

Conni2461 commented Apr 9, 2022

We only display what vim.v.oldfiles returns. The root problem of this was just fixed in plenary. that paths sometimes weren't normalized correctly (fixed in nvim-lua/plenary.nvim@c54f77d). That means that oldfiles thinks C:\Users\asdf\Desktop\notes.norg and C:\Users\asdf\\Desktop\notes.norg are different files because of that \\.

I would close this because we just fixed it (at least on linux) i can't verify windows. So if you see this problem again, feel free to open a bug report over at plenary (because it has not really anything to do with duplicated path entries) :)

Note that oldfiles might still contain broken paths from before updating your plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants