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

Error "Reverse range in character class" #1584

Closed
Perry3D opened this issue Dec 10, 2021 · 5 comments
Closed

Error "Reverse range in character class" #1584

Perry3D opened this issue Dec 10, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@Perry3D
Copy link

Perry3D commented Dec 10, 2021

Description

Hi

when i use :Telescope find_files and search for a character followed by a "-" character i get the following error message:

Error executing vim.schedule lua callback: Vim:E944: Reverse range in character class
stack traceback:
	[C]: in function 'expand'
	...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:166: in function 'buffer_previewer_maker'
	...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:423: in function 'define_preview'
	...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:387: in function 'preview'
	...ck\packer\start\telescope.nvim/lua/telescope/pickers.lua:994: in function 'refresh_previewer'
	...ck\packer\start\telescope.nvim/lua/telescope/pickers.lua:979: in function 'set_selection'
	...ck\packer\start\telescope.nvim/lua/telescope/pickers.lua:1284: in function '_do_selection'
	...ck\packer\start\telescope.nvim/lua/telescope/pickers.lua:1246: in function 'cb'
	vim.lua:285: in function <vim.lua:285>

It somehow depends on the current pwd. When I start neovim inside the nvim configuration directory everything works fine. But if the current pwd is my c++ project I get this error.

Tried it with the minimal config and my own config.

Neovim version

NVIM v0.6.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Übersetzt von runneradmin@fv-az152-703

Features: -acl +iconv +tui
See ":help feature-compile"

          System-vimrc-Datei: "$VIM\sysinit.vim"
     Voreinstellung für $VIM: "C:/Program Files/nvim/share/nvim"

Run :checkhealth for more info

Operating system and version

Windows 10

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)
  - WARNING: fd: not found. Install [sharkdp/fd](https://github.com/sharkdp/fd) for extended capabilities

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

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

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

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

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

Steps to reproduce

  1. Telescope find_files
  2. Search for "a-"

Expected behavior

No error message

Actual behavior

Getting an error message

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()]]
@Perry3D Perry3D added the bug Something isn't working label Dec 10, 2021
@Conni2461
Copy link
Member

Can you try #1586 ?

@Perry3D
Copy link
Author

Perry3D commented Dec 10, 2021

Tried commit 96e299d and i still get the error.

As an additional hint: I can only reproduce it when opening directories with a huge amount of files. In my case around 80k files.

@Conni2461
Copy link
Member

Is this still happening?

I tried to reproduce this issue but only works with huge amount of files, says kinda nothing. I can trigger this error "Reverse range in character class" with the following setup.

i setup this folder_name="[u-a]" && mkdir -p "$folder_name" && touch "$folder_name/dummy"
and then open neovim and run :lua print(vim.fn.expand("[u-a]")) but it doesn't happen with telescope because we escape before passing into vim.fn.expand like this :lua print(vim.fn.expand(vim.fn.fnameescape("[u-a]")))

Can you at least tell me the full file path that is currently selected when the error is thrown?

@Conni2461
Copy link
Member

Closing as stale

@Conni2461 Conni2461 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2022
@all-yall
Copy link

all-yall commented Oct 21, 2022

I encounter the error with the setup described

Error executing vim.schedule lua callback: Vim:E944: Reverse range in character class
stack traceback:
        [C]: in function 'expand'
        ...k/paqs/start/telescope.nvim/lua/telescope/from_entry.lua:33: in function 'path'
        ...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:428: in function 'define_preview'
        ...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:388: in function 'preview'
        ...pack/paqs/start/telescope.nvim/lua/telescope/pickers.lua:1075: in function 'refresh_previewer'
        ...pack/paqs/start/telescope.nvim/lua/telescope/pickers.lua:1028: in function 'set_selection'
        ...pack/paqs/start/telescope.nvim/lua/telescope/pickers.lua:1360: in function '_do_selection'
        ...pack/paqs/start/telescope.nvim/lua/telescope/pickers.lua:1322: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

as far as I can tell, the function fnameescape isn't being used at the location of the crash, lua/telescope/from_entry.lua:33
probably because this code is newer than the earlier conversation.

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.

3 participants