You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: use changed tick to determine whether we should parse instead of event
## Details
For the main event based update trigger rather than handling some
special events as changes all the builtin events are now handled as
non-changes. Instead in these cases we compare the `changedtick` between
the last time we computed `extmarks` and now and if it is different
(meaning the buffer has been modified) only then do we re-compute `extmarks`.
The `ui.update` method still takes a 4th boolean argument, but it is now
called `force` as the meaning of it is to force an update even if no
change to the buffer has been detected.
The user configured `change_events` will result in `force` being set
since some events that do not produce buffer changes may still require
us to re-compute `extmarks` like an example where `diagnostics` were
used to do some of the rendering.
We also set `force` on `WinResized` events as those do not change the
buffer but may result in a different rendering output since width can
impact some `extmarks`. Also for user commands and initial render.
What this allows us to do is avoid re-computing marks for things like
mode changes that do not modify the buffer. To support this clearing was
modified to delete each `extmark` individually rather than clearing the
entire namespace for the buffer, we can then re-create them later
without doing a whole parse & render cycle which is the most time
consuming task this plugin does. Before we needed to always re-compute
on mode changes since the user can have made text changes in insert
mode, but now this is fully handled by the `changedtick` value.
Other changes:
- do not hide any marks in `command` mode
- add `trace` and `warn` level logs to match neovim levels
- make most logs that were `debug` level now `trace` level and update docs
- unhandled log level from user results in no logs instead of all
- when logging nodes include the length of the text rather than all the
text in the node (easier to read), also include the TSNode type
0 commit comments