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.
Implemented logic for CLI installation from the GUI app.
A preference pane is added. The pane detects whether the user has
something installed that looks like the MacDown CLI utility by checking
common installtion locations, e.g. Homebrew.
If the util is not detected to be installed, the user can click a
button to install it. For now the only option is to install it to
/usr/local/bin/macdown.
Previously the cmd util uses different strategies to open files based
on whether MacDown is currently running. This results in various
problems, the most prominent being that NSWorkspace cannot be used
to pass a path for files that do not exist.
This change unifies the opening strategy to always be based on
cross-application NSUserDefaults instead, and moves the open file
check from during application launch to application activation.
This makes the implementation simpler, and also solves the problem
aforementioned.
Fix#672.
This implements a preference-based file-opening scheme. When the
CLI utility is run, all file name arguments are resolved to
absolute URLs and stored in a user default key *under the master
Macdown application's namespace*, and then launch MacDown.
Everytime MacDown is launched, it checks the aforementioned user
default key, and open any documents in it, creating non-saved drafts
if necessary (for non-existing documents). This mimics the expected
behaviours for "normal" editors, like VIM, nano, etc.. The user
default key is reset to nil after the documents are opened.
Closed#35.