Data Structures | Macros | Typedefs | Enumerations | Functions
sign.c File Reference
#include "nvim/ascii.h"
#include "nvim/buffer.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/edit.h"
#include "nvim/ex_docmd.h"
#include "nvim/fold.h"
#include "nvim/highlight_group.h"
#include "nvim/move.h"
#include "nvim/option.h"
#include "nvim/screen.h"
#include "nvim/sign.h"
#include "nvim/syntax.h"
#include "nvim/vim.h"
#include "nvim/window.h"

Data Structures

struct  sign
 

Macros

#define SIGNCMD_DEFINE   0
 
#define SIGNCMD_UNDEFINE   1
 
#define SIGNCMD_LIST   2
 
#define SIGNCMD_PLACE   3
 
#define SIGNCMD_UNPLACE   4
 
#define SIGNCMD_JUMP   5
 
#define SIGNCMD_LAST   6
 

Typedefs

typedef struct sign sign_T
 Struct to hold the sign properties. More...
 

Enumerations

enum  {
  EXP_SUBCMD, EXP_DEFINE, EXP_PLACE, EXP_LIST,
  EXP_UNPLACE, EXP_SIGN_NAMES, EXP_SIGN_GROUPS
}
 

Functions

void init_signs (void)
 Initialize data needed for managing signs. More...
 
sign_attrs_Tsign_get_attr (SignType type, sign_attrs_T sattrs[], int idx, int max_signs)
 
int buf_get_signattrs (buf_T *buf, linenr_T lnum, sign_attrs_T sattrs[])
 
void buf_delete_signs (buf_T *buf, char_u *group)
 Delete signs in buffer "buf". More...
 
void sign_mark_adjust (linenr_T line1, linenr_T line2, long amount, long amount_after)
 Adjust a placed sign for inserted/deleted lines. More...
 
void ex_sign (exarg_T *eap)
 ":sign" command More...
 
list_Tget_buffer_signs (buf_T *buf) FUNC_ATTR_NONNULL_RET FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
 Returns information about signs placed in a buffer as list of dicts. More...
 
void free_signs (void)
 Undefine/free all signs. More...
 
char * get_sign_name (expand_T *xp, int idx)
 
void set_context_in_sign_cmd (expand_T *xp, char_u *arg)
 Handle command line completion for :sign command. More...
 
void f_sign_define (typval_T *argvars, typval_T *rettv, FunPtr fptr)
 "sign_define()" function More...
 
void f_sign_getdefined (typval_T *argvars, typval_T *rettv, FunPtr fptr)
 "sign_getdefined()" function More...
 
void f_sign_getplaced (typval_T *argvars, typval_T *rettv, FunPtr fptr)
 "sign_getplaced()" function More...
 
void f_sign_jump (typval_T *argvars, typval_T *rettv, FunPtr fptr)
 "sign_jump()" function More...
 
void f_sign_place (typval_T *argvars, typval_T *rettv, FunPtr fptr)
 "sign_place()" function More...
 
void f_sign_placelist (typval_T *argvars, typval_T *rettv, FunPtr fptr)
 "sign_placelist()" function. Place multiple signs. More...
 
void f_sign_undefine (typval_T *argvars, typval_T *rettv, FunPtr fptr)
 "sign_undefine()" function More...
 
void f_sign_unplace (typval_T *argvars, typval_T *rettv, FunPtr fptr)
 "sign_unplace()" function More...
 
void f_sign_unplacelist (typval_T *argvars, typval_T *rettv, FunPtr fptr)
 "sign_unplacelist()" function More...
 

Macro Definition Documentation

◆ SIGNCMD_DEFINE

#define SIGNCMD_DEFINE   0

◆ SIGNCMD_JUMP

#define SIGNCMD_JUMP   5

◆ SIGNCMD_LAST

#define SIGNCMD_LAST   6

◆ SIGNCMD_LIST

#define SIGNCMD_LIST   2

◆ SIGNCMD_PLACE

#define SIGNCMD_PLACE   3

◆ SIGNCMD_UNDEFINE

