diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-02-17 21:18:32 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-02-17 21:18:32 +0100 |
commit | 4c92e75dd4ddb68dd92a86dd02d53c70dd4af33a (patch) | |
tree | 854789544d45595f5bbd76e86151f5ae42488525 /runtime/doc/develop.txt | |
parent | a5483448cba6997517003a22a8029f0de1007d0e (diff) |
Update runtime files.
Diffstat (limited to 'runtime/doc/develop.txt')
-rw-r--r-- | runtime/doc/develop.txt | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index b1b3cc49ec..2d0cc2278d 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -1,4 +1,4 @@ -*develop.txt* For Vim version 8.1. Last change: 2018 May 02 +*develop.txt* For Vim version 8.1. Last change: 2019 Feb 17 VIM REFERENCE MANUAL by Bram Moolenaar @@ -355,6 +355,24 @@ OK: if (cond) cmd; } +When a block has one line the braces can be left out. When an if/else has +braces on one block, it usually looks better when the other block also has +braces: +OK: if (cond) + cmd; + else + cmd; + +OK: if (cond) + { + cmd; + } + else + { + cmd; + cmd; + } + Use ANSI (new style) function declarations with the return type on a separate indented line. @@ -367,10 +385,10 @@ OK: /* */ int function_name( - int arg1, /* short comment about arg1 */ - int arg2) /* short comment about arg2 */ + int arg1, // short comment about arg1 + int arg2) // short comment about arg2 { - int local; /* comment about local */ + int local; // comment about local local = arg1 * arg2; |