neoclide / coc-highlight

Document highlight and document colors LSP support for coc.nvim
221 stars 12 forks source link

Option to disable coc-highlight on large text files #30

Closed crazyboycjr closed 4 years ago

crazyboycjr commented 4 years ago

I just found that if I open a text file of several MBs, the coc-highlight would be slow to do the highlighting work. It may take ~1s to react to the vim motion. If you are using Linux, you can test with the following commands.

$ du -sch vim /usr/lib/modules/`uname -r`/modules.alias
1.5M    /usr/lib/modules/5.6.15-arch1-1/modules.alias
1.5M    total
$ vim /usr/lib/modules/`uname -r`/modules.alias
chemzqm commented 4 years ago

:h coc-config-preferences

crazyboycjr commented 1 year ago

Hi @chemzqm, "coc.preferences.maxFileSize" seems to disable the entire coc, which is not expected. Maybe we need an option to just disable the highlight plugin on a large file.

chemzqm commented 1 year ago

You don't need that, the performance was improved

chemzqm commented 1 year ago

You can use :CocCommand document.toggleColors

crazyboycjr commented 1 year ago

Looks great! Thanks!