/* vi:set ts=8 sts=4 sw=4 noet: * * VIM - Vi IMproved by Bram Moolenaar * * Do ":help uganda" in Vim to read copying and usage conditions. * Do ":help credits" in Vim to see a list of people who contributed. * See README.txt for an overview of the Vim source code. *//* * popupmnu.c: Popup menu (PUM) */#include"vim.h"#if defined(FEAT_INS_EXPAND) || defined(PROTO)staticpumitem_T*pum_array=NULL;/* items of displayed pum */staticintpum_size;/* nr of items in "pum_array" */staticintpum_selected;/* index of selected item or -1 */staticintpum_first=0;/* index of top item */staticintcall_update_screen=FALSE;staticintpum_height;/* nr of displayed pum items */staticintpum_width;/* width of displayed pum items */staticintpum_base_width;/* width of pum items base */staticintpum_kind_width;/* width of pum items kind column */staticintpum_extra_width;/* width of extra stuff */staticintpum_scrollbar;/* TRUE when scrollbar present */staticintpum_row;/* top row of pum */staticintpum_col;/* left column of pum */staticwin_T*pum_window=NULL;staticintpum_win_row;staticintpum_win_height;staticintpum_win_col;staticintpum_win_wcol;staticintpum_win_width;staticintpum_do_redraw=FALSE;// do redraw anywaystaticintpum_skip_redraw=FALSE;// skip redrawstaticintpum_set_selected(intn,intrepeat);#define PUM_DEF_HEIGHT 10staticvoidpum_compute_size(void){inti;intw;/* Compute the width of the widest match and the widest extra. */pum_base_width=0;pum_kind_width=0;pum_extra_width=0;for(i=0;i<pum_size;++i){w=vim_strsize(pum_array[