-
Notifications
You must be signed in to change notification settings - Fork 40
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
support url handlers to open files from url #2514
Comments
still no updates? :( |
What kind of problems does a custom scheme solve? |
I need a way to open a specific file and line number using a url-like format as I use for vscode and other editors |
But do you need a custom scheme for this? Why can’t you use the over-arching script and/or environment to select the appropriate program? The subl executable already supports file:line:col syntax so I don’t see any problems with this. And if you’re choosing subl:// as the scheme then you’ve already iterated over the possible editors in your over-arching script I would think. |
not sure what you mean by over-arching script but since my addon runs only
in a browser I only have access to links not executables.
if 'subl://filepath.ext:lineNumber' works then we have no issues here 😁
this is what we need exactly microsoft/vscode#4883
…On Mon, Aug 24, 2020, 12:53 AM Raoul Wols ***@***.***> wrote:
But do you need a custom scheme for this? Why can’t you use the
over-arching script and/or environment to select the appropriate program?
The subl executable already supports file:line:col syntax so I don’t see
any problems with this. And if you’re choosing subl:// as the scheme then
you’ve already iterated over the possible editors in your over-arching
script I would think.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2514 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHFMUWSTWJFHAWNJXEBWSLSCGMWNANCNFSM4GJJ4Q6Q>
.
|
@rwols sorry I didn't get your answer. any updates on this topic since then? |
An extension to this request is to support web links to clone a git repo directly into the editor as a new project. VS Code supports such a scheme:
The |
I was able to register |
I figured it out for windows ; sublime text protocol
[HKEY_CLASSES_ROOT\subl]
"URL Protocol"=""
[HKEY_CLASSES_ROOT\subl\shell\open\command]
@="\"D:\\Software\\portable\\Sublime Text\\sublime_text.exe\" --command \"open_file_from_url {\\\"url\\\": \\\"%1\\\"}\""
; pretend we are vscode
[HKEY_CLASSES_ROOT\vscode]
"URL Protocol"=""
[HKEY_CLASSES_ROOT\vscode\shell\open\command]
@="\"D:\\Software\\portable\\Sublime Text\\sublime_text.exe\" --command \"open_file_from_url {\\\"url\\\": \\\"%1\\\"}\"" then in the user folder add this command import sublime_plugin
import sublime
import re
from urllib.parse import unquote
class OpenFileFromUrlCommand(sublime_plugin.WindowCommand):
def run(self, url):
url = unquote(re.sub(r"^(vscode|subl):(\/\/)?((file|open)\/)?", "", url))
self.window.open_file(url, sublime.ENCODED_POSITION)
|
Problem description
basically, support this nativly https://github.com/inopinatus/sublime_url
why? because I made this https://github.com/a7madgamal/open_github_in_editor and I would love to add your amazing editor to the list of supported editors :D
I'm more interested in MacOs support but other OS are welcome I guess
Preferred solution
just adjust the installers to add the url handler
The text was updated successfully, but these errors were encountered: