diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-14 02:03:08 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-14 02:03:08 +0000 |
commit | 14d7ebc855c478b6b35cbab8e2afa0e18ccc36c4 (patch) | |
tree | 1b4f02ea8bf407797d670e78034429eaa1f37d0b /chrome/browser | |
parent | 62bf10dd1ff70e6653490da75464033a4dcee215 (diff) | |
download | chromium_src-14d7ebc855c478b6b35cbab8e2afa0e18ccc36c4.zip chromium_src-14d7ebc855c478b6b35cbab8e2afa0e18ccc36c4.tar.gz chromium_src-14d7ebc855c478b6b35cbab8e2afa0e18ccc36c4.tar.bz2 |
Mac: Let arrow keys move caret in IME mode.
BUG=26869
TEST=Activate Kotoeri, smash keys, confirm that arrow keys move caret. Confirm that rest of IME still works (hah!).
Review URL: http://codereview.chromium.org/386032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31986 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host_view_mac.mm | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm index 5a187d3..1c5469c 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm @@ -1280,22 +1280,21 @@ extern NSString *NSTextInputReplacementRangeAttributeName; BOOL isAttributedString = [string isKindOfClass:[NSAttributedString class]]; NSString* im_text = isAttributedString ? [string string] : string; int length = [im_text length]; - int cursor; + int cursor = newSelRange.location; + int target_start; int target_end; if (!newSelRange.length) { - // The given text doesn't have any range to be highlighted. - // Put the cursor to the end of this text and clear the selection range. - cursor = length; + // The given text doesn't have any range to be highlighted. Clear the + // selection range. target_start = 0; target_end = 0; } else { // The given text has a range to be highlighted. // Set the selection range to the given one and put the cursor at the // beginning of the selection range. - cursor = newSelRange.location; target_start = newSelRange.location; - target_end = newSelRange.location + newSelRange.length; + target_end = NSMaxRange(newSelRange); } // Dispatch this IME event to the renderer and update the IME state of this |