From c0999495e7284542ee775c6c5480920a9dd5381b Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 26 Nov 2014 22:19:46 +0000 Subject: [PATCH] Fixed move-by-word in InputText() - broken 2 days ago, sorry. stb_ expect a define. --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index f722420f..5169338a 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4112,7 +4112,7 @@ static void STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, STB_TEXTEDIT_STRING* ob static bool is_white(unsigned int c) { return c==0 || c==' ' || c=='\t' || c=='\r' || c=='\n'; } static bool is_separator(unsigned int c) { return c==',' || c==';' || c=='(' || c==')' || c=='{' || c=='}' || c=='[' || c==']' || c=='|'; } -static bool STB_TEXTEDIT_IS_SPACE(ImWchar c) { return is_white((unsigned int)c) || is_separator((unsigned int)c); } +#define STB_TEXTEDIT_IS_SPACE(CH) ( is_white((unsigned int)CH) || is_separator((unsigned int)CH) ) static void STB_TEXTEDIT_DELETECHARS(STB_TEXTEDIT_STRING* obj, int pos, int n) { ImWchar* dst = obj->Text+pos; const ImWchar* src = obj->Text+pos+n; while (ImWchar c = *src++) *dst++ = c; *dst = '\0'; } static bool STB_TEXTEDIT_INSERTCHARS(STB_TEXTEDIT_STRING* obj, int pos, const ImWchar* new_text, int new_text_len) {