Version: (using Devel) Installed from: Compiled sources Back in March someone (who shall remain un-named) added to kate a new function which would calculate the "best direction" of a paragraph by counting the LTR and RTL chars in that line. That is r788729: http://websvn.kde.org/trunk/KDE/kdelibs/kate/render/katerenderer.cpp?r1=772931&r2=788729 The last month I found a really ugly "bug" in it. Imagine this php code: function foo() { $a = "שלום עולם"; return $a; } Now paste it into kate and see what happens. This get funkier when the hebrew is inside lists or hashes. IMHO, this renders this "feature" useless - much more people will be using kate to code then to write "plain text". My proposal is detecting the paragraph direction using QString::isRightToLeft() and in 4.3 also provide a manual method for setting the direction of the paragraph. IMHO, this renders kate unusable for editing code.
When kate highlight the block code inside { }, the second line disappear :-(
SVN commit 905112 by iastrubni: Fix for bug 178594, now katepart determinates the direction of each paragraph (line) according to the first strong character. Since we are no longer using counting chars and not using QString::isRightToLeft() (we use a new internal implementation, based of QString::updateProperties()) we might have a small speed improve: now determinating the paragraph direction is done (on average) in O(1) instead of O(n) - where n is the length of the string. BUG: 178594 M +15 -12 katerenderer.cpp M +8 -4 katerenderer.h WebSVN link: http://websvn.kde.org/?view=rev&revision=905112
Just as a reference... I asked Ubuntu to backport this issue to KDE 4.1.X. And they did :) https://bugs.launchpad.net/ubuntu/+source/kde4libs/+bug/314016
*** Bug 175931 has been marked as a duplicate of this bug. ***