Open oblitum opened 9 years ago
Just thinking about how this could work... making color_coded only highlight once a compilation was 100% succcessful isn't an issue. The issues come up as side effects to doing this. An instance where it might work well:
Even this can have some issues, but let's say that works well. An instance where this doesn't work well might be:
There are more cases where this can go wrong than where it will be nice, I think. A broader solution might just be to have this option disable color_coded while in insert mode altogether. As soon as you exit insert mode, it applies the latest highlighting it can. Any edits in normal mode (dd
, for example) will highlight as soon as possible, like they do now. The issue with this is that highlighting is still handy in insert mode.
A broader solution might just be to have this option disable color_coded while in insert mode altogether. As soon as you exit insert mode, it applies the latest highlighting it can. Any edits in normal mode (dd, for example) will highlight as soon as possible, like they do now. The issue with this is that highlighting is still handy in insert mode.
This may be a good approach (at last for me since I'm always back and forth between normal and insert mode).
You know what? Another thing regarding the bad impression of instant highlighting is that it's not happening so instantly... I'm not sure this is solvable but, when you enter a new line by pressing o
, all the lines that comes after this new line get the colors of the previous coloring. I mean, line N get the highlighting that was in line N-1, so it looks weird briefly for all the lines following a new one until I start typing in this new line or something.
Maybe async neovim would solve all of this...
In sum, the problem is, repositioned text ideally should get its highlighting repositioned too, at the time it gets repositioned, not much later.
Also, I'm sorry, the way I formerly commented about solving this issue is the result of a misunderstanding on how you implement highlighting. I thought that by having the highlighting internal elements not updated so instantly, I wouldn't get updated highlighting for new stuff but the remaining code would still get in sync with its previous highlighting. I see now it doesn't seem to work this way, less frequent updates would turn matters worse since remaining text woudn't have highlighting in sync, which I thought it would.
Just so we both don't forget about this experiment: