Functions
extmark.c File Reference
#include <assert.h>
#include "nvim/api/extmark.h"
#include "nvim/buffer.h"
#include "nvim/buffer_updates.h"
#include "nvim/charset.h"
#include "nvim/decoration.h"
#include "nvim/extmark.h"
#include "nvim/globals.h"
#include "nvim/lib/kbtree.h"
#include "nvim/map.h"
#include "nvim/memline.h"
#include "nvim/pos.h"
#include "nvim/undo.h"
#include "nvim/vim.h"

Functions

uint64_t extmark_set (buf_T *buf, uint64_t ns_id, uint64_t *idp, int row, colnr_T col, int end_row, colnr_T end_col, Decoration *decor, bool right_gravity, bool end_right_gravity, ExtmarkOp op)
 
bool extmark_del (buf_T *buf, uint64_t ns_id, uint64_t id)
 
bool extmark_clear (buf_T *buf, uint64_t ns_id, int l_row, colnr_T l_col, int u_row, colnr_T u_col)
 
ExtmarkInfoArray extmark_get (buf_T *buf, uint64_t ns_id, int l_row, colnr_T l_col, int u_row, colnr_T u_col, int64_t amount, bool reverse)
 
ExtmarkInfo extmark_from_id (buf_T *buf, uint64_t ns_id, uint64_t id)
 
void extmark_free_all (buf_T *buf)
 
void u_extmark_copy (buf_T *buf, int l_row, colnr_T l_col, int u_row, colnr_T u_col)
 
void extmark_apply_undo (ExtmarkUndoObject undo_info, bool undo)
 undo or redo an extmark operation More...
 
void extmark_adjust (buf_T *buf, linenr_T line1, linenr_T line2, long amount, long amount_after, ExtmarkOp undo)
 
void extmark_splice (buf_T *buf, int start_row, colnr_T start_col, int old_row, colnr_T old_col, bcount_t old_byte, int new_row, colnr_T new_col, bcount_t new_byte, ExtmarkOp undo)
 
void extmark_splice_impl (buf_T *buf, int start_row, colnr_T start_col, bcount_t start_byte, int old_row, colnr_T old_col, bcount_t old_byte, int new_row, colnr_T new_col, bcount_t new_byte, ExtmarkOp undo)
 
void extmark_splice_cols (buf_T *buf, int start_row, colnr_T start_col, colnr_T old_col, colnr_T new_col, ExtmarkOp undo)
 
void extmark_move_region (buf_T *buf, int start_row, colnr_T start_col, bcount_t start_byte, int extent_row, colnr_T extent_col, bcount_t extent_byte, int new_row, colnr_T new_col, bcount_t new_byte, ExtmarkOp undo)
 

Function Documentation

◆ extmark_adjust()

void extmark_adjust ( buf_T buf,
linenr_T  line1,
linenr_T  line2,
long  amount,
long  amount_after,
ExtmarkOp  undo 
)

◆ extmark_apply_undo()

void extmark_apply_undo ( ExtmarkUndoObject  undo_info,
bool  undo 
)

undo or redo an extmark operation

◆ extmark_clear()

bool extmark_clear ( buf_T buf,
uint64_t  ns_id,
int  l_row,
colnr_T  l_col,
int  u_row,
colnr_T  u_col 
)

◆ extmark_del()

bool extmark_del ( buf_T buf,
uint64_t  ns_id,
uint64_t  id 
)

◆ extmark_free_all()

void extmark_free_all ( buf_T buf)

◆ extmark_from_id()

ExtmarkInfo extmark_from_id ( buf_T buf,
uint64_t  ns_id,
uint64_t  id 
)

◆ extmark_get()

ExtmarkInfoArray extmark_get ( buf_T buf,
uint64_t  ns_id,
int  l_row,
colnr_T  l_col,
int  u_row,
colnr_T  u_col,
int64_t  amount,
bool  reverse 
)

◆ extmark_move_region()

void extmark_move_region ( buf_T buf,
int  start_row,
colnr_T  start_col,
bcount_t  start_byte,
int  extent_row,
colnr_T  extent_col,
bcount_t  extent_byte,
int  new_row,
colnr_T  new_col,
bcount_t  new_byte,
ExtmarkOp  undo 
)

◆ extmark_set()

uint64_t extmark_set ( buf_T buf,
uint64_t  ns_id,
uint64_t *  idp,
int  row,
colnr_T  col,
int  end_row,
colnr_T  end_col,
Decoration decor,
bool  right_gravity,
bool  end_right_gravity,
ExtmarkOp  op 
)

Create or update an extmark

must not be used during iteration!

Returns
the internal mark id

◆ extmark_splice()

void extmark_splice ( buf_T buf,
int  start_row,
colnr_T  start_col,
int  old_row,
colnr_T  old_col,
bcount_t  old_byte,
int  new_row,
colnr_T  new_col,
bcount_t  new_byte,
ExtmarkOp  undo 
)

◆ extmark_splice_cols()

void extmark_splice_cols ( buf_T buf,
int  start_row,
colnr_T  start_col,
colnr_T  old_col,
colnr_T  new_col,
ExtmarkOp  undo 
)

◆ extmark_splice_impl()

void extmark_splice_impl ( buf_T buf,
int  start_row,
colnr_T  start_col,
bcount_t  start_byte,
int  old_row,
colnr_T  old_col,
bcount_t  old_byte,
int  new_row,
colnr_T  new_col,
bcount_t  new_byte,
ExtmarkOp  undo 
)

◆ u_extmark_copy()

void u_extmark_copy ( buf_T buf,
int  l_row,
colnr_T  l_col,
int  u_row,
colnr_T  u_col 
)

copy extmarks data between range

useful when we cannot simply reverse the operation. This will do nothing on redo, enforces correct position when undo.