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


#define PUM_DEF_HEIGHT   10


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_event_info (dict_T *dict)
 Add size information about the pum to "dict". More...

Detailed Description

Popup menu (PUM)

Macro Definition Documentation


#define PUM_DEF_HEIGHT   10

Function Documentation

◆ pum_check_clear()

void pum_check_clear ( void  )

◆ pum_clear()

void pum_clear ( void  )

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

◆ pum_display()

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 cursor column. 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

◆ pum_drawn()

bool pum_drawn ( void  )
true if the popup menu is displayed and drawn on the grid.

◆ pum_get_height()

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!

◆ pum_invalidate()

void pum_invalidate ( void  )

Screen was cleared, need to redraw next time.

◆ pum_recompose()

void pum_recompose ( void  )

◆ pum_redraw()

void pum_redraw ( void  )

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

◆ pum_set_event_info()

void pum_set_event_info ( dict_T dict)

Add size information about the pum to "dict".

◆ pum_undisplay()

void pum_undisplay ( bool  immediate)

Undisplay the popup menu (later).

◆ pum_visible()

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