Bug 318453 - Blinking cursor of "fullwidth" character are "halfwidth".
Summary: Blinking cursor of "fullwidth" character are "halfwidth".
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: copy-paste (show other bugs)
Version: 2.10.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-16 14:36 UTC by Yichao Yu
Modified: 2014-08-03 13:26 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yichao Yu 2013-04-16 14:36:13 UTC
Cursor highlight has the correct width (same with the character) while the blinking part of the cursor is halfwidth. See detail and screen shot below.


Reproducible: Always

Steps to Reproduce:
1. type a fullwidth character (or two) (e.g. 测试) in the command line. (do not enter)
2. move cursor back on to the character typed (using command line editing of the shell)
3.
Actual Results:  
http://wstaw.org/m/2013/04/16/plasma-desktopczv475.png


Expected Results:  
The whole high lighted region should be blinking instead of only the first half of it.
Comment 1 Kurt Hindenburg 2014-02-15 23:58:05 UTC
Yep, I don't use a blinking cursor so I've never noticed.
Comment 2 Kurt Hindenburg 2014-02-16 01:28:38 UTC
This doesn't strike me as a good way of doing this

diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp
index 6ed9358..147db34 100644
--- a/src/TerminalDisplay.cpp
+++ b/src/TerminalDisplay.cpp
@@ -1597,7 +1597,10 @@ void TerminalDisplay::blinkCursorEvent()
 
 void TerminalDisplay::updateCursor()
 {
-    QRect cursorRect = imageToWidget(QRect(cursorPosition(), QSize(1, 1)));
+    int cursorLocation = cursorPosition().x() + (_columns * cursorPosition().y());
+    quint16 c = _image[cursorLocation].character;
+    QRect cursorRect = imageToWidget(QRect(cursorPosition(),
+               QSize(konsole_wcwidth(c), 1)));
     update(cursorRect);
 }
Comment 3 Chao Feng 2014-08-03 13:26:38 UTC
Git commit 5fd1276b8d024a5a2670ff60753c9760a2ff7ca7 by Feng Chao.
Committed on 03/08/2014 at 13:18.
Pushed by fengchao into branch 'frameworks'.

Fix Bug 318453 - Blinking cursor of "fullwidth" character are "halfwidth"

Calculate the character width at current blinking cursor.

M  +3    -1    src/TerminalDisplay.cpp

http://commits.kde.org/konsole/5fd1276b8d024a5a2670ff60753c9760a2ff7ca7