arakashic / chromatica.nvim

Clang based syntax highlighting for Neovim
MIT License
299 stars 17 forks source link

Highlighting is not updated on viewport change #51

Open IngoMeyer441 opened 6 years ago

IngoMeyer441 commented 6 years ago

Hey, chromatica does not update highlighting when only the viewport is changed (e.g. by pressing zz or <C-y>) and the cursor stays in place. Would it maybe be better to call chromatica#handlers#_highlight() on CursorHold and not on CursorMoved? (see handlers.vim)

IngoMeyer441 commented 6 years ago

color_coded calls its update routine on CursorHold, CursorHoldI, CursorMoved and CursorMovedI (https://github.com/jeaye/color_coded/blob/master/plugin/color_coded.vim#L52). However, binding to insert mode events could be quite slow...

arakashic commented 6 years ago

Sure. That is a good idea. I have pushed it to master. I would imagine no big hit on performance. Please try it.

IngoMeyer441 commented 6 years ago

Tried it and works great without any noticeable performance hit. :+1: