Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sure, as long as you don't mix them on one line (i.e. first indent, then align), because then differences between tab widths will still break alignment.


Not if you do it right:

   \t\tsome_func(arg1,
   \t\t          arg2,
   \t\t          argN)
will look right no matter what the tab width is.


I just realised my invalid belief was caused by experiencing dumb editors in the past, which wouldn't recognise aligning and would turn your example into:

  \t\tsome_func(arg1,
  \t\t\t   arg2,
  \t\t\t   argN)
I.e. they would replace all sequences of tab-width spaces with a tab character.


First indent and then align will retain alignment with different tab widths, because you only align things that are at the same indent level, so different tab widths in a tab indent / space align combination just move the whole aligned block left or right without affecting alignment.


I stand corrected.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: