Data Structures | Macros | Typedefs | Enumerations | Functions
sign.c File Reference
#include "nvim/vim.h"
#include "nvim/sign.h"
#include "nvim/ascii.h"
#include "nvim/buffer.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/ex_docmd.h"
#include "nvim/edit.h"
#include "nvim/fold.h"
#include "nvim/move.h"
#include "nvim/screen.h"
#include "nvim/syntax.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_UNPLACE,
  EXP_SIGN_NAMES
}
 

Functions

void init_signs (void)
 Initialize data needed for managing signs. More...
 
int sign_in_group (signlist_T *sign, const char_u *group)
 
int sign_group_get_next_signid (buf_T *buf, const char_u *groupname)
 Get the next free sign identifier in the specified group. More...
 
char_usign_typenr2name (int typenr)
 Get the name of a sign by its typenr. More...
 
dict_Tsign_get_info (signlist_T *sign)
 Return information about a sign in a Dict. More...
 
void buf_addsign (buf_T *buf, int id, const char_u *groupname, int prio, linenr_T lnum, int typenr)
 Add the sign into the signlist. Find the right spot to do it though. More...
 
linenr_T buf_change_sign_type (buf_T *buf, int markId, const char_u *group, int typenr)
 
int buf_getsigntype (buf_T *buf, linenr_T lnum, SignType type, int idx, int max_signs)
 
linenr_T buf_delsign (buf_T *buf, linenr_T atlnum, int id, char_u *group)
 
int buf_findsign (buf_T *buf, int id, char_u *group)
 
int buf_findsign_id (buf_T *buf, linenr_T lnum, char_u *groupname)
 Return the identifier of the sign at line number 'lnum' in buffer 'buf'. More...
 
void buf_delete_signs (buf_T *buf, char_u *group)
 Delete signs in buffer "buf". More...
 
void sign_list_placed (buf_T *rbuf, char_u *sign_group)
 List placed signs for "rbuf". If "rbuf" is NULL do it for all buffers. 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...
 
int sign_define_by_name (char_u *name, char_u *icon, char_u *linehl, char_u *text, char_u *texthl, char_u *numhl)
 Define a new sign or update an existing sign. More...
 
int sign_undefine_by_name (const char_u *name)
 Free the sign specified by 'name'. More...
 
int sign_place (int *sign_id, const char_u *sign_group, const char_u *sign_name, buf_T *buf, linenr_T lnum, int prio)
 Place a sign at the specified file location or update a sign. More...
 
int sign_unplace (int sign_id, char_u *sign_group, buf_T *buf, linenr_T atlnum)
 Unplace the specified sign. More...
 
linenr_T sign_jump (int sign_id, char_u *sign_group, buf_T *buf)
 Jump to a sign. More...
 
void ex_sign (exarg_T *eap)
 ":sign" command More...
 
void sign_getlist (const char_u *name, list_T *retlist)
 
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 sign_get_placed (buf_T *buf, linenr_T lnum, int sign_id, const char_u *sign_group, list_T *retlist)
 
int sign_get_attr (int typenr, SignType type)
 Gets highlighting attribute for sign "typenr" corresponding to "type". More...
 
char_usign_get_text (int typenr)
 
void free_signs (void)
 Undefine/free all signs. More...
 
char_uget_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...
 

Macro Definition Documentation

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

Typedef Documentation

typedef struct sign sign_T

Struct to hold the sign properties.

Enumeration Type Documentation

anonymous enum
Enumerator
EXP_SUBCMD 
EXP_DEFINE 
EXP_PLACE 
EXP_UNPLACE 
EXP_SIGN_NAMES 

Function Documentation

void buf_addsign ( buf_T buf,
int  id,
const char_u groupname,
int  prio,
linenr_T  lnum,
int  typenr 
)

Add the sign into the signlist. Find the right spot to do it though.

linenr_T buf_change_sign_type ( buf_T buf,
int  markId,
const char_u group,
int  typenr 
)
void buf_delete_signs ( buf_T buf,
char_u group 
)

Delete signs in buffer "buf".

linenr_T buf_delsign ( buf_T buf,
linenr_T  atlnum,
int  id,
char_u group 
)

