Sublime Forum

Disable looping with `next_tab` and `prev_tab`

#1

Is there any way to disable next_tab and prev_tab to go back to first(or last) tab and loop over. So when I get to the last tab with next_tab it will stop there and it will not go to the first tab and start next_tab all over.

0 Likes

#2

There’s not a direct setting to do this (presumably you are talking about next_view and prev_view as the commands here?).

A custom plugin could be implemented to do this though; window.views() gives you the list of views, and window.active_view() will tell you which view is active in the window. So a custom command (or commands, one for each) could test if the current view is at the start or end of the list, and then if not invoke the appropriate command.

1 Like