[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [kate] [Bug 332122] katepart inserts garbage characters on layout switch in vi mode
From:       Boris Egorov <jightuse () gmail ! com>
Date:       2014-10-24 7:32:43
Message-ID: bug-332122-17878-nmzy7mRZNg () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=332122

Boris Egorov <jightuse@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jightuse@gmail.com

--- Comment #15 from Boris Egorov <jightuse@gmail.com> ---
I found a problem. I'm using different key to switch layout and it still
reproducible. With debug enabled, kate prints in terminal:

    kate(15705)/Kate (Vi Input Mode) KateViInputModeManager::feedKeyPresses:   
     ""

So, I decided to check what is this invisible character and added more debug
printing. It is a charcter with quite large unicode value:

    kate(17562)/Kate (Vi Input Mode) KateViInputModeManager::feedKeyPresses:   
     key:  57328 ; text:  ""

feedKeyPresses() takes decoded value from KateViKeyParser::decodeKeySequence().
The later has this code: 

    if ( ( keycode & 0xE000 ) != 0xE000  ) {
      ret.append( c );
    } else {
        /* special key actions */
    }

Now, 57328 & 0xe000 = 0xc000. So, decodeKeySequence() decides that this
character is 'usual' and returns it to caller.
It can be easily fixed by changing mask 0xe000 to something another. The
question is what we can change it to without breaking some valid language in
unicode. This commit looks relevant, but I'm not so expert in Unicode:
https://qt.gitorious.org/qt/qtbase/commit/bcd1b7fe8ee0ab83f7838172c287557c94711602

-- 
You are receiving this mail because:
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic