aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/ScintillaCocoa.mm
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2017-03-04 10:30:52 +1100
committerNeil Hodgson <nyamatongwe@gmail.com>2017-03-04 10:30:52 +1100
commit69df0a683aed2f3f5240894a8852514fc6458469 (patch)
tree8360647ed83130683aa49a4bc3fbb10f3c0e2bfc /cocoa/ScintillaCocoa.mm
parenta83d3c327f4616cc3ecd169ac4e0e415401cdf96 (diff)
downloadscintilla-mirror-69df0a683aed2f3f5240894a8852514fc6458469.tar.gz
Fix error with showing find indicator over styles > 127.
Diffstat (limited to 'cocoa/ScintillaCocoa.mm')
-rw-r--r--cocoa/ScintillaCocoa.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm
index 4a451649b..1400796be 100644
--- a/cocoa/ScintillaCocoa.mm
+++ b/cocoa/ScintillaCocoa.mm
@@ -2643,7 +2643,9 @@ void ScintillaCocoa::ShowFindIndicatorForRange(NSRange charRange, BOOL retaining
CFRelease(cfsFind);
layerFindIndicator.retaining = retaining;
layerFindIndicator.positionFind = static_cast<int>(charRange.location);
- long style = WndProc(SCI_GETSTYLEAT, charRange.location, 0);
+ // SCI_GETSTYLEAT reports a signed byte but want an unsigned to index into styles
+ const char styleByte = static_cast<char>(WndProc(SCI_GETSTYLEAT, charRange.location, 0));
+ const long style = static_cast<unsigned char>(styleByte);
std::vector<char> bufferFontName(WndProc(SCI_STYLEGETFONT, style, 0) + 1);
WndProc(SCI_STYLEGETFONT, style, (sptr_t)&bufferFontName[0]);
layerFindIndicator.sFont = [NSString stringWithUTF8String: &bufferFontName[0]];