aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorTom Praschan <13141438+tom-anders@users.noreply.github.com>2022-04-07 16:14:02 +0200
committerTom Praschan <13141438+tom-anders@users.noreply.github.com>2022-04-09 15:39:46 +0200
commit45f62464d3e1f39e74fca627e27eea106ffe46ef (patch)
tree3ff4fdbd476d29c6427de9b3b02a63c0eb43b13a /runtime
parent233014f92b5d4d5bf8a6f019241aafd1b05dd383 (diff)
downloadrneovim-45f62464d3e1f39e74fca627e27eea106ffe46ef.tar.gz
rneovim-45f62464d3e1f39e74fca627e27eea106ffe46ef.tar.bz2
rneovim-45f62464d3e1f39e74fca627e27eea106ffe46ef.zip
vim-patch:8.2.4702: C++ scope labels are hard-coded
Problem: C++ scope labels are hard-coded. Solution: Add 'cinscopedecls' to define the labels. (Tom Praschan, closes vim/vim#10109) https://github.com/vim/vim/commit/3506cf34c17c5eae6c2d1317db1fcd5a8493c288
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/indent.txt8
-rw-r--r--runtime/doc/options.txt14
-rw-r--r--runtime/doc/quickref.txt1
-rw-r--r--runtime/optwin.vim3
4 files changed, 21 insertions, 5 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 b60b8f8849..123577778f 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1288,10 +1288,20 @@ 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.
+ This option is a list of comma-separated names.
These names are recognized:
*clipboard-unnamed*
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 c873252909..0e3f2d935e 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")