From 67085d732aa06547800ec3c2c43ecf9bbfe76115 Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 11 Sep 2025 15:17:22 +0200 Subject: [PATCH] ImGuiTextIndex: rename member. --- imgui.cpp | 4 ++-- imgui_internal.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 13c011ca9..b66474b0a 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3080,11 +3080,11 @@ void ImGuiTextIndex::append(const char* base, int old_size, int new_size) if (old_size == new_size) return; if (EndOffset == 0 || base[EndOffset - 1] == '\n') - LineOffsets.push_back(EndOffset); + Offsets.push_back(EndOffset); const char* base_end = base + new_size; for (const char* p = base + old_size; (p = (const char*)ImMemchr(p, '\n', base_end - p)) != 0; ) if (++p < base_end) // Don't push a trailing offset on last \n - LineOffsets.push_back((int)(intptr_t)(p - base)); + Offsets.push_back((int)(intptr_t)(p - base)); EndOffset = ImMax(EndOffset, new_size); } diff --git a/imgui_internal.h b/imgui_internal.h index 4d54789f5..a206357b2 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -804,13 +804,13 @@ struct ImChunkStream // Maintain a line index for a text buffer. This is a strong candidate to be moved into the public API. struct ImGuiTextIndex { - ImVector LineOffsets; + ImVector Offsets; int EndOffset = 0; // Because we don't own text buffer we need to maintain EndOffset (may bake in LineOffsets?) - void clear() { LineOffsets.clear(); EndOffset = 0; } - int size() { return LineOffsets.Size; } - const char* get_line_begin(const char* base, int n) { return base + LineOffsets[n]; } - const char* get_line_end(const char* base, int n) { return base + (n + 1 < LineOffsets.Size ? (LineOffsets[n + 1] - 1) : EndOffset); } + void clear() { Offsets.clear(); EndOffset = 0; } + int size() { return Offsets.Size; } + const char* get_line_begin(const char* base, int n) { return base + Offsets[n]; } + const char* get_line_end(const char* base, int n) { return base + (n + 1 < Offsets.Size ? (Offsets[n + 1] - 1) : EndOffset); } void append(const char* base, int old_size, int new_size); };