#define SIGNCMD_UNDEFINE   1

◆ SIGNCMD_UNPLACE

#define SIGNCMD_UNPLACE   4

Typedef Documentation

◆ sign_T

typedef struct sign sign_T

Struct to hold the sign properties.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
EXP_SUBCMD 
EXP_DEFINE 
EXP_PLACE 
EXP_LIST 
EXP_UNPLACE 
EXP_SIGN_NAMES 
EXP_SIGN_GROUPS 

Function Documentation

◆ buf_delete_signs()

void buf_delete_signs ( buf_T buf,
char_u group 
)

Delete signs in buffer "buf".

◆ buf_get_signattrs()

int buf_get_signattrs ( buf_T buf,
linenr_T  lnum,
sign_attrs_T  sattrs[] 
)

Return the attributes of all the signs placed on line 'lnum' in buffer 'buf'. Used when refreshing the screen. Returns the number of signs.

Parameters
bufBuffer in which to search
lnumLine in which to search
sattrsOutput array for attrs
Returns
Number of signs of which attrs were found

◆ ex_sign()

void ex_sign ( exarg_T eap)

":sign" command

◆ f_sign_define()

void f_sign_define ( typval_T argvars,
typval_T rettv,
FunPtr  fptr 
)

"sign_define()" function

◆ f_sign_getdefined()

void f_sign_getdefined ( typval_T argvars,
typval_T rettv,
FunPtr  fptr 
)

"sign_getdefined()" function

◆ f_sign_getplaced()

void f_sign_getplaced ( typval_T argvars,
typval_T rettv,
FunPtr  fptr 
)

"sign_getplaced()" function

◆ f_sign_jump()

void f_sign_jump ( typval_T argvars,
typval_T rettv,
FunPtr  fptr 
)

"sign_jump()" function

◆ f_sign_place()

void f_sign_place ( typval_T argvars,
typval_T rettv,
FunPtr  fptr 
)

"sign_place()" function

◆ f_sign_placelist()

void f_sign_placelist ( typval_T argvars,
typval_T rettv,
FunPtr  fptr 
)

"sign_placelist()" function. Place multiple signs.

◆ f_sign_undefine()

void f_sign_undefine ( typval_T argvars,
typval_T rettv,
FunPtr  fptr 
)

"sign_undefine()" function

◆ f_sign_unplace()

void f_sign_unplace ( typval_T argvars,
typval_T rettv,
FunPtr  fptr 
)

"sign_unplace()" function

◆ f_sign_unplacelist()

void f_sign_unplacelist ( typval_T argvars,
typval_T rettv,
FunPtr  fptr 
)

"sign_unplacelist()" function

◆ free_signs()

void free_signs ( void  )

Undefine/free all signs.

◆ get_buffer_signs()

list_T* get_buffer_signs ( buf_T buf)

Returns information about signs placed in a buffer as list of dicts.

◆ get_sign_name()

char* get_sign_name ( expand_T xp,
int  idx 
)

Function given to ExpandGeneric() to obtain the sign command expansion.

◆ init_signs()

void init_signs ( void  )

Initialize data needed for managing signs.

◆ set_context_in_sign_cmd()

void set_context_in_sign_cmd ( expand_T xp,
char_u arg 
)

Handle command line completion for :sign command.

◆ sign_get_attr()

sign_attrs_T* sign_get_attr ( SignType  type,
sign_attrs_T  sattrs[],
int  idx,
int  max_signs 
)

Return the sign attrs which has the attribute specified by 'type'. Returns NULL if a sign is not found with the specified attribute.

Parameters
typeType of sign to look for
sattrsSign attrs to search through
idxif there multiple signs, this index will pick the n-th out of the most max_signs sorted ascending by Id.
max_signsthe number of signs, with priority for the ones with the highest Ids.
Returns
Attrs of the matching sign, or NULL

◆ sign_mark_adjust()

void sign_mark_adjust ( linenr_T  line1,
linenr_T  line2,
long  amount,
long  amount_after 
)

Adjust a placed sign for inserted/deleted lines.