BertrandBev / code_field

A customizable code text field supporting syntax highlighting
https://bertrandbev.github.io/code_field/
MIT License
232 stars 61 forks source link

[Enhancement] Improve performance, when huge block of code is edited #10

Open subhamayd2 opened 3 years ago

subhamayd2 commented 3 years ago

When I am editing a huge block of code, the editor feels a bit sluggish. This is probably happening because on each change, the whole block of code is being parsed for highlighting. Is there any way that can improve the performance? I was thinking, if the parsing can be debounced somehow, that might improve the performance.

BertrandBev commented 3 years ago

Yep, we could also perform local highlighting, since most of the time local changes don't affect the rest of the document!

subhamayd2 commented 3 years ago

Agreed. Something like, only parsing the line that is currently being edited.

alberteije commented 1 year ago

Any improvement on this? Looks like we have same situation until now.