Delete sign 'id' in group 'group' from buffer 'buf'. If 'id' is zero, then delete all the signs in group 'group'. Otherwise delete only the specified sign. If 'group' is '*', then delete the sign in all the groups. If 'group' is NULL, then delete the sign in the global group. Otherwise delete the sign in the specified group. Returns the line number of the deleted sign. If multiple signs are deleted, then returns the line number of the last sign deleted.

int buf_findsign ( buf_T buf,
int  id,
char_u group 
)

Find the line number of the sign with the requested id in group 'group'. If the sign does not exist, return 0 as the line number. This will still let the correct file get loaded.

int buf_findsign_id ( buf_T buf,
linenr_T  lnum,
char_u groupname 
)

Return the identifier of the sign at line number 'lnum' in buffer 'buf'.

int buf_getsigntype ( buf_T buf,
linenr_T  lnum,
SignType  type,
int  idx,
int  max_signs 
)

Gets a sign from a given line.

Return the type number of the sign at line number 'lnum' in buffer 'buf' which has the attribute specified by 'type'. Returns 0 if a sign is not found at the line number or it doesn't have the specified attribute.

Parameters
bufBuffer in which to search
lnumLine in which to search
typeType of sign to look for
idxif there multiple signs, this index will pick the n-th
max_signsthe number of signs, with priority for the ones
Returns
Identifier of the matching sign, or 0
void ex_sign ( exarg_T eap)

":sign" command

void free_signs ( void  )

Undefine/free all signs.

list_T* get_buffer_signs ( buf_T buf)

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

char_u* get_sign_name ( expand_T xp,
int  idx 
)

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

void init_signs ( void  )

Initialize data needed for managing signs.

void set_context_in_sign_cmd ( expand_T xp,
char_u arg 
)

Handle command line completion for :sign command.

int sign_define_by_name ( char_u name,
char_u icon,
char_u linehl,
char_u text,
char_u texthl,
char_u numhl 
)

Define a new sign or update an existing sign.

int sign_get_attr ( int  typenr,
SignType  type 
)

Gets highlighting attribute for sign "typenr" corresponding to "type".

dict_T* sign_get_info ( signlist_T sign)

Return information about a sign in a Dict.

void sign_get_placed ( buf_T buf,
linenr_T  lnum,
int  sign_id,
const char_u sign_group,
list_T retlist 
)

Get a list of signs placed in buffer 'buf'. If 'num' is non-zero, return the sign placed at the line number. If 'lnum' is zero, return all the signs placed in 'buf'. If 'buf' is NULL, return signs placed in all the buffers.

char_u* sign_get_text ( int  typenr)

Get text mark for sign "typenr". Returns NULL if there isn't one.

void sign_getlist ( const char_u name,
list_T retlist 
)

If 'name' is NULL, return a list of all the defined signs. Otherwise, return information about the specified sign.

int sign_group_get_next_signid ( buf_T buf,
const char_u groupname 
)

Get the next free sign identifier in the specified group.

int sign_in_group ( signlist_T sign,
const char_u group 
)

Returns TRUE if 'sign' is in 'group'. A sign can either be in the global group (sign->group == NULL) or in a named group. If 'group' is '*', then the sign is part of the group.

linenr_T sign_jump ( int  sign_id,
char_u sign_group,
buf_T buf 
)

Jump to a sign.

void sign_list_placed ( buf_T rbuf,
char_u sign_group 
)

List placed signs for "rbuf". If "rbuf" is NULL do it for all buffers.

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

Adjust a placed sign for inserted/deleted lines.

int sign_place ( int *  sign_id,
const char_u sign_group,
const char_u sign_name,
buf_T buf,
linenr_T  lnum,
int  prio 
)

Place a sign at the specified file location or update a sign.

char_u* sign_typenr2name ( int  typenr)

Get the name of a sign by its typenr.

int sign_undefine_by_name ( const char_u name)

Free the sign specified by 'name'.

int sign_unplace ( int  sign_id,
char_u sign_group,
buf_T buf,
linenr_T  atlnum 
)

Unplace the specified sign.