patch 9.1.0484: Sorting of completeopt+=fuzzy is not stable
Problem: Sorting of completeopt+=fuzzy is not stable.
Solution: Compare original indexes when scores are the same.
(zeertzjq)
closes: #14988
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/structs.h b/src/structs.h
index f1bbf17..7e21f0f 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -4470,7 +4470,8 @@
char_u *pum_kind; // extra kind text (may be truncated)
char_u *pum_extra; // extra menu text (may be truncated)
char_u *pum_info; // extra info
- int pum_score; // fuzzy match score
+ int pum_score; // fuzzy match score
+ int pum_idx; // index of item before sorting by score
} pumitem_T;
/*