diff --git a/README.md b/README.md index ca05e96..47f076a 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,9 @@ If you like my plugin, I would appreciate it if you could buy me a cup of coffee [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/iiz00)

## Changelog +- 0.5.1 + - Fixed + - Fixed a problem in Reading view where clicking on an outline element would not jump to that position properly. Now the position of the outline element is highlighted when you jump to it. - 0.5.0 - New function - Canvas support diff --git a/manifest.json b/manifest.json index eda98d2..63a6d15 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "multiple-notes-outline", "name": "Multiple Notes Outline", - "version": "0.5.0", + "version": "0.5.1", "minAppVersion": "1.5.8", "description": "Add custom views which show outlines of multiple notes with headings, links, tags and list items.", "author": "iiz", diff --git a/package.json b/package.json index d27878a..046c0a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "multiple-notes-outline", - "version": "0.5.0", + "version": "0.5.1", "description": "Add custom views which shows outline of multiple notes at once", "main": "main.js", "scripts": { diff --git a/src/constructDOM.ts b/src/constructDOM.ts index aeb186a..6b781cb 100644 --- a/src/constructDOM.ts +++ b/src/constructDOM.ts @@ -1254,18 +1254,21 @@ export function constructOutlineDOM (file:TFile, info:FileInfo, data: OutlineDat export function scrollToElement(line: number, col: number, app: App): void { const view = app.workspace.getActiveViewOfType(MarkdownView); if (view) { - view.editor.focus(); - view.editor.setCursor (line, col); - view.editor.scrollIntoView( { - from: { - line: line, - ch:0 - }, - to: { - line: line, - ch:0 - } - }, true); + //view.editor.focus(); + // view.editor.setCursor (line, col); + // view.editor.scrollIntoView( { + // from: { + // line: line, + // ch:0 + // }, + // to: { + // line: line, + // ch:0 + // } + // }, true); + // view.editor.scrollTo(5); + // view.previewMode.applyScroll(line); + view.setEphemeralState({line}); } } @@ -1290,7 +1293,7 @@ function attachFileInfo (targetEl: HTMLElement, status: FileStatus, info: FileIn if (firsttagIndex >= 0){ targetEl.dataset.subinfo = data[firsttagIndex].displayText; } - } + } break; case 'none': break; diff --git a/src/fileView.ts b/src/fileView.ts index cda83ca..158e316 100644 --- a/src/fileView.ts +++ b/src/fileView.ts @@ -308,6 +308,8 @@ export class MultipleNotesOutlineView extends ItemView { // ファイル修正、削除、リネームなどの際の自動更新 private async autoRefresh(){ + const startTime = performance.now(); + if (!(this.flagChanged || this.flagRegetTarget || this.flagSaveSettings)){ return; } @@ -390,6 +392,10 @@ export class MultipleNotesOutlineView extends ItemView { this.flagRegetTarget = false; this.flagChanged = false; this.flagSaveSettings = false; + const endTime = performance.now(); + if (this.settings.showDebugInfo){ + console.log('Multiple Notes Outline: time required to auto refresh, file view: ', endTime - startTime); + } } // リフレッシュセンター