vicoapp / vico

Mac Programmers Text Editor
http://www.vicoapp.com/
657 stars 89 forks source link

Current directory of command line tool #35

Closed joshvoigts closed 11 years ago

joshvoigts commented 11 years ago

It would be nice if instead of setting the current directory, it was set to the directory of the file being opened when using the command line tool.

For example, if I open an existing file:

vico existing-file.txt

and then want to re-save it:

:w ./new-file.txt

it puts the file in my home directory instead of what should be the current directory.

Shadowfiend commented 11 years ago

I've attached a pull request that implements most of this. Because vicotool does not start a new instance of vico when vico is already running, we only set the base path when it isn't already running. If vico is already running, we leave the working directory alone.

Do try this branch if you can, and let me know if you still have any issues.

Shadowfiend commented 11 years ago

I'm going to give this a couple of test spins one of these days and merge it unless I hear otherwise.

Shadowfiend commented 11 years ago

Small tweak, and I'm merging. We now always set the base path to CWD, not just when there's a file on the command line.