Skip to content

Commit

Permalink
fix: set cursor in already opened pane
Browse files Browse the repository at this point in the history
close #81
  • Loading branch information
Vinzent03 committed Sep 28, 2022
1 parent e10d345 commit c51d3ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ export default class AdvancedURI extends Plugin {
async handleOpen(parameters: Parameters) {
let fileIsAlreadyOpened = false;
this.app.workspace.iterateAllLeaves(leaf => {
if (leaf.view.file?.path === parameters.filepath) {
if (leaf.view.file?.path === parameters.filepath && leaf.width > 0) {
fileIsAlreadyOpened = true;
this.app.workspace.setActiveLeaf(leaf, true, true);
}
Expand Down
3 changes: 3 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ declare module 'obsidian' {
interface View {
file: TFile;
}
interface WorkspaceLeaf {
width: number;
}
}

export interface FileModalData {
Expand Down

0 comments on commit c51d3ef

Please sign in to comment.