📄 projects
字号:
* wishlist from tarjeij@ulrik.uio.no struct a { /* Cuddling variable with declaration independent of other */ int b; /* settings */ } c; if (condition) /* Force a blank line after single statement ifs. */ whatever; /* force single statment to begin on new line */ while (*c = *p) /* Force semicolon on new line. Same with for and if */ ; /* (Force single statement while, do, to begin statement /* on new line) */* Remove support for `+' option prefix.* Consider an option to use spaces rather than tabs in output.* 'whitesmiths style', apparently after the examples shipped with that firm's compiler. It differs from the GNU style mainly in that the statements inside braces are lined up with the braces. E.g.: int main(int argc, char *argv[]) { if (argc <= 1) printf("No args\n"); else { switch (argc) { case 2: printf("One arg\n"); break; default: printf("Lotsa args\n"); break; } } return EXIT_SUCCESS; }* Perhaps indent could process C++ comments ("//")? Apparently, some versions of C use this as well.* Someone requested an option to keep cases statments all on one line.* Consider an option to produce "char* c" rather than "char *c"* There is no way to specify that a unary & (as in address-of operator) not preceed it's argument by a space.[rms: I agree that is a desirable mode we should support somehow.]* It would be nice to have a different line length for comments than for code.[rms: I agree that is a desirable mode we should support somehow.It should not be terribly hard.]* Indent gets confused by a multiple "C" statements nested in a macro: This line: CHECK_ZERO(rpmsg->rip_res, tracef(" reserved fields not zero"); break ); yields these errors: ../rip.c: 115: Unbalanced parens ../rip.c: 115: Line broken ../rip.c: 115: Extra )[rms: Code like this appears in other programs too.For example, toplev.c in GCC. So it is important not to get too upsetwhen things like this appear in the input.]Add a new option specifying how goto labels are indented.Make it so that the line numbers indent reports are the real linenumbers (currently it is often off by a few).Error recover should probably be enhanced. At a minimum, "indentfoo.c" should not overwrite foo.c when it gets an error. Fancy errorrecover is probably not worth the effort because indent is prettyfast. Stopping after the first error might be more helpful than thecurrent error cascades.Make the -nss option cause while (foo) ;This is the real alternative to while (foo) ;Look at all the undocumented options, and determine which of them arebug-free enough that they should be documented. 1) Is it possible to control how indent puts white space *within*an expression? I notice that "(x*y<5)" comes out like "(x * y < 5)". CanI configure "indent" to put spaces around "the following list of characters"and do not put spaces around "the following list of characters"? I.E. CanI make it put spaces around "< > + - || &&" and *not* put spaces around"* / ^ &", etc. ?Consider leaving the spacing between the preprocessor# and the "if", "endif", etc. and indent that line as if it werea regular if () in C.Thus, givenmain(){ int x = 1, y = 1, z = 1; if (x) if (y) if (z)# ifdef FOO printf("hello\n");# else FOO printf("world\n");# endif FOO}main(){ int x = 1, y = 1, z = 1; if (x) if (y) if (z)# ifdef FOO printf("hello\n");# else /* FOO */ printf("world\n");# endif /* FOO */}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -