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)
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
index 6e8f35b..69a03f9 100644
--- a/runtime/doc/indent.txt
+++ b/runtime/doc/indent.txt
@@ -42,11 +42,12 @@
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.
@@ -293,8 +294,9 @@
<
*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 d5e5e68..8b20211 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1661,13 +1661,23 @@
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 "autoselect,exclude:cons\|linux"
for X-windows, "" otherwise)
global
{only in GUI versions or when the |+xterm_clipboard|
feature is included}
- This option is a list of comma separated names.
+ This option is a list of comma-separated names.
Note: if one of the items is "exclude:", then you can't add an item
after that. Therefore do append an item with += but use ^= to
prepend, e.g.: >
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index e532942..279e3d5 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -643,6 +643,7 @@
'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 d138ab1..9b4868f 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -624,6 +624,8 @@
if has("gui")
call <SID>AddOption("mousehide", gettext("hide the mouse pointer while typing"))
call <SID>BinOptionG("mh", &mh)
+ call <SID>AddOption("mousemoveevent", gettext("report mouse movement events"))
+ call <SID>BinOptionG("mousemev", &mousemev)
endif
call <SID>AddOption("mousemodel", gettext("\"extend\", \"popup\" or \"popup_setpos\"; what the right\nmouse button is used for"))
call <SID>OptionG("mousem", &mousem)
@@ -927,6 +929,9 @@
call <SID>AddOption("cinwords", gettext("list of words that cause more C-indent"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>OptionL("cinw")
+ call <SID>AddOption("cinscopedecls", gettext("list of scope declaration names used by cino-g"))
+ call append("$", "\t" .. s:local_to_buffer)
+ call <SID>OptionL("cinsd")
call <SID>AddOption("indentexpr", gettext("expression used to obtain the indent of a line"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>OptionL("inde")