0
0
mirror of https://github.com/vim/vim.git synced 2025-11-16 23:24:03 -05:00

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>
This commit is contained in:
glepnir
2024-10-01 20:32:12 +02:00
committed by Christian Brabandt
parent e021f39b79
commit 6a89c94a9e
20 changed files with 326 additions and 41 deletions

View File

@@ -87,15 +87,6 @@ static char *ctrl_x_mode_names[] = {
};
#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.
*/
@@ -1338,8 +1329,7 @@ ins_compl_build_pum(void)
}
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];