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
chore(refactor): pass callback when computing extmarks to make move to async parsing easier
## Details
In order to take advantage of async treesitter parsing we'll need to use
a callback pattern to compute and add `extmarks` after parsing finishes.
Currently (from some local testing) I'm not seeing improvements to
responsiveness from this so am not making the full change to actually do
this for now.
However to make adopting it easier in the future I'm updating the
structure of how `parse` is called to use a callback, even if it's not
necessary for the time being.
In order to do this the logic of displaying `extmarks` needed to be
separated into its own method from the logic that sets `extmarks`.
This is because in the event that we need to `parse` we need to both set
and display the `extmarks` as part of the callback, and in the event we
don't we just want to display the `extmarks` immediately. Since one
happens in a callback and the other directly the logic can't be shared
as part of the same method and needed to be moved to its own.
There are technically some small changes to behavior but they should not
cause any problems:
- Previously we only called `on.clear` when removing marks due to a mode
change. However when we `parse` and get new marks we also need to
clear the buffer to remove any not needed for the current render
cycle. The `on.clear` callback is now called in both of these cases.
- The time between clearing old marks and showing new marks is
"massively" reduced. Before we would clear, then parse, then display.
Now the behavior is parse, then clear, then display. Since the parse
step is the most expensive the gap is much lower, from local testing
goes from 10s of milliseconds to less than 1. Neither of these is
really something people can notice so no visible change.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,11 @@
2
2
3
3
## Pre-release
4
4
5
+
### Features
6
+
7
+
- change code.border to thin instead of hide if version < 0.11.0 [a706be7](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/a706be739257a6203524741da2da540bc190bbe2)
8
+
- allow image links to use custom icons based on destination [ac3e74f](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/ac3e74ffdb0bcf7282445ac12083fb6bd44858a1)
0 commit comments