3 ms·
I find this unacceptable: int func( type arg, type arg); Specifically, the space there after ( . Syntax-aware editors already handle this for
by kazinator 8y ago
I find this unacceptable:
int func( type arg,
type arg);
Specifically, the space there after ( . Syntax-aware editors already handle this formatting situation fine.
The remaining use case for this elastic business is aligning reams of comments on the right side.
The best solution solution is not to write those. They are never needed in code, but sometimes they can be beneficial in data structure declarations.
The elastic effect shown can be a achieved without tabs. The text editor simply recognizes that multiple lines have aligned comments, and maintains that with spaces. However, that still leaves the version problem/infelicity that semantic changes to one line trigger surrounding whitespace changes.
The best solution is to leave enough space for the longest declaration you would ever use. Anything longer is then split into multiple lines.
struct foo {
int magic; /* magic number */
int x, y; /* coordinates in bar space */
void (*sudden_big_decl)(struct foo *, /* Phew, That was close! */
int, int, /* Good thing we left all that room. */
double);
};