This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 407044 - [DBCS4.3] wrong cursor movement by arrow keys and mouse-click around Unicode surrogate characters
Summary: [DBCS4.3] wrong cursor movement by arrow keys and mouse-click around Unicode ...
Status: CLOSED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Editor (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 3.0 M2   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-02 02:56 EDT by Takehiko Ishii CLA
Modified: 2013-05-30 04:46 EDT (History)
5 users (show)

See Also:


Attachments
sample txt file which includes Unicode surrogate characters (353 bytes, text/plain)
2013-05-02 02:56 EDT, Takehiko Ishii CLA
no flags Details
screenshot about the problem about the step 5 (51.65 KB, image/png)
2013-05-02 02:59 EDT, Takehiko Ishii CLA
no flags Details
screenshot about the problem at the step 7 (54.89 KB, image/png)
2013-05-02 03:01 EDT, Takehiko Ishii CLA
no flags Details
screenshot of garbled characters by pasting (42.08 KB, image/png)
2013-05-02 03:04 EDT, Takehiko Ishii CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Takehiko Ishii CLA 2013-05-02 02:56:12 EDT
Created attachment 230381 [details]
sample txt file which includes Unicode surrogate characters

A movement of cursor behaves wrongly around Unicode surrogate characters.  

OS: RHEL 6 Japanese 
Orion: https://orion.eclipse.org (as of 2nd May 2013, I20130430-1910)
Web browser: Firefox ESR 17 ESR and 20

Steps to recreate problem:
1- create a file on Orion navigator
2- Input Unicode surrogate characters in the file
(Please copy & paste characters in attached text file to input. They are saved in UTF-8 format)
3- move cursor to the first character in the 4th line
4- press right arrow key to move cursor to right
5- verify the cursor moves to next one character by pushing right arrow key once
6- after the cursor moved to the 5th line by continuing to push right arrow key, select one of characters in the 5th line by clicking left mouse button
7- verify the cursor moves to the place of character in the 5th line which you selected at step 6

Expected:
at step 5, each time you push right arrow key, the cursor moves to the next character.
at step 7, the cursor moves to the place you clicked in the 5th line.

Actual:
at step 5, some of characters (Unicode surrogate characters) in the 4th line need to push right arrow key twice to move the cursor to the next character.
at step 7, the cursor moves to the next line (6th line) instead of moving to the character where you selected in the 5th line.

Additional information:
1. About the problem about the step 5, this happens in every web browsers on all platforms while the problem about the step 7 happens only on Firefox on RHEL.

2. Probably related to the problem of the step 5, selecting characters by mouse and then copy & paste does not work properly about these Unicode surrogate characters. A part of pasted characters are garbled. It seems first byte of Unicode surrogate character is not selected by mouse selection though the character itself is highlighted.
Comment 1 Takehiko Ishii CLA 2013-05-02 02:59:05 EDT
Created attachment 230382 [details]
screenshot about the problem about the step 5
Comment 2 Takehiko Ishii CLA 2013-05-02 03:01:02 EDT
Created attachment 230383 [details]
screenshot about the problem at the step 7
Comment 3 Takehiko Ishii CLA 2013-05-02 03:04:54 EDT
Created attachment 230384 [details]
screenshot of garbled characters by pasting

This is the issue I described in the "Additional information".
Comment 4 Silenio Quarti CLA 2013-05-07 14:56:25 EDT
This patch fixes the problem in step 5 and the copy/paste problem. 

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=ad775a4431d1c034d664804fabd1f3144cbaee62

The problem in step 7 happens because the calculate line height does not match the actually drawing. The lines with DBCS charecters are taller.  Note the ruler lines to not match to text lines.  Currently, the editor supports only fixed line height.

I am closing this bug since the remaining problem is addressed in other bugs (bug#334910, bug#386517, bug#406782).
Comment 5 Takehiko Ishii CLA 2013-05-30 04:46:48 EDT
Thank you for the fix, I have verified on Firefox on RHEL6 about step 5 and copy&paste.