sublime_text icon indicating copy to clipboard operation
sublime_text copied to clipboard

"Next/Previous File" doesn't update the current tab with respect to `open_tabs_after_current`

Open jason5122 opened this issue 2 years ago • 2 comments

Description of the bug

Using "Next/Previous File" (aka next_view/prev_view) doesn't update the current tab when it comes to the open_tabs_after_current setting. If that setting is true, switching to another file using "Next/Previous File" and then opening a new tab will actually create the new tab after the previously current tab and not the actual current one.

I tested a few of the other tab switching methods and they don't seem to have this issue:

  1. "Next/Previous File in Stack"
  2. ⌘+<number> (aka select_by_index)

Here's a video demo. The first half involves me using "Next/Previous File" to navigate, resulting in the new tabs being created in the wrong place. The second half involves me using ⌘+<number>, resulting in new tabs being created in the correct spot (after the current tab):

https://user-images.githubusercontent.com/34594853/189202403-cc339189-6f5c-4732-a5e3-35381db171cb.mov

Steps to reproduce

  1. Start ST in Safe Mode.
  2. Open three new tabs. The current tab should now be the third and rightmost tab.
  3. Use "Previous File" to navigate to the first or second tabs.
  4. Create a new tab. The new tab will appear after the third tab and not the first or second tabs.

Expected behavior

The tabs should be created after the current one (by default in Safe Mode).

Actual behavior

The tabs are created after the previously current tab.

Sublime Text build number

4134

Operating system & version

macOS 12.4

(Linux) Desktop environment and/or window manager

No response

Additional information

No response

OpenGL context information

No response

jason5122 avatar Sep 08 '22 18:09 jason5122

@jasonhan-vassar This is intended behaviour. The sheet stack is not updated while cycling through tabs using prev_view or next_view (super+pageup/down) until the primary modifier is released.

hartsublime avatar Sep 09 '22 00:09 hartsublime

Pressing another shortcut like new file before releasing the modifier should probably commit the selected tab as if the modifier was released.

BenjaminSchaaf avatar Sep 09 '22 04:09 BenjaminSchaaf

Pressing another shortcut like new file before releasing the modifier should probably commit the selected tab as if the modifier was released.

This behavior was added in build 4144.

valeriesubl avatar Jul 10 '24 04:07 valeriesubl