Skip to content

Commit

Permalink
more iterator/pointer fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
eteran committed Jan 11, 2025
1 parent 5172a86 commit 0095ad7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Highlight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0095ad7

Please sign in to comment.