tree-sitter / tree-sitter-c

C grammar for tree-sitter
MIT License
237 stars 106 forks source link

Large C Macros Over Multiple Lines Causes Either Loads Forever or SegFaults #159

Closed VictorSohier closed 1 year ago

VictorSohier commented 1 year ago

Problem

Whenever I load a specific file with a large C macro (I'm messing around with generic collections), and I open the file either by the editor or via telescope preview, neovim either ceases, or at one point, just segfaults. Another symptom is that there seems to be excessive memory usage upon opening this file (16 GiB, the file is about 13KiB).

Steps to Reproduce

Open list.h in neovim with my config. I have isolated this to nvim-treesitter already, but wanted to post the issue here first and work my way up the chain.

Expected Behavior

The ability to actually edit filles with huge macros without disabling treesitter.

System Information: Neovim version: 0.9.1-3.1 Operating system: Cachyos, Linux version 6.1.8-1-cachyos-cacule Installation: cachyos-extra-v3/neovim via yay Terminal:

amaanq commented 1 year ago

Doesn't belong here