aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-09 22:13:34 +0800
committerGitHub <noreply@github.com>2022-04-09 22:13:34 +0800
commitf3183a4d7c051e8062d28cfc9905b21e13bb7775 (patch)
treec1b15674392d50ce4b2f3d2f9c9ffe765373a69a /runtime
parent8055f9857b8e384634d457533dfdb08618fc36f0 (diff)
parentbf39c5fe4fcd54f32610849b5bacd129e449729d (diff)
downloadrneovim-f3183a4d7c051e8062d28cfc9905b21e13bb7775.tar.gz
rneovim-f3183a4d7c051e8062d28cfc9905b21e13bb7775.tar.bz2
rneovim-f3183a4d7c051e8062d28cfc9905b21e13bb7775.zip
Merge pull request #18023 from tom-anders/vim-8.2.4702
vim-patch:8.2.{4702,4703}: C++ scope labels are hard-coded
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/indent.txt8
-rw-r--r--runtime/doc/options.txt12
-rw-r--r--runtime/doc/quickref.txt1
-rw-r--r--runtime/optwin.vim3
4 files changed, 20 insertions, 4 deletions
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
index d0d4ddad32..3992b2d3d7 100644
--- a/runtime/doc/indent.txt
+++ b/runtime/doc/indent.txt
@@ -38,11 +38,12 @@ is not a C compiler: it does not recognize all syntax. One requirement is
that toplevel functions have a '{' in the first column. Otherwise they are
easily confused with declarations.
-These four options control C program indenting:
+These five options control C program indenting:
'cindent' Enables Vim to perform C program indenting automatically.
'cinkeys' Specifies which keys trigger reindenting in insert mode.
'cinoptions' Sets your preferred indent style.
'cinwords' Defines keywords that start an extra indent in the next line.
+'cinscopedecls' Defines strings that are recognized as a C++ scope declaration.
If 'lisp' is not on and 'equalprg' is empty, the "=" operator indents using
Vim's built-in algorithm rather than calling an external program.
@@ -289,8 +290,9 @@ The examples below assume a 'shiftwidth' of 4.
<
*cino-g*
gN Place C++ scope declarations N characters from the indent of the
- block they are in. (default 'shiftwidth'). A scope declaration
- can be "public:", "protected:" or "private:".
+ block they are in. (default 'shiftwidth'). By default, a scope
+ declaration is "public:", "protected:" or "private:". This can
+ be adjusted with the 'cinscopedecls' option.
cino= cino=g0 >
{ {
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index f21db25c28..8d353804a4 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1288,7 +1288,17 @@ A jump table for the options with a short description can be found at |Q_op|.
matter, include the keyword both the uppercase and lowercase:
"if,If,IF".
- *'clipboard'* *'cb'*
+ *'cinscopedecls'* *'cinsd'*
+'cinscopedecls' 'cinsd' string (default "public,protected,private")
+ local to buffer
+ {not available when compiled without the |+cindent|
+ feature}
+ Keywords that are interpreted as a C++ scope declaration by |cino-g|.
+ Useful e.g. for working with the Qt framework that defines additional
+ scope declarations "signals", "public slots" and "private slots": >
+ set cinscopedecls+=signals,public\ slots,private\ slots
+
+< *'clipboard'* *'cb'*
'clipboard' 'cb' string (default "")
global
This option is a list of comma-separated names.
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index e36eb2359f..c3badd5401 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -638,6 +638,7 @@ Short explanation of each option: *option-list*
'cinkeys' 'cink' keys that trigger indent when 'cindent' is set
'cinoptions' 'cino' how to do indenting when 'cindent' is set
'cinwords' 'cinw' words where 'si' and 'cin' add an indent
+'cinscopedecls' 'cinsd' words that are recognized by 'cino-g'
'clipboard' 'cb' use the clipboard as the unnamed register
'cmdheight' 'ch' number of lines to use for the command-line
'cmdwinheight' 'cwh' height of the command-line window
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index f3aae13a21..a13e945098 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -870,6 +870,9 @@ if has("cindent")
call append("$", "cinwords\tlist of words that cause more C-indent")
call append("$", "\t(local to buffer)")
call <SID>OptionL("cinw")
+ call append("$", "cinscopedecls\tlist of scope declaration names used by cino-g")
+ call append("$", "\t(local to buffer)")
+ call <SID>OptionL("cinsd")
call append("$", "indentexpr\texpression used to obtain the indent of a line")
call append("$", "\t(local to buffer)")
call <SID>OptionL("inde")