4

As well as slightly different images for the vote counts on question the SO questions pages, the code button in the question editing doesn't seem to be unindenting like it used to do.

Is it just me, or was there a conscious decision to stop unindenting, or was there a mistake of some sort in a recent update? (I spotted the problem with 'rev 2012.12.15.619'.)

I was trying to re-indent a question where the C code was about 4 tabstops too far over. I did what I'd normally do: selected the whole of the code and hit the {} button above the edit. A few lines shifted left; most didn't. In the recent past, the whole lot would have moved left. The code in question (I can't understand what is wrong the destructers — the grammar and spelling also need fixing) was indented with a mix of tabs and blanks.

2 Answers 2

4

After checking the code history, I can assure you that this was never handled correctly. The last time this file was touched was over two months ago with this bugfix.

However: To be honest, I never realized this was broken, and I agree with you that it should work (in particular since it was not only not handled; it was in fact handled incorrectly). Fix is made; this will be in the next build.

Shameless plug on the side: If you're a user script kind of guy, this script for changing the TAB key behavior may interest you.

1
  • OK; I take your word on it, though I've unindented enough code that I'm very surprised to hear that whatever I worked over on the last, say, 3 months didn't start with tabs. I'm very glad to hear that you've fixed or improved it. Commented Dec 15, 2012 at 14:56
2

The code in question [...] was indented with a mix of tabs and blanks.

This was the problem. The built-in code indent tool only handles spaces. So when you select it and hit the button, the lines beginning with spaces are de-indented - but the lines beginning with tabs are not. For code indented with spaces (AS THEY SHOULD BE), the button works as it always did.

See also: Automatically convert tabs to spaces in the original text

3
  • 1
    If everyone on SO was experienced with its rules w.r.t tabs vs blanks, I'd have no problem. However, we get a lot of newcomers and they haven't the first clue. It's a confounded nuisance for those of us willing to help, but hindered by SO not providing a tool to help us do the job. It would make life a lot pleasanter for those of us who do try to make other people's questions and answers look as good as possible if the SO toolset facilitated the process. Also, I'm 95% sure that there's been a change of behaviour in the editor; it handled messes of blanks and tabs OK yesterday, if I were asked. Commented Dec 15, 2012 at 5:21
  • It's definitely not new. See the link I posted, and the links attached to that one; mixed tab-space indentation has been a pain in the... wrist... for a long time now.
    – Shog9 Mod
    Commented Dec 15, 2012 at 5:28
  • It seems it has always behaved thus; I have to take everyone's word for it, but I'm astonished to only run into the problem now after as much editing as I've done. Commented Dec 15, 2012 at 14:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .