Below is originally described in issue #7015:
>> (2) Multi-byte character alignment on the screen boundary
When a character is displayed on the screen, it might occupy 1 or more columns. If there are N columns left on the current screen row and a character would occupy M columns to be displayed, and M is greater than N, then this character will be displayed on the beginning of a new row but the current row. The last N columns on the current row are left blank.
When this happens, the current wrapping implementation won't display the cursor at the correct location (the first column of the new row) when left/right arrow keys are used, it leaves cursor on the end of the old row. Backspace/Delete keys would still work, though.
SVN r29426 - Modified code associated with Home/End/Left-Arrow/Right-Arrow keys so that they are handled the same way as Backspace/Delete/Up-Arrow/Down-Arrow keys.
Also, after fixing cursor's position when the multibyte char is displayed at the beginning of the next row (due to wrapping), we should consider the case when the user moves the cursor on this multibyte char and then hit a letter. This letter is inserted before the multibyte char, but because there are N blank columns on the previous row, it should render the newly inserted single byte char on that blank columns, i.e. move the cursor at the end of previous row and write this char there.
Bash behaves this way. You can test it with the xterm terminal under Ubuntu etc; currently it doesn't work with SSH Terminal due to some bug which I'm investigating now. However, FluidShell should command the cursor movement to the proper position on this particular case and it should work without additional fixes.
Also, after fixing cursor's position when the multibyte char is displayed at the beginning of the next row (due to wrapping), we should consider the case when the user moves the cursor on this multibyte char and then hit a letter. This letter is inserted before the multibyte char, but because there are N blank columns on the previous row, it should render the newly inserted single byte char on that blank columns, i.e. move the cursor at the end of previous row and write this char there.
Bash behaves this way. You can test it with the xterm terminal under Ubuntu etc; currently it doesn't work with SSH Terminal due to some bug which I'm investigating now. However, FluidShell should command the cursor movement to the proper position on this particular case and it should work without additional fixes.
The test case mentioned above is just one of many cases that need to be handled carefully. In general, if a line is wrapped into multiple lines, then it is possible that these N lines will look totally different after a character is inserted or deleted (if there are multi-byte characters involved); and cursor location needs to be re-positioned based on the result.
Made changes to take care of the alignment problem. SVN r29445.
SVN r29445 assumes a single character would occupy at most 2 screen columns at the moment, we can generalize this if there is a need.
The test case mentioned above is just one of many cases that need to be handled carefully. In general, if a line is wrapped into multiple lines, then it is possible that these N lines will look totally different after a character is inserted or deleted (if there are multi-byte characters involved); and cursor location needs to be re-positioned based on the result.
Made changes to take care of the alignment problem. SVN r29445.
SVN r29445 assumes a single character would occupy at most 2 screen columns at the moment, we can generalize this if there is a need.
Verified using ADStudio 12 RC 22-4 on Ubuntu 12.04 with Java 1.7 the char alignment at screen boundary for the cases with 1 and 2 columns.
Closed.
Verified using ADStudio 12 RC 22-4 on Ubuntu 12.04 with Java 1.7 the char alignment at screen boundary for the cases with 1 and 2 columns.
Closed.
Issue #7636 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build trunk/29445 |
No time estimate |
SVN r29426 - Modified code associated with Home/End/Left-Arrow/Right-Arrow keys so that they are handled the same way as Backspace/Delete/Up-Arrow/Down-Arrow keys.