From b4995f979d127cea667b4e2b71c91e9db4ab52ef Mon Sep 17 00:00:00 2001 From: maxim nikonov Date: Fri, 6 Feb 2026 18:12:40 +0500 Subject: wip --- src/Fl_Text_Buffer.cxx | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/Fl_Text_Buffer.cxx') diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx index 9aa099208..8411342d1 100644 --- a/src/Fl_Text_Buffer.cxx +++ b/src/Fl_Text_Buffer.cxx @@ -181,7 +181,8 @@ public: void clear() { if (locked_) return; if (list_) { - for (int i=0; i 0 && p > 0; i--) { + int i; + for (i = l_t; i > 0 && p > 0; i--) { t[--len] = byte_at(--p); ll = fl_utf8len(t[len]); if (ll == 1 || ll == 2) break; @@ -2123,7 +2130,8 @@ int Fl_Text_Buffer::next_char(int pos) const { t[len++] = b; ll = fl_utf8len1(b); count_points++; - for (int i = 1; i < ll && len < (int)sizeof(t); i++) t[len++] = byte_at(p++); + int i; + for (i = 1; i < ll && len < (int)sizeof(t); i++) t[len++] = byte_at(p++); if (count_points > 1 && (ll == 1 || ll == 2)) { // stop after short codepoint but not if it's the 1st codepoint which can be inside // emoji sequence (e.g. 9️⃣ "keycap 9") -- cgit v1.2.3