Macros | Functions
popupmnu.c File Reference
#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include "nvim/vim.h"
#include "nvim/api/private/helpers.h"
#include "nvim/ascii.h"
#include "nvim/eval/typval.h"
#include "nvim/popupmnu.h"
#include "nvim/charset.h"
#include "nvim/ex_cmds.h"
#include "nvim/memline.h"
#include "nvim/move.h"
#include "nvim/option.h"
#include "nvim/screen.h"
#include "nvim/ui_compositor.h"
#include "nvim/search.h"
#include "nvim/strings.h"
#include "nvim/memory.h"
#include "nvim/window.h"
#include "nvim/edit.h"
#include "nvim/ui.h"


#define PUM_DEF_HEIGHT   10
#define PUM_DEF_WIDTH   15


void pum_display (pumitem_T *array, int size, int selected, bool array_changed, int cmd_startcol)
void pum_redraw (void)
 Redraw the popup menu, using "pum_first" and "pum_selected". More...
void pum_undisplay (bool immediate)
 Undisplay the popup menu (later). More...
void pum_check_clear (void)
void pum_clear (void)
bool pum_visible (void)
bool pum_drawn (void)
void pum_invalidate (void)
 Screen was cleared, need to redraw next time. More...
void pum_recompose (void)
int pum_get_height (void)
void pum_set_boundings (dict_T *dict)

Detailed Description

Popup menu (PUM)

Macro Definition Documentation

#define PUM_DEF_HEIGHT   10
#define PUM_DEF_WIDTH   15

Function Documentation

void pum_check_clear ( void  )
void pum_clear ( void  )

Clear the popup menu. Currently only resets the offset to the first displayed item.

void pum_display ( pumitem_T array,
int  size,
int  selected,
bool  array_changed,
int  cmd_startcol 

Show the popup menu with items "array[size]". "array" must remain valid until pum_undisplay() is called! When possible the leftmost character is aligned with screen column "col". The menu appears above the screen line "row" or at "row" + "height" - 1.

selectedindex of initially selected item, none if out of range
array_changedif true, array contains different items since last call if false, a new item is selected, but the array is the same
cmd_startcolonly for cmdline mode: column of completed match
bool pum_drawn ( void  )
true if the popup menu is displayed and drawn on the grid.
int pum_get_height ( void  )

Gets the height of the menu.

the height of the popup menu, the number of entries visible. Only valid when pum_visible() returns TRUE!
void pum_invalidate ( void  )

Screen was cleared, need to redraw next time.

void pum_recompose ( void  )
void pum_redraw ( void  )

Redraw the popup menu, using "pum_first" and "pum_selected".

void pum_set_boundings ( dict_T dict)
void pum_undisplay ( bool  immediate)

Undisplay the popup menu (later).

bool pum_visible ( void  )
true if the popup menu is displayed.