From 67ac1448d9cd449d156b0d56f63f646a2ac01247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=92=80=E5=A2=83=E7=9F=B3?= Date: Mon, 22 Aug 2022 11:05:58 +0200 Subject: [PATCH] ImStrv: enhanced VS debugger .natvis support. build fixes. (5333, 5906) --- imgui.cpp | 6 +++--- misc/debuggers/imgui.natvis | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 1ece2931e..cb0bdc2b2 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -16592,7 +16592,7 @@ void ImGui::ShowDebugLogWindow(bool* p_open) // Display line, search for 0xXXXXXXXX identifiers and call DebugLocateItemOnHover() when hovered. void ImGui::DebugTextUnformattedWithLocateItem(const char* line_begin, const char* line_end) { - TextUnformatted(line_begin, line_end); + TextUnformatted(ImStrv(line_begin, line_end)); if (!IsItemHovered()) return; ImGuiContext& g = *GImGui; @@ -16602,8 +16602,8 @@ void ImGui::DebugTextUnformattedWithLocateItem(const char* line_begin, const cha ImGuiID id = 0; if (p[0] != '0' || (p[1] != 'x' && p[1] != 'X') || sscanf(p + 2, "%X", &id) != 1 || ImCharIsXdigitA(p[10])) continue; - ImVec2 p0 = CalcTextSize(line_begin, p); - ImVec2 p1 = CalcTextSize(p, p + 10); + ImVec2 p0 = CalcTextSize(ImStrv(line_begin, p)); + ImVec2 p1 = CalcTextSize(ImStrv(p, p + 10)); g.LastItemData.Rect = ImRect(text_rect.Min + ImVec2(p0.x, 0.0f), text_rect.Min + ImVec2(p0.x + p1.x, p1.y)); if (IsMouseHoveringRect(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, true)) DebugLocateItemOnHover(id); diff --git a/misc/debuggers/imgui.natvis b/misc/debuggers/imgui.natvis index 7d0c9dd1a..8dbc7eacf 100644 --- a/misc/debuggers/imgui.natvis +++ b/misc/debuggers/imgui.natvis @@ -53,7 +53,8 @@ More information at: https://docs.microsoft.com/en-us/visualstudio/debugger/crea - {Begin,[End-Begin]s} ({End-Begin,d}) + {Begin,[End-Begin]s8} ({End-Begin,d}) + Begin,[End-Begin]s8