Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I've been seeing many questions and answers with the first line of a method or class indented by a negative amount. I haven't been able to reproduce it. Maybe someone on the team can look at and get some idea of what's different about that text?

In particular, trying to edit it to align it properly causes some really screwy results.

BTW, I'm using FireFox 3.5.8.

share|improve this question

That example seems to be using quasi-random numbers of blanks at the start of the line, leading to quasi-random indentation of the code. You can sometimes get odd effects if someone has managed to mix tabs and blanks, but that does not appear to be the problem with the example question.

Basically, people don't care enough about the layout of the code they're showing off. They'll have to hope it doesn't come back to bite them when they're applying for jobs.

share|improve this answer
The OP replied something about it being a problem with pasting from Visual Studio. Yet the text in the answer didn't look strange. No tabs, for instance. – John Saunders Feb 28 '10 at 23:52

I've seem similar issues in the past and assumed that it worked like this

  • Poster know that four space indent makes code
  • Poster types four space
  • Goes to IDE copies code
  • Pastes code, which doesn't do whay is expected
  • remembers (or reads the instructions) that the 01010101010101010101010101 button is what is wanted
  • selects code (including the indented first line
  • hits 010101010101010101010101011001
  • doesn't fix the first line.
share|improve this answer
That's the 0101010101010101010101010101010101010101010101010101 button. – Rosinante Mar 1 '10 at 2:01
@Rosinante: I'd upvote your comment, but it'd have a non-binary number. – Andrew Grimm Aug 23 '10 at 4:13

You must log in to answer this question.

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