aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2023-12-16 22:14:28 +0100
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2023-12-18 16:22:13 +0100
commit6cb78e2d1c4c6c63c628c965076a07ce5f7adbb6 (patch)
tree20bfbe8b317fde86121fcf9af10975b2b95e5758 /runtime
parent8c173cec295cf8c78bdbc440dc87f0473560f69a (diff)
downloadrneovim-6cb78e2d1c4c6c63c628c965076a07ce5f7adbb6.tar.gz
rneovim-6cb78e2d1c4c6c63c628c965076a07ce5f7adbb6.tar.bz2
rneovim-6cb78e2d1c4c6c63c628c965076a07ce5f7adbb6.zip
docs: add style rule regarding initialization
Specifically, specify that each initialization should be done on a separate line.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/dev_style.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/runtime/doc/dev_style.txt b/runtime/doc/dev_style.txt
index 02fd07ce24..ee8a2a3c3b 100644
--- a/runtime/doc/dev_style.txt
+++ b/runtime/doc/dev_style.txt
@@ -73,6 +73,24 @@ should be used instead of declaration and assignment, e.g. >c
int j = g(); // GOOD: declaration has initialization.
+Initialization ~
+
+Multiple declarations can be defined in one line if they aren't initialized,
+but each initialization should be done on a separate line.
+
+>c
+ int i;
+ int j; // GOOD
+
+ int i, j; // GOOD: multiple declarations, no initialization.
+
+ int i = 0;
+ int j = 0; // GOOD: one initialization per line.
+
+ int i = 0, j; // BAD: multiple declarations with initialization.
+
+ int i = 0, j = 0; // BAD: multiple declarations with initialization.
+
==============================================================================
Nvim-Specific Magic