39#define ARRAY_CHUNK_SIZE 128
59 state->cursor_column = text->curc;
62 state->cursor_line_select = (text->curl == text->sell) ?
65 state->cursor_column_select = text->selc;
68 state->cursor_line_select =
state->cursor_line;
69 state->cursor_column_select =
state->cursor_column;
83 const bool has_select = ((
state->cursor_line !=
state->cursor_line_select) ||
84 (
state->cursor_column !=
state->cursor_column_select));
143 bool write_init =
true;
209 if (
state->buf_array_state) {
255 if (
wm->op_undo_depth <= 1) {
Efficient in-memory storage of multiple similar arrays.
Generic array manipulation API.
#define BLI_array_is_zeroed(arr, arr_len)
Read Blender memory allocation and freeing.
#define UNUSED_VARS_NDEBUG(...)
static void text_undosys_step_decode(bContext *C, Main *, UndoStep *us_p, const eUndoStepDir dir, bool is_final)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
int txt_get_span(const struct TextLine *from, const struct TextLine *to)
static struct blender::@372137351376374056245260017074100203077155045231 g_text_buffers
void BLI_array_store_state_remove(BArrayStore *bs, BArrayState *state)
void space_text_drawcache_tag_update(SpaceText *st, const bool full)
UndoStack * ED_undo_stack_get()
@ UNDOTYPE_FLAG_DECODE_ACTIVE_STEP
@ UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE
BArrayState * BLI_array_store_state_add(BArrayStore *bs, const void *data, size_t data_len, const BArrayState *state_reference)
void space_text_update_cursor_moved(bContext *C)
void ED_text_undosys_type(UndoType *ut)
static void text_state_encode(TextState *state, Text *text, BArrayStore *buffer_store)
bool txt_has_sel(const struct Text *text)
static void text_state_decode(TextState *state, Text *text)
Text * CTX_data_edit_text(const bContext *C)
char * txt_to_buf_for_undo(struct Text *text, size_t *r_buf_len) ATTR_NONNULL(1
void * BLI_array_store_state_data_get_alloc(const BArrayState *state, size_t *r_data_len)
SpaceText * CTX_wm_space_text(const bContext *C)
static bool text_undosys_poll(bContext *)
static void text_undosys_step_encode_init(bContext *C, UndoStep *us_p)
const UndoType * BKE_UNDOSYS_TYPE_TEXT
BArrayStore * BLI_array_store_create(unsigned int stride, unsigned int chunk_count)
void txt_from_buf_for_undo(struct Text *text, const char *buf, size_t buf_len) ATTR_NONNULL(1
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
static size_t text_undosys_step_encode_to_state(TextState *state, Text *text)
static void text_undosys_step_free(UndoStep *us_p)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
size_t BLI_array_store_calc_size_compacted_get(const BArrayStore *bs)
Main * CTX_data_main(const bContext *C)
UndoStep * ED_text_undo_push_init(bContext *C)
static bool text_undosys_step_encode(bContext *C, Main *, UndoStep *us_p)
void(*)(void *user_data, UndoRefID *id_ref) UndoTypeForEachIDRefFn
static void text_undosys_foreach_ID_ref(UndoStep *us_p, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data)
void BLI_array_store_destroy(BArrayStore *bs)
void txt_move_to(struct Text *text, unsigned int line, unsigned int ch, bool sel)
UndoStep * BKE_undosys_step_push_init_with_type(UndoStack *ustack, bContext *C, const char *name, const UndoType *ut)
ListBaseT< wmWindowManager > wm
BArrayState * buf_array_state
bool(*) poll(bContext *C)
void(*) step_free(UndoStep *us)
void(*) step_decode(bContext *C, Main *bmain, UndoStep *us, eUndoStepDir dir, bool is_final)
void(*) step_foreach_ID_ref(UndoStep *us, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data)
bool(*) step_encode(bContext *C, Main *bmain, UndoStep *us)
void(*) step_encode_init(bContext *C, UndoStep *us)
BArrayStore * buffer_store