patch 9.1.0754: fixed order of items in insert-mode completion menu
Problem: fixed order of items in insert-mode completion menu
Solution: Introduce the 'completeitemalign' option with default
value "abbr,kind,menu" (glepnir).
Adding an new option `completeitemalign` abbr is `cia` to custom
the complete-item order in popupmenu.
closes: #14006
closes: #15760
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/insexpand.c b/src/insexpand.c
index 63bf070..a774a33 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -88,15 +88,6 @@
#endif
/*
- * Array indexes used for cp_text[].
- */
-#define CPT_ABBR 0 // "abbr"
-#define CPT_MENU 1 // "menu"
-#define CPT_KIND 2 // "kind"
-#define CPT_INFO 3 // "info"
-#define CPT_COUNT 4 // Number of entries
-
-/*
* Structure used to store one match for insert completion.
*/
typedef struct compl_S compl_T;
@@ -1338,8 +1329,7 @@
}
if (compl->cp_text[CPT_ABBR] != NULL)
- compl_match_array[i].pum_text =
- compl->cp_text[CPT_ABBR];
+ compl_match_array[i].pum_text = compl->cp_text[CPT_ABBR];
else
compl_match_array[i].pum_text = compl->cp_str;
compl_match_array[i].pum_kind = compl->cp_text[CPT_KIND];