patch 9.1.1373: 'completeopt' checking logic can be simplified
Commit:
https://github.com/vim/vim/commit/c3fbaa086e338486673d4cffbcbd18466ad2ac09
Author: glepnir <[email protected]>
Date: Thu May 8 23:05:10 2025 +0200
patch 9.1.1373: 'completeopt' checking logic can be simplified
Problem: Flag checking logic uses a temporary variable and multiple
bitwise operations in insexpand.c
Solution: Consolidate into a single equality check using bitwise OR and
comparison (glepnir)
closes: #17276
Signed-off-by: glepnir <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/insexpand.c b/src/insexpand.c
index ade7bb772..3839586db 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -805,9 +805,7 @@ cfc_has_mode(void)
static int
is_nearest_active(void)
{
- unsigned int flags = get_cot_flags();
-
- return (flags & COT_NEAREST) && !(flags & COT_FUZZY);
+ return (get_cot_flags() & (COT_NEAREST | COT_FUZZY)) == COT_NEAREST;
}
/*
diff --git a/src/version.c b/src/version.c
index fb1f45b53..5b85a2bbd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1373,
/**/
1372,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1uD8a7-00GDKr-Sb%40256bit.org.