Sublime Forum

20100528 Beta

#1

20100528 is out now, with a few indentation related fixes. The ‘pasteAndInsert’ command (Ctrl+V) is better behaved now.

The tab key behaviour has been tweaked too: when pressing tab on a blank line, the indentation will be calculated automatically, rather than just inserting a single tab. This is done via a new command ‘reindent’, which can be used to reindent any selected block of text automatically, if you to bind it to a key explicitly.

0 Likes

#2

Nice. You even added trimAutomaticWhitespace. :wink:

Edit: the dynamic auto-indentation is quite erratic. For example, type this into a blank Python file using no manual indentation:if fdsa: if fdsa: fdsa else: fdsa if fdsa: fdsaThen delete and replace the colons in lines 2 and 4 one at a time and watch the tabs move around. Now undo so that everything is fine again, select all lines but the first one and perform a reindent on them. Again, the indentation gets messed up.

0 Likes

#3

This appears to be caused by turning trimAutomaticWhitespace off, I’ll fix that for the next beta

0 Likes

#4

20100529 is out now, which addresses this, and also fixed an annoying bug when pressing tab on a blank line with an unindented line above it.

0 Likes

#5

Funny bug. Thanks, dynamic indentation behaves for me now. However, one glitch remains that I described above:

(Specifically, all lines starting with else: are indented one tab too far.) I am not sure if I misunderstand the point of reindent, but I would say that reindenting a finely indented block should not visually change anything. Also, as far as my tests show, this one occurs irrespective of whether trimAutomaticWhitespace is on or off. :smile:

0 Likes

#6

Just to be sure, this is when using the ‘reindent’ command (you’ve bound it to a key?) on a block of text? If so, I think you’re right: it’d be better if it behaved like paseAndIndent when used on a block, keeping the relative indentation of the text within the block.

0 Likes

#7

Yes. I created a user key binding for it and used it on a multi-line selection.

0 Likes

#8

The new beta looks good. Haven’t had time to test it much, but I’m pretty happy about a lot of the fixes (like the improved bracket auto-matching behavior).

Two minor annoyances:
Firstly, I’d expect shifting lines by using ctrl+shift+up/down to automatically adjust their indentation. This is pretty standard in a lot of editors.

Secondly, the way I select a lot of lines usually involves going to the first character on the first line, then doing shift+down until I get to the line I want.
This causes a problem every time I copy paste lines, since Sublime assumes I want all the other lines indented more than the first line.
This is how I’ve selected text for years, and I’m pretty sure many others also do this, so this might be something we’d like to fix (although I’m not sure what a fix would look like, actually). I think other editors also support this, since I’ve never had this problem before, but it might be smart to check how e.g. Eclipse handles this.

0 Likes

#9

I’ve been watching these threads and in doing so I’ve been very scared to update so I’m still on 0501. Is there anyway to disable ALL of this indent aware functionality? 90% of it seems like it’s going to cause more annoyances than it’ll solve.

Can anyone give me a quick run down of what keys I’ll have to rebind and any settings I’ll have to disable to get rid of that functionality, as well as anything that can’t be turned off? Thanks.

0 Likes

#10

You shouldn’t see anything different if you switch out the bindings for pasteAndIndent with the usual paste (ctrl+v and ctrl+shift+v), and turn off trimAutomaticWhitespace in either the Default File Type setting or in the customized filetype.sublime file.
Which by the way I also both did, although I do see the usefulness of these, it irritates me at the present. (pasting with indent is very situation dependent and I usually paste from inside sublime where upon pasting everything now has double the whitespace)

0 Likes

#11

I really think that’s a great idea. It makes a lot more sense to have the indentation relative to the text within the block when pasting. That will make this feature much more solid.

0 Likes

#12

I am finding the Paste and insert incredibly annoying, how can i turn it off and the guessing of where the cursor is on hitting tab on a blank line.

With python the indentation is part of the flow control, and when i go to a new line i don’t want it to be the indentation of the previous line as that may be part of a loop, I want it to be that position minus one tab. Barring that can we have a way to turn it off?

This is just messing me up so much.

0 Likes

#13

My 2 cents:

Tab on a blank line is great, IMO, and a feature I’ve wanted for a while.
The other features are incredibly buggy, and usually cause me a lot more frustration than they solve. They’re good in theory, but just don’t work well in practice.

0 Likes

#14

all i really want is a setting so i can turn it off if i don’t like them.

It would be nice if all new features came with automatic config settings.

0 Likes

#15

@sztanpet sorry for the delayed response, but thanks for the info. I’ll probably update in a few days.

0 Likes