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

Open vs Tab Open #586

Closed
keforbes opened this issue Aug 9, 2017 · 3 comments
Closed

Open vs Tab Open #586

keforbes opened this issue Aug 9, 2017 · 3 comments
Labels
Milestone

Comments

@keforbes
Copy link
Collaborator

keforbes commented Aug 9, 2017

If I launch Oni and go to Oni(File) -> Tab Open, all files will be opened in new tabs and gt will move between tabs. If I launch Oni and go to Oni(File) -> Open, all files will be opened in new tabs but gt will not move between tabs.

I'm not sure what benefit there is to having both Open and Tab Open given that they seem to do the same thing. The only difference between the two that I see is any files opened by Open are ignored when using gt. If I open some files with Tab Open and other files with Open, gt will only iterate through the tabs opened by Tab Open.

I guess my recommendation is to just remove Open and keep the Tab Open functionality. Though if we do that we should probably rename Tab Open to just Open.

@keforbes
Copy link
Collaborator Author

keforbes commented Aug 9, 2017

Also, it looks like any files opened using the fuzzy finder follow the Open code path because those files are ignored by gt as well.

@keforbes keforbes added the bug label Aug 9, 2017
@cyansprite
Copy link
Contributor

If I launch Oni and go to Oni(File) -> Tab Open, all files will be opened in new tabs and gt will move between tabs. If I launch Oni and go to Oni(File) -> Open, all files will be opened in new tabs but gt will not move between tabs.

If you open a tab in vanilla vim/neovim, you with a new Tab which you can cycle with gt
If you open a file normally, you will open up a buffer.

The oni tab bar handles both...
Due to how vim handles buffers and tabs it's hard to figure out what the correct behavior SHOULD be

@bryphe
Copy link
Member

bryphe commented Aug 9, 2017

Good catch... It's really confusing to have 'Open...', 'Tab Open..', 'Split Open...', AND 'Open Folder...' - especially when we now have the buffer line here.

I'm not sure what benefit there is to having both Open and Tab Open given that they seem to do the same thing

Right, it's confusing... especially in the context of making Oni inviting to 'new' Vim users - a tab means something very different in the vim-world versus in most other editors...

I guess my recommendation is to just remove Open and keep the Tab Open functionality. Though if we do that we should probably rename Tab Open to just Open.

This sounds good to me. It alleviates the confusion, a new user would understand what's going on... and it also behaves the way a vim-veteran-who-uses-tabs would expect (at least initially).

Also, it looks like any files opened using the fuzzy finder follow the Open code path because those files are ignored by gt as well.

Seems like we should be consistent - it's confusing that two different high-level gestures ('Open File') have a different outcome. To be consistent above, seems like we should use tabe.

Due to how vim handles buffers and tabs it's hard to figure out what the correct behavior SHOULD be

Right, Oni adds some extra confusion here. IMO I believe Vim-style tabs are confusing for new users (because they don't map conceptually to what users think of as tabs in other programs / editors - they're really window layouts), so I don't necessarily want to optimize for them. I also think that the vim-tab story will potentially get more confusing as multiplexing is implemented in #362. However, if we can get reasonable behavior that works for vim-tabs as well (like in the open cases), there's no reason not to support that (and advanced Vim users that prefer a tab workflow can set the tabs.showVimTabs option, and presumably they'd know enough to be able to wade the confusion..)

So here's the summary of changes I read from above:

  • Implement @keforbes suggestion to consolidate Open and Tab Open to just Open. I'd also like to change it to Open File just to be crystal clear.
  • Change QuickOpen to open a tab, so we have consistent behavior. It might be good to refactor this into a common command so that we can share the code path (like oni.openFile).

@bryphe bryphe added this to the 0.2.8 milestone Aug 9, 2017
bryphe pushed a commit that referenced this issue Aug 11, 2017
… Files...' (#594)

* Switch to 'open tab' behavior by default, to help a bit with buffer/tab confusion.

* Rename Open -> Open File
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants