When clearing marked range, ensure pending range is also cleared

This fixes an issue with complex input managers.

Using Chinese pinyin input and entering ‘ci’ followed by ‘1’ to insert first glyph would insert the glyph (‘刺’) and then set the pending marked range (0-2), which would have caret end up in the middle of a multi-byte sequence.
This commit is contained in:
Allan Odgaard
2014-07-24 22:30:53 +02:00
parent cc7f149f52
commit 2d09d503ee

View File

@@ -1082,7 +1082,7 @@ doScroll:
{
D(DBF_OakTextView_TextInput, bug("\n"););
AUTO_REFRESH;
markedRanges = ng::ranges_t();
markedRanges = pendingMarkedRanges = ng::ranges_t();
}
- (BOOL)hasMarkedText
@@ -2045,6 +2045,7 @@ static void update_menu_key_equivalents (NSMenu* menu, action_to_key_t const& ac
[self delete:nil];
markedRanges = ng::ranges_t();
}
pendingMarkedRanges = ng::ranges_t();
if(![aString isKindOfClass:[NSString class]])
{