| 3598 | } |
| 3599 | |
| 3600 | static int InputTextCalcTextLenAndLineCount(const char* text_begin, const char** out_text_end) |
| 3601 | { |
| 3602 | int line_count = 0; |
| 3603 | const char* s = text_begin; |
| 3604 | while (char c = *s++) // We are only matching for \n so we can ignore UTF-8 decoding |
| 3605 | if (c == '\n') |
| 3606 | line_count++; |
| 3607 | s--; |
| 3608 | if (s[0] != '\n' && s[0] != '\r') |
| 3609 | line_count++; |
| 3610 | *out_text_end = s; |
| 3611 | return line_count; |
| 3612 | } |
| 3613 | |
| 3614 | static ImVec2 InputTextCalcTextSizeW(const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining, ImVec2* out_offset, bool stop_on_new_line) |
| 3615 | { |