Coder Social home page Coder Social logo

Comments (6)

andymass avatar andymass commented on June 12, 2024

Because it uses the Treesitter AST, my expectation is matchup#ts_syntax#skip_expr would be very fast. (At least faster than vim syntax highlighting.) Maybe there is something wrong in the way it's computed or cached.

Can you provide a sample C file which has the issue?

from vim-matchup.

zeertzjq avatar zeertzjq commented on June 12, 2024

src/nvim/regexp_nfa.c in Nvim source code.

from vim-matchup.

zeertzjq avatar zeertzjq commented on June 12, 2024

I may have made a mistake when testing this. It seems that when I fully enable matchup treesitter support (matchup = { enable = true }), vim-matchup freezes Nvim every time viewport scrolls by a screen. However, if I disable that (matchup = { enable = false }), vim-matchup only freezes the first time I stop cursor on a curly brace and is fast afterwards. This is probably not needed then.

from vim-matchup.

andymass avatar andymass commented on June 12, 2024

from vim-matchup.

andymass avatar andymass commented on June 12, 2024

I see a huge amount of lag in regexp_nfa.c when scrolling but it doesn't seem to be caused by ts syntax skip but instead this call to get_active_nodes

local active_nodes, symbols = unpack(M.get_active_nodes(bufnr))

When I comment this line out the lag disappears. What I don't understand is that get_active_nodes is gated behind ts_utils.memoize_by_buf_tick

M.get_active_nodes = ts_utils.memoize_by_buf_tick(function(bufnr)

Yet when scrolling it seems to be called again and again, even if the buffer hasn't changed.

from vim-matchup.

3rd avatar 3rd commented on June 12, 2024

Had this same issue but in Lua files, when moving cursor up/down and hitting a bracked it would freeze the editor for a bit (on a very beefy machine), fixed by disabling the plugin. Might be a Neovim issue, disabled Navic as well for the same reason.

from vim-matchup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.