Skip to content

Regular regex issues with matchit #11

@snoblenet

Description

@snoblenet

Neovim v0.3.1
Mac OS X 10.14.1

call plug#begin('~/.config/nvim/autoload')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/neco-vim'
Plug 'airblade/vim-gitgutter'
Plug 'autozimu/LanguageClient-neovim', { 'do': 'bash install.sh' }
Plug 'neomake/neomake'
Plug 'blueyed/vim-diminactive'
Plug 'chrisbra/Colorizer'
Plug 'davidosomething/vim-enhanced-resolver', { 'do': 'npm install --global enhanced-resolve-cli' }
Plug 'elzr/vim-json'
Plug 'ervandew/supertab'
Plug 'hail2u/vim-css3-syntax'
Plug 'icymind/NeoSolarized'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim' "Both are required
Plug 'kana/vim-textobj-function'
Plug 'kana/vim-textobj-user'
Plug 'moll/vim-node'
Plug 'mxw/vim-jsx'
Plug 'othree/html5.vim'
Plug 'othree/javascript-libraries-syntax.vim'
Plug 'pangloss/vim-javascript'
Plug 'pearofducks/ansible-vim' " syntax highlighting for YAML files
Plug 'ryanoasis/vim-devicons'
Plug 'scrooloose/nerdtree'
Plug 'simnalamburt/vim-mundo'
Plug 'thinca/vim-textobj-function-javascript'
Plug 'tmux-plugins/vim-tmux' " syntax highlighting to ~/.conf.tmux
Plug 'tmux-plugins/vim-tmux-focus-events'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'yggdroot/indentline'
Plug 'zchee/deoplete-zsh'
Plug 'styled-components/vim-styled-components', { 'branch': 'main' }
call plug#end()

I am regularly getting the error shown below when my cursor is on one parenthesis and I press % to go to the matching parenthesis.

Note that this is despite the fact that the syntax highlighting plugin is correctly highlighting the matching parenthesis as jsFuncBraces.

I've found that the problem only affects one file at a time. But the affected file need not have any linting errors or unmatched braces for the problem to occur.

Quiting and restarting neovim temporarily solves the problem so the problem seems to be with the plugin not the inherit complexity of the file containing the parentheses.

Likewise, once the problem begins, it affects even minimal examples in the affected file, like jumping between braces in const sum = (a + b);.

After a restart, the problem does not appear for a few hours. Then it starts again and stays until I quit and restart again. (Sorry this is the only way I know to reproduce the issue.)

Actual behaviour

image

Expected behaviour

Go to matching parenthesis every time.

Sidebar

Given the Language Server Protocol can return a 'range' (start and end column and row for each function), I'm wondering if this might be better than regex for syntax highlighting and for % and for custom objects like inside function and around function.

Postscript

I hope that I've understood correctly that this issue should be filed on the plugin itself not on Neovim. Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions