-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add line-navigation to :ObsidianOpen (AdvancedURI) #56
Conversation
I'm very unsure about the way I propagated the |
a1cedc7
to
5e24656
Compare
lua/obsidian/command.lua
Outdated
local opts = { | ||
use_advanced_uri = nil, | ||
} | ||
|
||
--- Inject init/setup dependencies here (internal use) | ||
--- | ||
---@param use_advanced_uri boolean|? | ||
command.setup = function(use_advanced_uri) | ||
opts.use_advanced_uri = use_advanced_uri | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need all this because you can just access client.opts.use_advanced_uri
directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a feeling I was doing something not quite right. Give me a sec.
This PR adds a thin integration with the Obsidian Advanced URI plugin, allowing :ObsidianOpen to automatically scroll the Obsidian editor to the same line as NeoVim's. See: [Obsidian Advanced URI](https://github.com/Vinzent03/obsidian-advanced-uri)
5e24656
to
be3effe
Compare
…advancedUriSupport
@@ -97,16 +97,24 @@ command.open = function(client, data) | |||
|
|||
local encoded_vault = util.urlencode(vault_name) | |||
local encoded_path = util.urlencode(tostring(path)) | |||
|
|||
local uri | |||
if client.opts.use_advanced_uri then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we go. Thanks for pointing it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks for this
This PR adds a thin integration with the Obsidian Advanced URI plugin, allowing :ObsidianOpen to automatically scroll the Obsidian editor to the same line as NeoVim's.
See: Obsidian Advanced URI
Note: scrolling in the Reading viewmode does not currently work (see this issue). The Obsidian editor will scroll correctly when it's in edit-mode.