Sublime Forum

Tabbing to/from find and replace input fields is adding tab characters to inputs

#1

When tabbing to input fields in find or find and replace panes, tab characters are getting added to the input that receives focus. This results in accidentally constructing invalid find strings and or replacing all with an extra tab character. It’s extremely frustrating for users who are habituated to tabbing for focus. I have to fix my search inputs almost every time I do it.

For multi-input panes, expected behavior would be to change focus without adding the tab character to the focused element.

For single-input panes, I’m not sure what the expected behavior would be, but 3143 behavior is to add the tab character without changing focus.

This behavior was observed using build 3143 running on Windows 10.

0 Likes

#2

Noticing that this behavior is applying to other things, too. For instance, hitting tab to do an autocomplete both completes the string and adds a tab character.

0 Likes

#3

My first guess would be either a key binding you’ve customized that doesn’t have a context to tell it not to take effect when things like the panels or autocomplete are open or an installed package that’s doing that on your behalf.

Since you say this happens in the find/replace panel, something to test would be to open the Sublime console with Ctrl+` or View > Show Console from the menu and enter this command:

sublime.log_commands(True)

(You can repeat the command with False instead of True to turn logging off, or just restart Sublime)

Once you’ve done that, open the Find/Replace panel and hit tab a few times to swap back and forth between the inputs, then open the console again.

You should see only the following in the console:

command: show_panel {"panel": "replace", "reverse": false}
command: show_panel {"panel": "console", "toggle": true}

The first command is opening the replace panel and the second one is showing the console. If you’re seeing tabs inserted, then I would think that probably you should also see something like calls to the insert or append commands appearing here as well in between the two, or possibly some plugin command which might help narrow down where the problem is coming from.

0 Likes

#4

let me guess, you’ve got multiple ST windows open when it happens, right?
sounds like this:

0 Likes

#5

Well, that’s interesting. While setting up to reproduce the problem, I accidentally closed the last window in Sublime, quitting the program (curse you, Windows). The behavior was gone when I started it back up.

I logged commands anyway and just had this result, so it doesn’t appear any additional commands were triggering.
command: move_to {“extend”: false, “to”: “bof”}
command: show_panel {“panel”: “replace”, “reverse”: false}
command: show_panel {“panel”: “console”, “toggle”: true}

I do usually have more than one window open at a time. I had been doing extensive RegEx search and replace in a very long HTML file in one window.

I tried opening three windows and couldn’t reproduce the problem.

0 Likes

#6

Didn’t fully read the bug. Bingo, that’s it. Leaving a dialog open in one of the windows reproduced the issue.

1 Like