mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
api/buffer: add "on_bytes" callback to nvim_buf_attach
This implements byte-resolution updates of buffer changes. Note: there is no promise that the buffer state is valid inside the callback!
This commit is contained in:
@@ -20,6 +20,9 @@ typedef struct
|
||||
|
||||
typedef kvec_t(ExtmarkInfo) ExtmarkInfoArray;
|
||||
|
||||
// TODO(bfredl): good enough name for now.
|
||||
typedef ptrdiff_t bcount_t;
|
||||
|
||||
|
||||
// delete the columns between mincol and endcol
|
||||
typedef struct {
|
||||
@@ -29,9 +32,9 @@ typedef struct {
|
||||
colnr_T old_col;
|
||||
int new_row;
|
||||
colnr_T new_col;
|
||||
size_t start_byte;
|
||||
size_t old_byte;
|
||||
size_t new_byte;
|
||||
bcount_t start_byte;
|
||||
bcount_t old_byte;
|
||||
bcount_t new_byte;
|
||||
} ExtmarkSplice;
|
||||
|
||||
// adjust marks after :move operation
|
||||
@@ -42,6 +45,9 @@ typedef struct {
|
||||
int extent_col;
|
||||
int new_row;
|
||||
int new_col;
|
||||
bcount_t start_byte;
|
||||
bcount_t extent_byte;
|
||||
bcount_t new_byte;
|
||||
} ExtmarkMove;
|
||||
|
||||
// extmark was updated
|
||||
|
Reference in New Issue
Block a user