Closed ghost closed 9 years ago
Yep, sounds like an idea :) Here's the relevant code: https://github.com/zedapp/zed/blob/master/app/js/cli.nw.js#L29
Hm, if I'm reading this correctly:
https://github.com/zedapp/zed/blob/master/app/js/cli.nw.js#L51
openUi.open(path, url);
path
is the path to the project root dir, and url
is the full path to the file to open, right?
Let me look that up for you: https://github.com/zedapp/zed/blob/master/app/js/open_ui.js#L263
First is the title (presented in the title bar), the second the URL (probably in the form: node:/home/bla/bla
).
Hm, so where's the code that says "if url is a file, the project is the directory that contains that file"?
https://github.com/zedapp/zed/blob/master/app/js/history.nw.js#L79 Seems related but I'm having a hard time pinning down exactly where to implement this.
That's over here: https://github.com/zedapp/zed/blob/master/app/js/fs/node.js#L22
Currently, if I'm using a linux terminal, and I type 'zed /path/to/some/file', zed will open that file, but Ctrl-E will only let me navigate to other files within that directory. This is frustrating when the file opened is in a subdirectory of a larger git project, as zed's project-based navigation prevents me from seeing files outside that directory, even though they're part of the same git repo.
I think Zed's default behavior of opening a directory as a project works well, but when opening a file, zed should walk up the path looking for various source control files in order to determine what the "project" is.
I happen to have a simple shell script that does exactly this, zed would need some js equivalent of this:
Super simple stuff ;-)
Can you point me at the part of the code where it loads files from the command line?