Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Finder window closes immediately after selecting Open Folder with Fuzzy Finder #663

Closed
someguynamedmatt opened this issue Aug 26, 2017 · 6 comments

Comments

@someguynamedmatt
Copy link
Contributor

someguynamedmatt commented Aug 26, 2017

I found this when messing with #662...

Release: 0.2.8
OS: Mac Sierra: 10.12.5

Steps to recreate:

assuming issue #662 applies to the user

  • select directory button (?) in lower-left corner of Oni window
  • select home directory (i.e. /Users/me or ~/me), click Open

home directory should be visible in the lower-left now
screen shot 2017-08-25 at 5 42 50 pm

  • open fuzzy finder <C-P>
  • select Open Folder (<C-n> then Enter)

Now the finder will open up and immediately close. I'm unsure if this and #662 are related.

@cyansprite
Copy link
Contributor

Would love to help but unfortunately I don't have a Mac and Linux and Windows works perfect for me.
Does this happen when opening a folder from the menu as well? I think I used the same exact logic with QuickOpen.

@bryphe
Copy link
Member

bryphe commented Aug 28, 2017

Interesting, thanks for logging the issue, @someguynamedmatt ! I'm able to reproduce this too with the step you provided. Very helpful, it was interesting to note the different experiences between clicking the path vs 'Open Folder'.

I also noticed that, in the Command Palette (<C-S-P>) clicking on the 'Open Folder' option directly works, but pressing enter fails as you describe. I'm suspecting that the 'enter' key is actually picked up by OSX's Open File/Folder dialog, and dismisses it immediately. Going to test that out and see if that's the issue...

@bryphe
Copy link
Member

bryphe commented Aug 28, 2017

Would love to help but unfortunately I don't have a Mac and Linux and Windows works perfect for me.

Ah ya, unfortunately this looks a quirk specific to Mac - appreciate the offer though!

@bryphe bryphe added the mac label Aug 28, 2017
@someguynamedmatt
Copy link
Contributor Author

@extr0py What files should I check out to see where this issue might be coming from?

@bryphe
Copy link
Member

bryphe commented Sep 1, 2017

Hmm, I haven't been able to dig into this too much - but I suspect what's happening here is that we OSX's platform open-folder modal on the keydown event, and that experience actually listens for a keyup event!

A few options here:

  • A quick-and-dirty option to validate this is the issue would be to switch the event we listen to from "keydown" to "keyup" - this happens in `Keyboard.ts". This wouldn't be a viable long-term solution, because it would hurt the typing latency when editing, but it could help us at least validate the hypothesis.
  • A longer-term fix, if that is the issue, would be to delay showing the open folder until we receive a 'keyup' event - the open folder action is registered in Commands.ts, so we could add some logic there to hold off on opening it until we have a keyup event.
  • An alternative long-term fix, would be to have some category of commands that we listen to on keyup, and have open folder be one of those commands.

There might be another possibility, like hook the keyup event in Keyboard.ts, and always prevent default/stoppropagation for the enter key in that case.

Hope that helps gives some ideas, at least! Thanks for your help with this 😄

@bryphe
Copy link
Member

bryphe commented Sep 2, 2017

This was fixed by PR #681 . Thanks for the help and fix, @someguynamedmatt !

@bryphe bryphe closed this as completed Sep 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants