Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Neovim freezes in large file when only opening bracket is inserted #79

Open
rouge8 opened this issue Nov 26, 2021 · 9 comments
Open

Neovim freezes in large file when only opening bracket is inserted #79

rouge8 opened this issue Nov 26, 2021 · 9 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@rouge8
Copy link

rouge8 commented Nov 26, 2021

Describe the bug

I'm seeing extremely slow performance inserting ([ around line 150 in a ~1600 line file. It takes ~20 seconds for the [ to insert. 😵

Steps to reproduce

  1. Open https://github.com/rouge8/jit.rs/blob/2a3e5dbc7d603f465c1f3083c655613d9a69b87d/tests/merge_test.rs#L147
  2. After line 147, type let tree = BTreeMap::from([
  3. Wait ~20 seconds after typing the [ before it appears.

Expected behavior

Text should insert instantly.

@rouge8 rouge8 changed the title Extremely slow performance Extremely slow performance / freezing Neovim Nov 26, 2021
@p00f
Copy link
Owner

p00f commented Nov 27, 2021

I can't reproduce this:

rust_slow.mp4

@p00f
Copy link
Owner

p00f commented Nov 27, 2021

I even tried downloading the entire project, it inserts instantly

@p00f
Copy link
Owner

p00f commented Nov 27, 2021

(I do have rainbow enabled there, they are all different shades of blue/grey)

@rouge8
Copy link
Author

rouge8 commented Nov 27, 2021

Interesting, it must be an interaction between plugins or something… I’ll try debugging more

@p00f p00f closed this as completed Nov 27, 2021
@rouge8
Copy link
Author

rouge8 commented Nov 27, 2021

I can still reproduce with a minimal set of plugins:

Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate', 'branch': '0.5-compat'}
Plug 'p00f/nvim-ts-rainbow'

What looks different in your recording is that you're autocompleting the ), so you're typing:

let tree = BTreeMap::from()

and then inserting the [. Admittedly that still is slow for me...

@rouge8
Copy link
Author

rouge8 commented Nov 27, 2021

And this is my Treesitter config:

lua <<EOF
require'nvim-treesitter.configs'.setup {
  ensure_installed = "maintained",
  ignore_install = {},
  highlight = {
    enable = true,
    disable = {"rst"},
    additional_vim_regex_highlighting = false,
  },
  rainbow = {
    enable = true,
    extended_mode = true,
    max_file_lines = nil,
  },
  matchup = {
    enable = true,
  },
}
EOF

@p00f p00f reopened this Nov 27, 2021
@p00f
Copy link
Owner

p00f commented Nov 27, 2021

I can reproduce this when I disable https://github.com/jiangmiao/auto-pairs

@p00f p00f added the bug Something isn't working label Nov 27, 2021
@p00f
Copy link
Owner

p00f commented Nov 27, 2021

fwiw you can get around this without an autopair plugin by inserting the closing bracket first, and if you want to delete the brackets then delete the opening one first

@p00f p00f changed the title Extremely slow performance / freezing Neovim Neovim freezes in large file when only opening bracket is inserted Nov 27, 2021
@p00f
Copy link
Owner

p00f commented Nov 30, 2021

This might be related to steelsojka/pears.nvim#11 (comment)

@p00f p00f pinned this issue Jan 23, 2022
@p00f p00f added the help wanted Extra attention is needed label Jan 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants