|
|
|
@ -1,10 +1,10 @@
|
|
|
|
|
// [DEAR IMGUI]
|
|
|
|
|
// This is a slightly modified version of stb_textedit.h 1.13.
|
|
|
|
|
// This is a slightly modified version of stb_textedit.h 1.14.
|
|
|
|
|
// Those changes would need to be pushed into nothings/stb:
|
|
|
|
|
// - Fix in stb_textedit_discard_redo (see https://github.com/nothings/stb/issues/321)
|
|
|
|
|
// Grep for [DEAR IMGUI] to find the changes.
|
|
|
|
|
|
|
|
|
|
// stb_textedit.h - v1.13 - public domain - Sean Barrett
|
|
|
|
|
// stb_textedit.h - v1.14 - public domain - Sean Barrett
|
|
|
|
|
// Development of this library was sponsored by RAD Game Tools
|
|
|
|
|
//
|
|
|
|
|
// This C header file implements the guts of a multi-line text-editing
|
|
|
|
@ -35,6 +35,7 @@
|
|
|
|
|
//
|
|
|
|
|
// VERSION HISTORY
|
|
|
|
|
//
|
|
|
|
|
// 1.14 (2021-07-11) page up/down, various fixes
|
|
|
|
|
// 1.13 (2019-02-07) fix bug in undo size management
|
|
|
|
|
// 1.12 (2018-01-29) user can change STB_TEXTEDIT_KEYTYPE, fix redo to avoid crash
|
|
|
|
|
// 1.11 (2017-03-03) fix HOME on last line, dragging off single-line textfield
|
|
|
|
@ -58,6 +59,7 @@
|
|
|
|
|
// Ulf Winklemann: move-by-word in 1.1
|
|
|
|
|
// Fabian Giesen: secondary key inputs in 1.5
|
|
|
|
|
// Martins Mozeiko: STB_TEXTEDIT_memmove in 1.6
|
|
|
|
|
// Louis Schnellbach: page up/down in 1.14
|
|
|
|
|
//
|
|
|
|
|
// Bugfixes:
|
|
|
|
|
// Scott Graham
|
|
|
|
@ -93,8 +95,8 @@
|
|
|
|
|
// moderate sizes. The undo system does no memory allocations, so
|
|
|
|
|
// it grows STB_TexteditState by the worst-case storage which is (in bytes):
|
|
|
|
|
//
|
|
|
|
|
// [4 + 3 * sizeof(STB_TEXTEDIT_POSITIONTYPE)] * STB_TEXTEDIT_UNDOSTATE_COUNT
|
|
|
|
|
// + sizeof(STB_TEXTEDIT_CHARTYPE) * STB_TEXTEDIT_UNDOCHAR_COUNT
|
|
|
|
|
// [4 + 3 * sizeof(STB_TEXTEDIT_POSITIONTYPE)] * STB_TEXTEDIT_UNDOSTATECOUNT
|
|
|
|
|
// + sizeof(STB_TEXTEDIT_CHARTYPE) * STB_TEXTEDIT_UNDOCHARCOUNT
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// Implementation mode:
|
|
|
|
@ -716,10 +718,6 @@ static int stb_textedit_paste_internal(STB_TEXTEDIT_STRING *str, STB_TexteditSta
|
|
|
|
|
state->has_preferred_x = 0;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
// [DEAR IMGUI]
|
|
|
|
|
//// remove the undo since we didn't actually insert the characters
|
|
|
|
|
//if (state->undostate.undo_point)
|
|
|
|
|
// --state->undostate.undo_point;
|
|
|
|
|
// note: paste failure will leave deleted selection, may be restored with an undo (see https://github.com/nothings/stb/issues/734 for details)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|