Bug 152808

Summary: [Patch] Characters are appended to first line
Product: [Applications] kate Reporter: Torquil Macdonald Sørensen <torquil>
Component: kwriteAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: amanpreet.alam, romnes
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Patch for review
Katepart IM method fix

Description Torquil Macdonald Sørensen 2007-11-23 23:13:16 UTC
Version:           3.96.00 (using KDE KDE 3.95.0)
Installed from:    Debian testing/unstable Packages

Strange things happen in kwrite when using the character é (e with an accent):

Sometimes when trying to write a é somewhere in the first line, the whole line disappears and I am left with only a é

Sometimes this doesn't happen, e.g. I manage to get a é at the end of the first line. But when I then try to write an é on the second line, it instead appears at the end of the first line, while the text cursor is on the second line.

I have LANG=no_NO.UTF-8

Best regards,
Torquil Sørensen
Comment 1 Thomas Friedrichsmeier 2007-11-26 17:30:41 UTC
Created attachment 22205 [details]
Patch for review

1) I can reprocude this bug in POSIX locale and SVN revision 741752
2) Attaching a proposed patch which fixes the reported issue.

The problem used to be that KateViewInternal never realized the first composed
input has finished. Therefore, the first "é" is inserted correctly, all
following composed characters are inserted at the position of the first as
well.

I am not too familiar with InputMethod stuff, though, and not sure this is the
correct solution. Please review.
Comment 2 Thomas Friedrichsmeier 2007-11-29 21:08:38 UTC
Confirming.

Note that it's not so much caused by accents, but by composing a character (in this case with a dead accent key, followed by an "e"). Using an fr keyboard layout "é"s can be typed without problems.
Comment 3 Thomas Friedrichsmeier 2007-12-02 19:37:57 UTC
*** Bug 153251 has been marked as a duplicate of this bug. ***
Comment 4 Hamish Rodda 2007-12-06 05:16:19 UTC
Created attachment 22376 [details]
Katepart IM method fix

I've reviewed the previous patch, and it causes errors when writing in
Japanese.  This new patch seems to work for both cases, makes more sense to me,
and doesn't require accessing the input context (I don't think it should have
to).  Please test this patch.

Thanks, Hamish.
Comment 5 Thomas Friedrichsmeier 2007-12-06 12:44:27 UTC
Your patch works fine, here (tested with various dead keys, but only european characters).

While you're at it, though, I can still reproduce bug #102366 .
Comment 6 Hamish Rodda 2007-12-06 14:06:41 UTC
SVN commit 745575 by rodda:

Fix IM input positioning and overwriting bugs
Reviewed by Thomas Friedrichsmeier (thanks!)

BUG:152808


 M  +28 -13    kateviewinternal.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=745575
Comment 7 Hamish Rodda 2007-12-10 03:39:08 UTC
*** Bug 151917 has been marked as a duplicate of this bug. ***