diff options
Diffstat (limited to 'src/CallTip.cxx')
-rw-r--r-- | src/CallTip.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/CallTip.cxx b/src/CallTip.cxx index 2eab1146f..437933af9 100644 --- a/src/CallTip.cxx +++ b/src/CallTip.cxx @@ -154,13 +154,13 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s, } else if (IsTabCharacter(s[startSeg])) { xEnd = NextTabPos(x); } else { - xEnd = x + static_cast<int>(lround(surface->WidthText(font, s + startSeg, endSeg - startSeg))); + std::string_view segText(s + startSeg, endSeg - startSeg); + xEnd = x + static_cast<int>(lround(surface->WidthText(font, segText))); if (draw) { rcClient.left = static_cast<XYPOSITION>(x); rcClient.right = static_cast<XYPOSITION>(xEnd); surface->DrawTextTransparent(rcClient, font, static_cast<XYPOSITION>(ytext), - s+startSeg, endSeg - startSeg, - highlight ? colourSel : colourUnSel); + segText, highlight ? colourSel : colourUnSel); } } x = xEnd; |