Skip to content

New Geolocation Note opens inside pinned tabs #383

@maxpower24

Description

@maxpower24

Loving the plugin, thanks for all your hard work!

The "New Geolocation Note" command doesn't consider whether a tab is pinned or not, and looks like it's using a deprecated API:

https://docs.obsidian.md/Reference/TypeScript+API/Workspace/activeLeaf

I've been using the below inside the else block of newFrontMatterNote and it's functioning as I would expect but I haven't tested it thoroughly. It also doesn't affect the behavior for pinned map view notes.

const ws = this.app.workspace;

let leaf = ws.getLeaf(false);

await leaf.openFile(file, { active: true });

const editor = utils.getEditor(this.app);
if (editor) await utils.goToEditorLocation(editor, cursorPos, false);

I'm new to using github but if this is suitable I can look into creating a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions