-
Notifications
You must be signed in to change notification settings - Fork 189
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
Commands for opening notes in a vertical split #166
Conversation
Hey @stefanlogue, thanks for this. I would like to keep the overall number of commands to a minimum though, so IMO a better option would be to add an argument to the existing commands which determines how to open those buffers (vertical, horizontal, or replace current buffer). What do you think? |
Yeah that sounds like a better implementation, I can have a look at implementing that tomorrow/early next week. Should I close this PR and open a fresh one, as technically it's a different feature set? |
@stefanlogue up to you! Fine with me if you just make those changes in this PR. |
I think this could become quite tricky in the case of new notes, which already have an optional arg for the name of the note. If a user doesn't want to name their note, but does want to open it in a split, how do we discern that the passed argument is supposed to target the opening strategy rather than the name? Your input on this would be much appreciated, as I want to avoid breaking any existing patterns/introducing any breaking changes as much as possible |
Good point.
Another option would be to have a config setting that determines how to open notes for all of those commands. |
Is opening followed links in splits within the scope of this, or is that functionality you'd rather not have? |
I've pushed changes to match the implementation above, and decided that opening links in a split is a possible future feature but not needed at this time |
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.
LGTM! Thanks @stefanlogue :)
if data.args:len() > 0 then | ||
note = client:new_note(data.args) |
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 suspect the change from data.args
to data.args[1]
has just broken the functionality of the :ObsidianNew
command. If I call :ObsidianNew Example
, then:
data.args = "Example"
data.args[1] = nil
which breaks note_id_func
since it never recieves the title.
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.
Ah that's a remnant of my first pass when I tried to do this via additional arguments, must have missed this change, will open a PR for a fix
Added some commands to open notes in a vertical split:
Also updated README.md to reflect changes.
Closes #165