mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
vim-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: vim/vim#17276
c3fbaa086e
Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
@ -820,8 +820,7 @@ static inline void free_cptext(char *const *const cptext)
|
||||
/// Returns true if matches should be sorted based on proximity to the cursor.
|
||||
static bool is_nearest_active(void)
|
||||
{
|
||||
unsigned flags = get_cot_flags();
|
||||
return (flags & kOptCotFlagNearest) && !(flags & kOptCotFlagFuzzy);
|
||||
return (get_cot_flags() & (kOptCotFlagNearest|kOptCotFlagFuzzy)) == kOptCotFlagNearest;
|
||||
}
|
||||
|
||||
/// Repositions a match in the completion list based on its proximity score.
|
||||
|
Reference in New Issue
Block a user