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

Folders with [] throw an error #307

Open
abdullahahmeda opened this issue Sep 4, 2023 · 7 comments
Open

Folders with [] throw an error #307

abdullahahmeda opened this issue Sep 4, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@abdullahahmeda
Copy link

Description

I have the following structure:

[centerId]\
index.tsx

When I access [centerId]\ An error is thrown:
image

Neovim version

NVIM v0.10.0-dev-915+g898ef1835
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3

Operating system and version

Windows 11

Steps to reproduce

  1. Create a folder named [centerId] for example
  2. Navigate to it by pressing Enter (or <CR>)
  3. An error should be thrown

Expected behavior

Folder should open normally

Actual behavior

An error is thrown. You can see an image of the error above

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-file-browser.nvim',
        },
      },
      -- 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('file_browser')
  -- 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()]]
@abdullahahmeda abdullahahmeda added the bug Something isn't working label Sep 4, 2023
@jamestrew
Copy link
Collaborator

hmm... I can't replicate this on linux.
can you try using :set shellslash?

@abdullahahmeda
Copy link
Author

:set shellslash didn't help

I will check plenary. It seems like this error is related to it

@abdullahahmeda
Copy link
Author

This is very interesting. I just stopped all the plugins I use and commented all the lines in my init.lua (I'm using nvim btw). And netrw just hides everything inside [centerId] (and I'm not alone).

So I think this issue is more related to nvim now. I would appreciate any help. But thank you anyways

@jamestrew
Copy link
Collaborator

Yeah this type of issue is a known issue on Windows.

nvim-telescope/telescope.nvim#2651
neovim/neovim#24542 -- neovim core - but there is no "fix" for ().
nvim-telescope/telescope.nvim#2446 (comment)

The last linked comment is precisely the same issue you're experiencing I believe. It seems to be related to a powershell behavior.

We can probably escape the brackets on the telescope/plenary side of this but it's a fairly sensitive topic (os specific path manipulation) especially when no one maintaining telescope/plenary is on windows.

I'm sorry but probably the quickest way to fix this for yourself might be to move to WSL 😬

@abdullahahmeda
Copy link
Author

I think I'll move to linux again. Thank you for your support!

@jamestrew
Copy link
Collaborator

This might (at least be partially) improved by nvim-telescope/telescope.nvim#2628

@abdullahahmeda
Copy link
Author

I have switched to linux long time ago. Thank you anyway!

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

2 participants