summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-01-18 15:53:19 +0100
committerBram Moolenaar <Bram@vim.org>2020-01-18 15:53:19 +0100
commit6b915c0c0ee7ef82f8d3d310a4345e098cb929b0 (patch)
tree426ab78922c56f48bd65ac7877d1f0a73c53d094 /src/option.c
parent3029bcc094415243bad14e5720f68e857b755dad (diff)
downloadvim-git-6b915c0c0ee7ef82f8d3d310a4345e098cb929b0.tar.gz
patch 8.2.0128: cannot list options one per linev8.2.0128
Problem: Cannot list options one per line. Solution: Use ":set!" to list one option per line.
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/option.c b/src/option.c
index 7c37326f9..e24181af1 100644
--- a/src/option.c
+++ b/src/option.c
@@ -1066,6 +1066,27 @@ set_title_defaults(void)
}
#endif
+ void
+ex_set(exarg_T *eap)
+{
+ int flags = 0;
+
+ if (eap->cmdidx == CMD_setlocal)
+ flags = OPT_LOCAL;
+ else if (eap->cmdidx == CMD_setglobal)
+ flags = OPT_GLOBAL;
+#if defined(FEAT_EVAL) && defined(FEAT_BROWSE)
+ if (cmdmod.browse && flags == 0)
+ ex_options(eap);
+ else
+#endif
+ {
+ if (eap->forceit)
+ flags |= OPT_ONECOLUMN;
+ (void)do_set(eap->arg, flags);
+ }
+}
+
/*
* Parse 'arg' for option settings.
*
@@ -4349,7 +4370,7 @@ showoptions(
#define INC 20
#define GAP 3
- items = ALLOC_MULT(struct vimoption *, PARAM_COUNT);
+ items = ALLOC_MULT(struct vimoption *, OPTION_COUNT);
if (items == NULL)
return;
@@ -4364,9 +4385,10 @@ showoptions(
msg_puts_title(_("\n--- Options ---"));
/*
- * do the loop two times:
+ * Do the loop two times:
* 1. display the short items
* 2. display the long items (only strings and numbers)
+ * When "opt_flags" has OPT_ONECOLUMN do everything in run 2.
*/
for (run = 1; run <= 2 && !got_int; ++run)
{
@@ -4377,12 +4399,12 @@ showoptions(
for (p = &options[0]; p->fullname != NULL; p++)
{
// apply :filter /pat/
- if (message_filtered((char_u *) p->fullname))
+ if (message_filtered((char_u *)p->fullname))
continue;
varp = NULL;
isterm = istermoption(p);
- if (opt_flags != 0)
+ if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) != 0)
{
if (p->indir != PV_NONE && !isterm)
varp = get_varp_scope(p, opt_flags);
@@ -4394,7 +4416,9 @@ showoptions(
|| (all == 1 && !isterm)
|| (all == 0 && !optval_default(p, varp, p_cp))))
{
- if (p->flags & P_BOOL)
+ if (opt_flags & OPT_ONECOLUMN)
+ len = Columns;
+ else if (p->flags & P_BOOL)
len = 1; // a toggle option fits always
else
{