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

file/old source causes an error with files that have filenames like an invalid regexp #629

Closed
delphinus opened this issue May 1, 2019 · 0 comments

Comments

@delphinus
Copy link
Contributor

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

:Denite file/old fails after editing a file that has an invalid regexp-like filename.

It seems this filter() command evaluates filenames such as [b-a], it is like an invalid regexp, and it causes an error.

Expected

:Denite file/old is successful with such files.

Environment Information (Required!)

  • denite version (SHA1): latest ae432f2

  • OS: macOS Mojave 10.14.4

  • Vim/neovim version: NeoVim v0.4.0-dev HEAD-773bdd4

  • :checkhealth or :CheckHealth result(neovim only):

:checkhealth result
health#nvim#check
========================================================================
## Configuration
  - ERROR: Locale does not support UTF-8. Unicode characters may not display correctly.
    $LANG=C $LC_ALL= $LC_CTYPE=
    - ADVICE:
      - If using tmux, try the -u option.
      - Ensure that your terminal/shell/tmux/etc inherits the environment, or set $LANG explicitly.
      - Configure your system locale.

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  - INFO: key_dc (kdch1) terminfo entry: key_dc=¥E[3~
  - INFO: $TERM_PROGRAM='iTerm.app'
  - INFO: $COLORTERM='truecolor'

## tmux
  - OK: escape-time: 0ms
  - INFO: $TERM: xterm-256color
  - ERROR: $TERM should be "screen-256color" or "tmux-256color" in tmux. Colors might look wrong.
    - ADVICE:
      - Set default-terminal in ~/.tmux.conf:
          set-option -g default-terminal "screen-256color"
      - https://github.com/neovim/neovim/wiki/FAQ

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: pbcopy

## Python 2 provider (optional)
  - INFO: `g:python_host_prog` is not set.  Searching for python2 in the environment.
  - INFO: Executable: /usr/local/bin/python2
  - INFO: Python version: 2.7.16
  - INFO: pynvim version: 0.2.1 (outdated; from /usr/local/lib/python2.7/site-packages/neovim)
  - WARNING: Latest pynvim is NOT installed: 0.3.2

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/local/bin/python3
  - INFO: Python version: 3.7.3
  - INFO: pynvim version: 0.3.1 (outdated; from ~/Library/Python/3.7/lib/python/site-packages/neovim)
  - WARNING: Latest pynvim is NOT installed: 0.3.2

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.

## Node.js provider (optional)
  - INFO: Node.js: v11.14.0
  - INFO: Neovim node.js host: /usr/local/lib/node_modules/neovim/bin/cli.js
  - WARNING: Package "neovim" is out-of-date. Installed: 4.2.1, latest: 4.5.0
    - ADVICE:
      - Run in shell: npm install -g neovim

health#denite#check
========================================================================
## denite.nvim
  - OK: has("python3") was successful
  - OK: Python3.6.1+ was successful

Provide a minimal init.vim with less than 50 lines (Required!)

set runtimepath-=~/.vim
set runtimepath+=/tmp/test/denite.nvim

How to reproduce problems from neovim startup (Required!)

  1. mkdir and clone repo
mkdir /tmp/test && cd /tmp/test
git clone https://github.com/Shougo/denite.nvim
  1. make vimrc that has a content above.
cat > /tmp/test/vimrc
:UpateRemotePlugins
  1. make an empty file that has a filename: [b-a]
touch '/tmp/test/[b-a]'
  1. open this (odd) file with nvim
LANG=C nvim -N -u /tmp/test/vimrc -i shada '/tmp/test/[b-a]'
  1. restart nvim and run denite
LANG=C nvim -N -u /tmp/test/vimrc -i shada
:Denite file/old
This occurs an error below.
[denite] Traceback (most recent call last):
[denite]   File "/private/tmp/test/denite.nvim/rplugin/python3/denite/rplugin.py", line 25, in start
[denite]     return ui.start(args[0], context)
[denite]   File "/private/tmp/test/denite.nvim/rplugin/python3/denite/ui/default.py", line 81, in start
[denite]     self._start(context['sources_queue'][0], context)
[denite]   File "/private/tmp/test/denite.nvim/rplugin/python3/denite/ui/default.py", line 140, in _start
[denite]     self.gather_candidates()
[denite]   File "/private/tmp/test/denite.nvim/rplugin/python3/denite/ui/default.py", line 686, in gather_candidates
[denite]     self._denite.gather_candidates(self._context)
[denite]   File "/private/tmp/test/denite.nvim/rplugin/python3/denite/parent.py", line 20, in gather_candidates
[denite]     self._put('gather_candidates', [context])
[denite]   File "/private/tmp/test/denite.nvim/rplugin/python3/denite/parent.py", line 53, in _put
[denite]     return self._child.main(name, args, queue_id=None)
[denite]   File "/private/tmp/test/denite.nvim/rplugin/python3/denite/child.py", line 35, in main
[denite]     self.gather_candidates(args[0])
[denite]   File "/private/tmp/test/denite.nvim/rplugin/python3/denite/child.py", line 87, in gather_candidates
[denite]     source.context, source)
[denite]   File "/private/tmp/test/denite.nvim/rplugin/python3/denite/child.py", line 324, in _gather_source_candidates
[denite]     candidates = source.gather_candidates(context)
[denite]   File "/tmp/test/denite.nvim/rplugin/python3/denite/source/file/old.py", line 27, in gather_candidates
[denite]     expand(x) for x in self.vim.call('denite#helper#_get_oldfiles')
[denite]   File "/Users/jinnouchi.yasushi/Library/Python/3.7/lib/python/site-packages/pynvim/api/nvim.py", line 299, in call
[denite]     return self.request('nvim_call_function', name, args, **kwargs)
[denite]   File "/Users/jinnouchi.yasushi/Library/Python/3.7/lib/python/site-packages/pynvim/api/nvim.py", line 182, in request
[denite]     res = self._session.request(name, *args, **kwargs)
[denite]   File "/Users/jinnouchi.yasushi/Library/Python/3.7/lib/python/site-packages/pynvim/msgpack_rpc/session.py", line 102, in request
[denite]     raise self.error_wrapper(err)
[denite] pynvim.api.nvim.NvimError: b'Vim(return):E944: Reverse range in character class'
[denite] Please execute :messages command.

Generate a logfile if appropriate

  1. export NVIM_PYTHON_LOG_FILE=/tmp/log
  2. export NVIM_PYTHON_LOG_LEVEL=DEBUG
  3. nvim -u minimal.vimrc
  4. some works
  5. cat /tmp/log_{PID}

Screenshot (if possible)

Upload the log file

@Shougo Shougo closed this as completed in f16b581 May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant