32

I am using Sublime Text 3 and every time I press tab it will add an extra tab. My settings are to display tabs as an actual tab (not spaces) and is equivalent to 4 spaces. My issue causes a single tab to therefore create 2 tabs the length of 8 spaces.

For example, if I am trying to indent it will tab twice and I will have to delete one tab. If I select a block of text it will indent it twice and result in the text being deleted and I have to undo it once to bring the text back.

Also, when using auto complete I normally hit tab to auto complete the first option. It will select the option and do a tab after it. I am not sure if this is an option or setting but its extremely annoying and I have not found a solution yet.

skovy
  • 5,430
  • 2
  • 20
  • 34

5 Answers5

50
  • Sublime Text double tabs on tab key press
  • Sublime Text deletes/removes text on indentation / tab

Both problems are due to a popup (most often the SFTP free version popup for me) hiding in the background. If you make sure to close the popup windows every time they appear you will not get these issues. You could also pay for Sublime or the plugin to remove the popups.

In OSX you can't focus back on Sublime Text without clicking on the popup, so you will never have these problems.

Mattis
  • 5,026
  • 3
  • 34
  • 51
  • When making a selecting within a line (even if it's from the beginning of the line till the end of the line), I've noticed that Sublime removes the selection content and replaces it with a tab, rather than indenting the line. Perhaps that could be related to the problem? – Winfried Jan 02 '15 at 11:46
  • 1
    I can confirm as well that licensing the SFTP plugin gets rid of the double tab issue. I do wonder if the same pop-up, of Sublime Text's evaluation notification, triggers the same bug in Sublime. – Winfried Jan 02 '15 at 11:48
  • 5
    This is the correct answer. Sure, the accepted answer of closing and restarting ST will 'fix' the issue, but that's more drastic of a step than is needed. – imkingdavid Mar 17 '15 at 15:37
  • 1
    Definitely agree that this is the best answer. Sublime SFTP is forever popping up a dialog in the background and causing me this issue. – Ketzak Jan 14 '16 at 20:24
  • 1
    In my case, the issue turned out to be due to the popup from Sublime itself asking to buy a license, which had appeared in the background without me noticing somehow. Closing the window fixed the double tab issue. – Antimony Jul 24 '17 at 19:06
  • 1
    Haha this actually was the issue! The free version popup from Sublime. OMG. – kiradotee Sep 26 '17 at 08:18
  • 1
    Great answer, in fact so good that I found it now and realised that I had already upvoted it several years ago – Toivo Säwén Apr 08 '20 at 15:00
  • damn imagine being the first one to find this, thank you dude, u saved me minutes – RegularGuy May 26 '22 at 20:35
24

I just had the same issue. I just restarted Sublime and it worked again, no need to reinstall or change any settings.

ravisorg
  • 482
  • 3
  • 5
  • 10
    See Mattis answer below, I can reproduce it every time. If I close the popup window, the error goes away, if it appears again, the error comes back. http://stackoverflow.com/a/26658156/394012 – Please treat your mods well. Jan 27 '15 at 18:05
  • It is possible you experienced this issue - https://stackoverflow.com/a/29690942/236718 – Dom Jul 13 '17 at 23:36
11

I just encountered this problem recently, and it appears to only happen on Windows. In my case, the pop-up "Hello! would you like to purchase sublime?" was open in the background, and that caused this issue for me. Once that pop-up is closed, everything works just fine.

7

Although the question is three months old at the time of writing, this might help people that are still looking for an answer. After having this issue for a while, it annoyed me so much that I traced back the issue.

The double tab issue only happened after a while, so I figured it was triggered by a certain key combination, being pressed wrongly. I've also noticed that the bug only occurred at Windows, not on Linux (Ubuntu).

After disabling all Sublime Text 3 plugins one by one, I've noticed that, for me, SFTP triggered the bug. This happened upon saving, SFTP started uploading, and displayed a evaluation notice. As I've purchased SFTP (and activated it), the double tab bug never occurred again. Even after enabling all other packages, the double tab never troubled again.

This is only one solution to the problem, your problem might originate from something else. Try to disable packages which might cause the problem and try to find the problem that way. It's a lot of work, but might get you the solution.

Winfried
  • 9,243
  • 4
  • 26
  • 24
  • I also used the SFTP package so that is a very likely cause. (Note: this is only 3 months old, not a year) But thank you for the answer! – skovy Sep 18 '14 at 17:13
  • Thanks! For me it was an xml linter, was bugging me with the double tabs. – Dave Sep 20 '14 at 04:22
  • Three months indeed, my bad. Glad to be of help, guys! – Winfried Sep 21 '14 at 14:53
  • I added another answer with my findings. I think it's the correct reason why it happens. – Mattis Jan 02 '15 at 11:16
  • I had the same symptom and essentially the same cause but a different root cause. For me it was a replace in files dialogue - I'd clicked off it and assumed it was the same as clicking cancel so redid it, this time clicking Replace. The dialogue that I originally "closed" was the cause - it was just sat in the background, doing nothing. Bringing it into focus and cancelling resolved the issue. – ClarkeyBoy Apr 24 '18 at 13:46
-1

This solution worked for me on windows:

Just go to

View -> Layout -> Single 

enter image description here

WordCent
  • 725
  • 3
  • 18