oni icon indicating copy to clipboard operation
oni copied to clipboard

opening using `oni <dir>` does not set the dir correctly

Open danielb2 opened this issue 8 years ago • 7 comments

<dir> appears to be sticky. So the first time I opened oni, it was in a specific dir. Unless I change the dir with :cd <dir> the dir appears to be sticky.

expected:

oni . should use the pwd to set the dir correctly for example.

danielb2 avatar May 02 '18 18:05 danielb2

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

oni-bot avatar May 02 '18 18:05 oni-bot

This is something that only atom does afaik. Not vim.

justinmk avatar May 02 '18 18:05 justinmk

if i'm opening vim in a folder, and I open NerdTree or whatever, it's not going to show files in some other directory I opened hours earlier.

Any GUI I've used be it atom, sublime, whatever, will show the explorer in the dir it was opened in.

danielb2 avatar May 02 '18 18:05 danielb2

That's not the same thing as your original request.

justinmk avatar May 02 '18 18:05 justinmk

Yes it is. I'm talking about opening oni with oni <dir> and it showing the explorer for that dir.

oni . is one example. If I start it like that now, it is remembering the last directory I did a :cd to. I don't know where it's storing that, but it's not in the config dir.

danielb2 avatar May 02 '18 18:05 danielb2

~~What directory are you starting from?~~ Oh, in the case of oni . obviously it should use CWD. But it should do that even without the . arg.

I just tried it, you're right that Oni remembers the last :cd and doesn't look at the CWD where oni was invoked. That does seem wrong. I was confused by the mention of oni <dir>, because the I've seen other requests in the past asking for nvim <dir> to set the CWD to <dir> (which Atom does, IIRC).

justinmk avatar May 02 '18 18:05 justinmk

I am not sure invoking oni without arguments should set the cwd. The reason is that users that for some reason don't have a shell-less command to run Oni would always open it in the ~ dir, e.g. starting a terminal and running Oni.

My suggestion would be to adhere to the following convention:

  • oni: Opens Oni without setting cwd, i.e. loads the last cwd remembered
  • oni <dir>: Opens Oni with cwd set as <dir> (including .). Even better if NETRW opened as well.
  • oni <file>: I think it's really annoying when the file explorer displays a project's tree that has no relation to the file I am editing, this would improve the quality of life for people who need to perform quick tweaks on occasion. Opening with pwd or the file's directory would work for me.

badosu avatar May 03 '18 12:05 badosu