37#define ARRAY_CHUNK_SIZE 128
57 state->cursor_column = text->curc;
60 state->cursor_line_select = (text->curl == text->sell) ?
64 state->cursor_column_select = text->selc;
67 state->cursor_line_select =
state->cursor_line;
68 state->cursor_column_select =
state->cursor_column;
82 const bool has_select = ((
state->cursor_line !=
state->cursor_line_select) ||
83 (
state->cursor_column !=
state->cursor_column_select));
142 bool write_init =
true;
208 if (
state->buf_array_state) {
SpaceText * CTX_wm_space_text(const bContext *C)
Text * CTX_data_edit_text(const bContext *C)
Main * CTX_data_main(const bContext *C)
void txt_from_buf_for_undo(struct Text *text, const char *buf, size_t buf_len) ATTR_NONNULL(1
bool txt_has_sel(const struct Text *text)
char * txt_to_buf_for_undo(struct Text *text, size_t *r_buf_len) ATTR_NONNULL(1
int txt_get_span(const struct TextLine *from, const struct TextLine *to)
void txt_move_to(struct Text *text, unsigned int line, unsigned int ch, bool sel)
@ UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE
@ UNDOTYPE_FLAG_DECODE_ACTIVE_STEP
void(*)(void *user_data, UndoRefID *id_ref) UndoTypeForEachIDRefFn
const UndoType * BKE_UNDOSYS_TYPE_TEXT
UndoStep * BKE_undosys_step_push_init_with_type(UndoStack *ustack, bContext *C, const char *name, const UndoType *ut)
Efficient in-memory storage of multiple similar arrays.
BArrayState * BLI_array_store_state_add(BArrayStore *bs, const void *data, size_t data_len, const BArrayState *state_reference)
void BLI_array_store_state_remove(BArrayStore *bs, BArrayState *state)
void * BLI_array_store_state_data_get_alloc(BArrayState *state, size_t *r_data_len)
void BLI_array_store_destroy(BArrayStore *bs)
size_t BLI_array_store_calc_size_compacted_get(const BArrayStore *bs)
BArrayStore * BLI_array_store_create(unsigned int stride, unsigned int chunk_count)
Generic array manipulation API.
#define BLI_array_is_zeroed(arr, arr_len)
#define UNUSED_VARS_NDEBUG(...)
UndoStack * ED_undo_stack_get()
Read Guarded memory(de)allocation.
void MEM_freeN(void *vmemh)
BArrayState * buf_array_state
void(* step_encode_init)(bContext *C, UndoStep *us)
void(* step_foreach_ID_ref)(UndoStep *us, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data)
void(* step_free)(UndoStep *us)
bool(* poll)(struct bContext *C)
void(* step_decode)(bContext *C, Main *bmain, UndoStep *us, eUndoStepDir dir, bool is_final)
bool(* step_encode)(bContext *C, Main *bmain, UndoStep *us)
void space_text_drawcache_tag_update(SpaceText *st, bool full)
void space_text_update_cursor_moved(bContext *C)
static void text_undosys_foreach_ID_ref(UndoStep *us_p, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data)
static void text_state_encode(TextState *state, Text *text, BArrayStore *buffer_store)
void ED_text_undosys_type(UndoType *ut)
static struct @528 g_text_buffers
static void text_undosys_step_encode_init(bContext *C, UndoStep *us_p)
UndoStep * ED_text_undo_push_init(bContext *C)
static bool text_undosys_poll(bContext *)
static size_t text_undosys_step_encode_to_state(TextState *state, Text *text)
static bool text_undosys_step_encode(bContext *C, Main *, UndoStep *us_p)
static void text_undosys_step_free(UndoStep *us_p)
static void text_undosys_step_decode(bContext *C, Main *, UndoStep *us_p, const eUndoStepDir dir, bool is_final)
BArrayStore * buffer_store
static void text_state_decode(TextState *state, Text *text)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)