(file: TFile)
| 383 | } |
| 384 | |
| 385 | async openManagedFile(file: TFile): Promise<void> { |
| 386 | const nativeBinaryExtensions = [ |
| 387 | 'png', 'jpg', 'jpeg', 'gif', 'webp', 'svg', 'bmp', 'ico', 'tiff', 'psd', |
| 388 | 'pdf', |
| 389 | 'mp3', 'wav', 'ogg', 'flac', 'aac', 'm4a', 'wma', |
| 390 | 'mp4', 'avi', 'mkv', 'mov', 'wmv', 'flv', 'webm', 'm4v', |
| 391 | 'zip', 'rar', '7z', 'tar', 'gz', 'bz2', 'xz', |
| 392 | 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', |
| 393 | 'exe', 'dll', 'so', 'dylib', 'bin', 'dat' |
| 394 | ]; |
| 395 | |
| 396 | const ext = file.extension.toLowerCase(); |
| 397 | const leaf = this.app.workspace.getLeaf(true); |
| 398 | |
| 399 | if (nativeBinaryExtensions.includes(ext)) { |
| 400 | await leaf.openFile(file); |
| 401 | } else { |
| 402 | await leaf.setViewState({ |
| 403 | type: VIEW_TYPE_CODE_SPACE, |
| 404 | active: true, |
| 405 | state: { file: file.path } |
| 406 | }); |
| 407 | |
| 408 | await this.updateOutline(file); |
| 409 | } |
| 410 | |
| 411 | await this.app.workspace.revealLeaf(leaf); |
| 412 | } |
| 413 | |
| 414 | private async handleIgnoredPathRename(file: TFile | TFolder, oldPath: string): Promise<void> { |
| 415 | const normalizedOldPath = this.normalizeIgnoredPath(oldPath); |
no test coverage detected