Vinzent03 / obsidian-advanced-uri

Advanced modes for Obsidian URI
MIT License
766 stars 44 forks source link

1.38.0 - if cursor is on the line of the heading, "copy URI for current file" command includes heading link #142

Closed luckman212 closed 1 year ago

luckman212 commented 1 year ago

Seems that if cursor is on the line of the heading, then the output is what you would get from "copy URI for current block"

example

# Foo
^---cursor here, execute "Advanced URI: copy URI for current file" command 

abc

# Bar

xxx

expected:

obsidian://advanced-uri?vault=Main&uid=1a235bde-4067-4958-bb13-8eb0d5349650

actual:

obsidian://advanced-uri?vault=Main&heading=Foo&uid=1a235bde-4067-4958-bb13-8eb0d5349650
luckman212 commented 1 year ago

Hmm, actually I see "copy URI for current block" generates a unique ID and a block= parameter. So maybe this is actually intended behavior?

Vinzent03 commented 1 year ago

Yeah this is the intended behavior to automatically get a link to the current heading in the note. The command for current block is different and goes further by creating a block reference.

luckman212 commented 1 year ago

Maybe would be cool to have a separate command or a toggle to make the command distinctly include the heading link or not. (in my case, most of the time I don't actually want it)

Vinzent03 commented 1 year ago

Hmm I think there are already enough commands and that's not really worth to add another. The heading is only included if the cursor is in the line of the heading, so why don't put the cursor somewhere else?

luckman212 commented 1 year ago

Understood. No problem. Just have to get used to it. Or, I can always just trim the parameter from the copied URL after.