patch 9.0.1973: Clean up cmdline option completion code
Problem: Clean up cmdline option completion code
Solution: Fix various minor problems
- Fix manual array size calculations to just use `ARRAY_LENGTH()`.
- Fix unintentional typo in comments due to copy-paste error.
- Fix assert_equal() usages to pass the expected value to first
parameter instead of 2nd one to avoid confusion.
- Fix signed vs unsigned warnings
- Correct misplaced comments about set_op_T and set_prefix_T
and fix a typo in another comment
closes: #13249
closes: #13237
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
diff --git a/src/option.c b/src/option.c
index c1d80fa..ae2ca3a 100644
--- a/src/option.c
+++ b/src/option.c
@@ -1312,7 +1312,7 @@
}
/*
- * :set operator types
+ * :set boolean option prefix
*/
typedef enum {
PREFIX_NO = 0, // "no" prefix
@@ -1830,7 +1830,7 @@
&(options[opt_idx]), OPT_GLOBAL));
else
{
- ++arg; // joption_value2stringump to after the '=' or ':'
+ ++arg; // jump to after the '=' or ':'
// Set 'keywordprg' to ":help" if an empty
// value was passed to :set by the user.
@@ -7991,7 +7991,7 @@
return FAIL;
}
- int num_flags = STRLEN(option_val);
+ size_t num_flags = STRLEN(option_val);
if (num_flags == 0)
return FAIL;