Sublime Forum

Pressing tab moves the cursor to the end of page instead of inserting tab


Sometimes on pressing tab button the cursor reaches to the end of the page.
It happens every time after inserting a snippet.
I reinstalled sublime text but the problem still persists. Please help me solve this.



Open the sublime console (ctrl + `) and type sublime.log_commands(True) (press enter after this) & sublime.log_input(True) (press enter after this) and see what get’s logged (command & key binding) when you press tab



No output when I press tab. The cursor just moves to the output window. When I press tab again it jumps to the input area.



Close the console and then press tab in your main document file. Pressing tab when the console is open will toggle between console output & input.



When the tab works correctly it shows, the output is:

key evt: tab
command: insert_best_completion {“default”: “\t”, “exact”: false}

And when I reach end of file on pressing tab, the output is:

key evt: tab
command: next_field



I guess it is the same request as reported on Discord.

For the record:

The snippet content in question is:

#include <bits/stdc++.h>
using namespace std;

int32_t main() {


    return 0;

The solution:

You need to replace $1 by $0 to let ST know it’s the final caret position after inserting the snippet.

1 Like