It may also be a factor of tabs vs. spaces. Since3 you used tabs, but the diff indents your line by one space, then lines that had a single-width leading tab after the last non-whitespace all the sudden appear off by 7, compared to all leading multi-width tabs which merely get represented with one less tab. So what looks aligned in the editor ends up looking weird in the diff. Always using spaces resolves the problems (everything is uniformly shifted right by one column).
Yes, that explain it: the shifted lines are featuring a single space width tab character after the last non-white character. The space added by diff is completing the tab width and it "jumps" to the next one. Interesting.. this is something I will keep in mind for the future :) Thanks.