Skip to content

Commit

Permalink
fix: No updates on scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
HEmile committed Mar 18, 2024
1 parent bc101c3 commit 230ca97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "supercharged-links-obsidian",
"name": "Supercharged Links",
"version": "0.12.0",
"version": "0.12.1",
"minAppVersion": "1.5.11",
"description": "Add properties and menu options to links and style them!",
"author": "mdelobelle & Emile",
Expand Down
6 changes: 4 additions & 2 deletions src/linkAttributes/livePreview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function buildCMViewPlugin(app: App, _settings: SuperchargedLinksSettings
}

update(update: ViewUpdate) {
if (update.viewportChanged || update.docChanged) {
if (update.docChanged) {
this.decorations = this.decorations.map(update.changes);

update.changes.iterChanges((fromA, toA, fromB, toB, t) => {
Expand All @@ -72,9 +72,11 @@ export function buildCMViewPlugin(app: App, _settings: SuperchargedLinksSettings
// Update decorations within bounds
this.decorations = RangeSet.join([this.decorations,
this.buildDecorations(update.view, minFrom, maxTo)]);

});
}
else if (update.viewportChanged) {
this.decorations = this.buildDecorations(update.view);
}
}

destroy() {
Expand Down

0 comments on commit 230ca97

Please sign in to comment.