From 0095ad7674f865f665dadec9769d3c1f3f01ccc1 Mon Sep 17 00:00:00 2001 From: Evan Teran Date: Sat, 11 Jan 2025 00:44:36 -0500 Subject: [PATCH] more iterator/pointer fixups --- src/Highlight.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Highlight.cpp b/src/Highlight.cpp index 0f846c26..ec47581e 100644 --- a/src/Highlight.cpp +++ b/src/Highlight.cpp @@ -1132,16 +1132,19 @@ bool parseString(const HighlightData *pattern, const char *&string_ptr, uint8_t return false; } + const char *const begin_ptr = ctx->text.data(); + const char *const end_ptr = ctx->text.data() + ctx->text.size(); + if (!look_behind_to) { - look_behind_to = ctx->text.begin(); + look_behind_to = begin_ptr; } if (!match_to) { - match_to = ctx->text.end(); + match_to = end_ptr; } bool subExecuted; - const int next_char = (match_to != ctx->text.end()) ? (*match_to) : -1; + const int next_char = (match_to != end_ptr) ? (*match_to) : -1; const char *stringPtr = string_ptr; uint8_t *stylePtr = style_ptr;