Skip to content

Conversation

@bramblex
Copy link

  1. Support muti file select.
  2. Use new tab instead new buffer to open terminal.
  3. Use VIM APIs (readfile / delete) instead execute shell commands.

: )

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep Bclose! here because the behaviour is not the same. If I split a tab in two windows and then I open un file in one window with ranger, the window in delete and the file is open in the other window... Can you try this? Do you use neovim?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use neovim and do not have Bclose, and @bramblex's changes work perfectly. In fact the tabnew change makes it function in a much more useful way.

It's hard to explain what it's even doing, because it isn't actually opening things in new tabs. It's opening them where I expect them. If I make a new split, and then open ranger from that buffer, the selected file from ranger is opened inside that buffer.

@francoiscabrol
Copy link
Owner

Hi, thank you for your contribution! but I would merge it if made some changes. Please don't modify the indentation because it is harder to see the changes. Then I don't understand why you say 'Use new tab instead new buffer to open terminal.'

@jessesanford
Copy link

I have tried these changes on my fork as well and they work great with neovim. I admit i don't fully understand the implications of enew vs tabnew or bdelete! vs bclose! But it does work well and I am happy to use all vim commands and no shell invocations. The code also looks sane. I also think this should be merged.

@rosshadden
Copy link

@bramblex I am using your fork, and it works great. You don't have issues enabled for it, so I'm asking a question here.

Can we handle opening multiple files in some sane way? Right now if you open multiple files, it just opens them in a bunch of buffers in vim. I'm not sure what it should do, but opening them in splits or tabs seems more sane. Thoughts?

@francoiscabrol
Copy link
Owner

I don't use to open multiple files at once. what I do usually is:

  • Iam in a new buffer
    -> I open ranger
    -> I select a file and press enter
    -> The file is now open in the current window
    -> I split the tab or create a new tab and I open ranger in the new buffer
    -> etc...

Bclose is useful for the following use case:

  • I have a file open in a tab
    -> I split the tab, so the focus is in the new window
    -> I open a buffer/file (called B.scala) in this new window with ranger or anything else
    -> I open ranger from the new window
    -> I close ranger by press 'q'
    without Bclose, the ranger's buffer is closed and the split window too, it doesn't come back to B.scala > that's bad;
    with Bclose, ranger is closed but the file B.scala is still there in the splitted window

@francoiscabrol
Copy link
Owner

About the multiple files selection ranger's feature, I don't use it so I have no clear ideas about that... I think, by default, it should open the files in buffers and let the user to open the buffers in tabs and/or windows. This seems to be the closest to the vim philosophy. But we could provide a setting to open the files in the tabs or splitted windows... like that everyone would be happy.

@bramblex
Copy link
Author

bramblex commented May 9, 2016

@rosshadden

Why open ranger in new tab instead of new buffer? Because using a new tab to open ranger won't change the existed windows or buffers, so it just close the tab using bdelete after ranger closed and didn't need Bclose .

@bramblex
Copy link
Author

bramblex commented May 9, 2016

@jessesanford

I think you need a buffer explore, such as minibufexpl or smart tab line in airline.

: )

@francoiscabrol
Copy link
Owner

Because if you open ranger from a window, you expect to open the file from ranger in the same window, no?

@francoiscabrol
Copy link
Owner

it seems that each persons expect different behaviors so I agree if you want to add options for changing the default behaviors

@francoiscabrol
Copy link
Owner

The features added in this PR are now implemented or are coming (like using new tab instead of new buffer, will come as an option #65). I have to close it now since it's getting old but thank you for your contribution and the good ideas you brought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants