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

oldfiles picker : when i select a file out of cwd, the root dir is %home% #2969

Open
Jaehaks opened this issue Mar 2, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Jaehaks
Copy link

Jaehaks commented Mar 2, 2024

Description

I cannot find any case like me

i use default configuration about oldfiles picker.
my nvim configuration path is C:/Users/User/.config/nvim.
and %home% environment variable is C:/spb_data

if i call oldfiles picker in c:/Users/User, and pick a configuration file is opened well.
if i call oldfiles picker in c:/Users/User/.config/nvim/plugin/lsp and select the oldfile test.lua in parent directory of it like /plugins,
empty file open has %home%/.config/nvim/plugin/test.lua
although the absolute path of test.lua is shown with c:/Users/User/.config/nvim/plugin/test.lua

Does not oldfile picker open parent file?

additionally, sometimes duplicated oldfiles are listed in picker like
c:\Users\User.config/nvim/init.lua
c:\Users\User.config\nvim\init.lua

is this bug?

Neovim version

nvim-qt 0.2.18

Operating system and version

windows 10

Telescope version / branch / rev

recently

checkhealth telescope

ok all

Steps to reproduce

  1. open oldfiles picker
  2. select parent dir file

Expected behavior

No response

Actual behavior

open empty file

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()]]
@Jaehaks Jaehaks added the bug Something isn't working label Mar 2, 2024
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

No branches or pull requests

1 participant