aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2011-07-10 22:40:10 +1000
committernyamatongwe <devnull@localhost>2011-07-10 22:40:10 +1000
commitde586bf0f75ea0ea0c8d3846558a457c6208dc88 (patch)
tree69eeb66c5e67d42549f87aeb704ee3aba9cc37be
parent9a895fdf8e524734e35795536d6fb24f83209cb6 (diff)
downloadscintilla-mirror-de586bf0f75ea0ea0c8d3846558a457c6208dc88.tar.gz
Return byte length of insertion for encoding from InsertText so can be
used to underline text inserted by IME and replace correctly when the IME changes.
-rw-r--r--cocoa/ScintillaCocoa.mm2
-rw-r--r--cocoa/ScintillaView.mm4
2 files changed, 3 insertions, 3 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm
index c0667cf4e..196ae28e4 100644
--- a/cocoa/ScintillaCocoa.mm
+++ b/cocoa/ScintillaCocoa.mm
@@ -1672,7 +1672,7 @@ int ScintillaCocoa::InsertText(NSString* input)
AddCharUTF((char*) buffer, usedLen, false);
delete []buffer;
- return true;
+ return usedLen;
}
//--------------------------------------------------------------------------------------------------
diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm
index 5025fe209..174c5c256 100644
--- a/cocoa/ScintillaView.mm
+++ b/cocoa/ScintillaView.mm
@@ -301,10 +301,10 @@ NSString *SCIUpdateUINotification = @"SCIUpdateUI";
// Note: Scintilla internally works almost always with bytes instead chars, so we need to take
// this into account when determining selection ranges and such.
std::string raw_text = [newText UTF8String];
- mOwner.backend->InsertText(newText);
+ int lengthInserted = mOwner.backend->InsertText(newText);
mMarkedTextRange.location = currentPosition;
- mMarkedTextRange.length = raw_text.size();
+ mMarkedTextRange.length = lengthInserted;
// Mark the just inserted text. Keep the marked range for later reset.
[mOwner setGeneralProperty: SCI_SETINDICATORCURRENT value: INPUT_INDICATOR];