I am seeing this in Vim 7.3. I have autoindent on. Sometimes, when I move some code to the next line, the indentation of the line it was originally on changes, and then the newly created line is set to match that indentation. I don't mind that the new line indentation matches the previous one, since that is what autoindent is for, but why is the line I was on randomly changing its indentation?
Here is an example. This is how the text is formatted before I make changes.
$sql= "
SELECT *
FROM temp_events
ORDER BY
Reader, Date, Time";
I want each ORDER BY column to be on its own line, so I move the cursor to the space in between "Reader, " and "Date", and press rEnter to replace the space with a new line character. This is the result:
$sql= "
SELECT *
FROM temp_events
ORDER BY
Reader,
Date, Time";
As you can see, instead of just making the new line match the indentation of the one above, it first changed the indentation of the line with "Reader" and then made the new line match this now incorrect indentation.
Here is what I was hoping would happen:
$sql= "
SELECT *
FROM temp_events
ORDER BY
Reader,
Date, Time";
Next, I would also move Time to its line.