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

x-macdown URL scheme implementation #985

Merged
merged 4 commits into from Jun 3, 2018
Merged

Conversation

mixio
Copy link

@mixio mixio commented Jun 1, 2018

Open a file from a browser with url of the form "x-macdown://open?url=file:///path/to/a/file&line=123&column=45"

FIXME: Could not figure out how to place the insertion point at a given line and column.

Jean Jourdain added 3 commits Jun 1, 2018
Open a file from a browser with url of the form "x-macdown://open?url=file:///path/to/a/file&line=123&column=45"

FIXME: Could not figure out how to place the insertion point at a given line and column.
Open a file from a browser with url of the form "x-macdown://open?url=file:///path/to/a/file&line=123&column=45"

FIXME: Could not figure out how to place the insertion point at a given line and column.
…l_scheme

# Conflicts:
#	MacDown/Code/Application/MPMainController.m
@uranusjr
Copy link
Member

@uranusjr uranusjr commented Jun 2, 2018

The implementation looks good to me. Could you add some line breaks so the lines don’t get too long? We generally try to keep lines under 80 characters long (not a hard rule, but please try). Thanks so much!

@mixio
Copy link
Author

@mixio mixio commented Jun 2, 2018

Added some line breaks to try to keep lines under 80 characters long. Best regards.
@uranusjr have you any idea of how to open a file in MacDown, placing the insertion point to a given line and column ?

@uranusjr
Copy link
Member

@uranusjr uranusjr commented Jun 3, 2018

There’s no built-in way to do this AFAIK, so you probably need to parse the URL yourself and tap into NSTextView API to move the cursor yourself.

I’ll merge this as-is because everything works already. We can add the auto-jump feature separately.

@uranusjr uranusjr merged commit a2de3a6 into MacDownApp:master Jun 3, 2018
1 check passed
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.

None yet

2 participants