Skip to content
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

Move open-in-vscode-via-url to a separate command #6

Conversation

ptim
Copy link
Contributor

@ptim ptim commented Jun 21, 2022

Follow-up to #5

Hi @NomarCub ! Many apologies for the very slow reply...

The changes somehow appear more sweeping than I originally intended, but I think it's for the best - the commits are granular, so if anything rubs you up the wrong way (eg - hope you don't mind the dev helpers), let me know and I can adjust / remove!

I'm not sure why this PR is "Can't automatically merge".. it merged cleanly on my fork...

I tried to make some modifications before merging, but fucked something up, so I merged anyway. Do you mind opening another PR with some adjustments?

On Windows, due to the dialog that comes up with URL, the second window.open never manifests. This also means that you can't specify to not open the file currently active in Obsidian.

Aha - I don't have a windows machine to test on, but I would have thought that this might cause a failure on the first invocation, but would work on subsequent invocations after the user had satisfied the dialog... Are you finding that you have to address a dialog every time?

I've made a toggle for "Open file", so users should be able to find a config that works well for them.

For me it'd make sense if the useWorkspace was a checkable setting, transparent to the user.

Gotcha... as I was reviewing this, I thought it was cleaner to have two separate commands; in this way it's transparent to the user in that they can set shortcuts as desired 👍

For me, it's as simple as 'set my keyboard command to open-in-vscode-via-url', then the defaults are good. Changes I made to CLI command have been reverted, and it remains bound to the Button (this could be a setting if you think it's important).

It'd also be nice if you could use the {{}} variables in the the URL workspace path setting.

Done! (for {{vaultpath}} - the URL protocol is not as flexible as the CLI, so filepath doesn't make sense in this context, I think, as we have a toggle for this purpose)

Hope that helps - let me know what you think, Tim

screenshot - 2022-06-21 - test vault - Obsidian v0 15 2 - 2022-06-21 at 21 48

@ptim
Copy link
Contributor Author

ptim commented Jun 21, 2022

Doh.. must have had some faulty config in my git client - just couldn't see your most recent changes for some reason! Cherrypicked branch over here: #7

@ptim ptim closed this Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant