1995eaton / chromium-vim

Vim bindings for Google Chrome.
https://chrome.google.com/webstore/detail/cvim/ihlenndgcmojhcghmfjfneahoeklbjjh
MIT License
2.26k stars 325 forks source link

The order of tabs when opening with F is reversed. #185

Closed rahulkmr closed 9 years ago

rahulkmr commented 9 years ago

I am not sure if there is some config for this. When I am on a page and I open link A and B(in that order) using F, B is on my right followed by A. Is there a reason it doesn't behave like it would when I do it with right click -> open in new tab?

hpurmann commented 9 years ago

It always opens the tab directly to the right of the current. IMO it comes in quite handy in comparison with the built-in function which is just placing the tabs at the end.

rahulkmr commented 9 years ago

Is there a way to revert it to the built-in behavior?

hpurmann commented 9 years ago

But I agree, one could provide a config for changing it back to the browsers default.

rahulkmr commented 9 years ago

From a quick look, https://github.com/1995eaton/chromium-vim/blob/master/background_scripts/actions.js#L42 (index: sender.tab.index + 1) it isn't configurable but shouldn't be hard to implement.

rahulkmr commented 9 years ago

All right. I did a haphazard fix by commenting the explicit index. It will break with the updates but I am willing to put up with manually changing the js if the author doesn't want to implement the config option.

1995eaton commented 9 years ago

It doesn't look like it will be as easy as it sound to make links open the same way Chrome does. I tried commenting out the index property, and it seems like that make all tabs open at the end of the tab list. Chrome creates tabs at the end of the tabs opened by that specific tab if that makes sense. In order to fix this, I think we'll need to maintain an object that keeps track of which tabs were opened by each tab.

rahulkmr commented 9 years ago

Premature celebrations on my part:-)

The default chrome behavior is what I want. I disabled cVim and tried Vimium. Vimium is working the way chrome works. I will take a look and post back if I find something.

1995eaton commented 9 years ago

Turns out it was a little easier than I thought. Just add set nativelinkorder to your cVimrc and it should work now.

rahulkmr commented 9 years ago

Yup. Works like a charm. Thank you.

1995eaton commented 9 years ago

No problem!