mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 23:18:33 +00:00
lua: support getting UTF-32 and UTF-16 sizes of replaced text
This commit is contained in:
@@ -459,8 +459,9 @@ typedef struct {
|
||||
LuaRef on_lines;
|
||||
LuaRef on_changedtick;
|
||||
LuaRef on_detach;
|
||||
bool utf_sizes;
|
||||
} BufUpdateCallbacks;
|
||||
#define BUF_UPDATE_CALLBACKS_INIT { LUA_NOREF, LUA_NOREF, LUA_NOREF }
|
||||
#define BUF_UPDATE_CALLBACKS_INIT { LUA_NOREF, LUA_NOREF, LUA_NOREF, false }
|
||||
|
||||
#define BUF_HAS_QF_ENTRY 1
|
||||
#define BUF_HAS_LL_ENTRY 2
|
||||
@@ -802,12 +803,24 @@ struct file_buffer {
|
||||
|
||||
kvec_t(BufhlLine *) b_bufhl_move_space; // temporary space for highlights
|
||||
|
||||
// array of channelids which have asked to receive updates for this
|
||||
// array of channel_id:s which have asked to receive updates for this
|
||||
// buffer.
|
||||
kvec_t(uint64_t) update_channels;
|
||||
// array of lua callbacks for buffer updates.
|
||||
kvec_t(BufUpdateCallbacks) update_callbacks;
|
||||
|
||||
// whether an update callback has requested codepoint size of deleted regions.
|
||||
bool update_need_codepoints;
|
||||
|
||||
// Measurements of the deleted or replaced region since the last update
|
||||
// event. Some consumers of buffer changes need to know the byte size (like
|
||||
// tree-sitter) or the corresponding UTF-32/UTF-16 size (like LSP) of the
|
||||
// deleted text.
|
||||
size_t deleted_bytes;
|
||||
size_t deleted_codepoints;
|
||||
size_t deleted_codeunits;
|
||||
|
||||
// The number for times the current line has been flushed in the memline.
|
||||
int flush_count;
|
||||
|
||||
int b_diff_failed; // internal diff failed for this buffer
|
||||
|
Reference in New Issue
Block a user