aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/ScintillaView.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/ScintillaView.mm
parenta83d3c327f4616cc3ecd169ac4e0e415401cdf96 (diff)
downloadscintilla-mirror-69df0a683aed2f3f5240894a8852514fc6458469.tar.gz
Fix error with showing find indicator over styles > 127.
Diffstat (limited to 'cocoa/ScintillaView.mm')
-rw-r--r--cocoa/ScintillaView.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm
index 61c471d6a..d4ad526d7 100644
--- a/cocoa/ScintillaView.mm
+++ b/cocoa/ScintillaView.mm
@@ -442,7 +442,9 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor)
NSMutableAttributedString *asResult = [[[NSMutableAttributedString alloc] initWithString:result] autorelease];
const NSRange rangeAS = NSMakeRange(0, [asResult length]);
- const long style = [mOwner message: SCI_GETSTYLEAT wParam:posRange.location];
+ // SCI_GETSTYLEAT reports a signed byte but want an unsigned to index into styles
+ const char styleByte = static_cast<char>([mOwner message: SCI_GETSTYLEAT wParam:posRange.location]);
+ const long style = static_cast<unsigned char>(styleByte);
std::string fontName([mOwner message: SCI_STYLEGETFONT wParam:style lParam:0] + 1, 0);
[mOwner message: SCI_STYLEGETFONT wParam:style lParam:(sptr_t)&fontName[0]];
const CGFloat fontSize = [mOwner message: SCI_STYLEGETSIZEFRACTIONAL wParam:style] / 100.0f;