Mercurial > vim
comparison runtime/doc/indent.txt @ 28353:8bc8071928ed v8.2.4702
patch 8.2.4702: C++ scope labels are hard-coded
Commit: https://github.com/vim/vim/commit/3506cf34c17c5eae6c2d1317db1fcd5a8493c288
Author: Tom Praschan <13141438+tom-anders@users.noreply.github.com>
Date: Thu Apr 7 12:39:08 2022 +0100
patch 8.2.4702: C++ scope labels are hard-coded
Problem: C++ scope labels are hard-coded.
Solution: Add 'cinscopedecls' to define the labels. (Rom Praschan,
closes #10109)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 07 Apr 2022 13:45:04 +0200 |
parents | 4789f29c9595 |
children | 6dd88e45d47d |
comparison
equal
deleted
inserted
replaced
28352:10886e23615f | 28353:8bc8071928ed |
---|---|
40 Note that 'cindent' indenting does not work for every code scenario. Vim | 40 Note that 'cindent' indenting does not work for every code scenario. Vim |
41 is not a C compiler: it does not recognize all syntax. One requirement is | 41 is not a C compiler: it does not recognize all syntax. One requirement is |
42 that toplevel functions have a '{' in the first column. Otherwise they are | 42 that toplevel functions have a '{' in the first column. Otherwise they are |
43 easily confused with declarations. | 43 easily confused with declarations. |
44 | 44 |
45 These four options control C program indenting: | 45 These five options control C program indenting: |
46 'cindent' Enables Vim to perform C program indenting automatically. | 46 'cindent' Enables Vim to perform C program indenting automatically. |
47 'cinkeys' Specifies which keys trigger reindenting in insert mode. | 47 'cinkeys' Specifies which keys trigger reindenting in insert mode. |
48 'cinoptions' Sets your preferred indent style. | 48 'cinoptions' Sets your preferred indent style. |
49 'cinwords' Defines keywords that start an extra indent in the next line. | 49 'cinwords' Defines keywords that start an extra indent in the next line. |
50 'cinscopedecls' Defines strings that are recognized as a C++ scope declaration. | |
50 | 51 |
51 If 'lisp' is not on and 'equalprg' is empty, the "=" operator indents using | 52 If 'lisp' is not on and 'equalprg' is empty, the "=" operator indents using |
52 Vim's built-in algorithm rather than calling an external program. | 53 Vim's built-in algorithm rather than calling an external program. |
53 | 54 |
54 See |autocommand| for how to set the 'cindent' option automatically for C code | 55 See |autocommand| for how to set the 'cindent' option automatically for C code |
291 break; break; | 292 break; break; |
292 } } | 293 } } |
293 < | 294 < |
294 *cino-g* | 295 *cino-g* |
295 gN Place C++ scope declarations N characters from the indent of the | 296 gN Place C++ scope declarations N characters from the indent of the |
296 block they are in. (default 'shiftwidth'). A scope declaration | 297 block they are in. (default 'shiftwidth'). By default, a scope |
297 can be "public:", "protected:" or "private:". | 298 declaration is "public:", "protected:" or "private:". This can |
299 be adjusted with the 'cinscopedecls' option. | |
298 | 300 |
299 cino= cino=g0 > | 301 cino= cino=g0 > |
300 { { | 302 { { |
301 public: public: | 303 public: public: |
302 a = b; a = b; | 304 a = b; a = b; |