vim-python / python-syntax

Python syntax highlighting for Vim
MIT License
438 stars 84 forks source link

super slow with a lot of comments #33

Open ocehugo opened 6 years ago

ocehugo commented 6 years ago

Hi,

thanks for the updated syntax.

I found some problems while using the standard vim syntax and this one. I had some very dense comment blocks in some files, and vim never worked quick in them.

I tracked down and syntax highlighting was to blame. However, I'm so used to it that i cannot code without it.

So I try to trackdown the HiLink command that was slowing everything and I found that changing the comment to underlined achieve a much faster navigation:

HiLink pythonComment Underlined

ps: using neovim

jwkvam commented 6 years ago

I've also noticed that using this plugin causes noticeable lag. I'm also using neovim (with alacritty terminal). Your suggestion didn't work for me though. I haven't tried debugging further, but plan to.

ocehugo commented 6 years ago

Hi @jwkvam , not using this anymore, found several problems with the syntax (missing colors in some structures) and some regex calls.

I end up using my own syntax file...not fancy or complex --- just some overwrited calls to hilink commands of comments and removing some complex regexs that I don't care about.

good luck

nfnty commented 5 years ago

Would be great if you could upload some test files, so that I can reproduce this issue, thanks.

jwkvam commented 5 years ago

Sorry about that, I wish I included some :( I also switched. I'm using https://github.com/numirias/semshi now

mbyio commented 4 years ago

I had the same problem and had to stop using the plugin because of it. For some files it was taking up to a minute just for syntax highlighting. I've seen this in some other syntax plugins too (like Go's).

I think neovim has a bug that makes certain syntax highlighting really slow, because I only seem to have problems in really big files. Neovim has a few open issues related to this, but I don't think anybody has pinned down the problem yet.

I definitely do not have time, but if someone compares the builtin Python syntax file to what this one is doing, they can probably use that to figure out where the bug is in neovim.

paniash commented 3 years ago

@ocehugo Hi! Mind sharing your syntax file? I'm find this plugin quite laggy (especially noticeable when pressing 'o' to go into insert mode on a newline). Is this a plugin issue or am I the only one that feels it.