Sublime Forum

Next Line Tab Undone As You Start Typing

#1

I’m using PHP Syntax mode for this. Sometimes it does it in HTML also.

Let’s say you started typing something of the following (step 1)

<div class="foo">|

and then you hit enter (step 2)

<div class="foo">
| 

As it should. That part works great. However, if you hit tab (step 3)

<div class="foo">
    |

And then start typing, the tab indent will delete itself taking you back to step 2

<div class="foo">
<div class="bar">|

when it should have continued where it was at from step 3

<div class="foo">
    <div class="bar">|

I know this isn’t a major thing, but considering that it’s almost had to become habit to hit home, then tab and then end again in order to continue keeping the indent where I want it, this is quite frustrating.

Sorry if this is a re-post, but I searched the forums for about 5 minutes prior to this to see if anyone had found a fix for it, and didn’t see anything that had been talked about before. If someone has a really simple fix for this, I’d be really greatful.

Thanks

0 Likes

Sublime cancels my tab
Sublime loses indentation when I type (with video)
#2

I believe this has been reported before here before, the replies there might help you:

oddly enough, I can’t seem to replicate the problem at the moment on build 3126… probably I’ve changed something in my setup and have forgotten / can’t find it now :wink:

0 Likes

#3

Maybe I need to uninstall the Addons I have installed … one of them might be causing it (Package Handler).

I don’t think it’s one of these though.

  • DocBlockr
  • Material Theme
  • SFTP (WBond)
  • DeleteBlankLines
  • jQuery bundle

I’ll give it a whirl when I get a chance. Thanks for the link.

0 Likes

#4

Update:

I noticed where it’s doing it and I can get it to do it over and over.

Indent the tag away from position 0 (left side).

*        <div class="foo">|

Hit Enter

*        <div class="foo">
*        |

Now delete everything back to the beginning of that line.

*        <div class="foo">
*|

Hit Tab

*        <div class="foo">
*            |

Start typing

*        <div class="foo">
*        <div class="bar">|

Sometimes randomly it’ll do it on a direct return, but I had to actually follow my normal habits in order to find it… kinda like you can’t tell someone how to get somewhere, but you can get there blind folded.

Give that a shot, see what it does for you :slightly_smiling:

Edit: It also happens if you Up Arrow into that line, and since there’s nothing written on the line, it snaps to position 0. Hitting Tab to snap you to the correct indention point will cause the bug to fire.

1 Like

#5

Those recreation steps work for me as well. The fix that @kingkeith mentions in the referenced post above stops it from doing that, though.

Based on some (not at all exhaustive) testing, if you turn auto_indent off (it’s on by default), then this does not happen; When you hit your third step above, you have to hit Tab twice in order to get to the correct column, and then it does not jump backwards when you start the tag.

That’s not much of a fix though, but it may be an indication that the indent/unindent patterns and the auto-indent that the editor provides don’t play well together.

1 Like

#6

I noticed that. Hitting backspace, and then Tab again will also defeat the bug. Much easier to reach than having to hit Home and End.

0 Likes