Mercurial > vim
diff runtime/doc/develop.txt @ 15878:314694a2e74a
Update runtime files.
commit https://github.com/vim/vim/commit/4c92e75dd4ddb68dd92a86dd02d53c70dd4af33a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 17 21:18:32 2019 +0100
Update runtime files.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 17 Feb 2019 21:30:08 +0100 |
parents | 2f7e67dd088c |
children | 7e733046db1d |
line wrap: on
line diff
--- 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;