Version: (using KDE 4.0.0) Installed from: Ubuntu Packages This patch by Jakkapun Kwanroengjai fixes Thai-related issues in Kate. -Word breaking: it uses libthai (either compile-time linking or dynamic loading in the similar fashion to in KHTML) to determine words boundaries positions and stores in the m_breakLine attributes. Pressing the Ctrl + Left/Right arrow keys should now be able to jump between Thai words. -Cursor movement and delete/backspace keys' behavior: now works correctly in case of Thai text -Input method: fixed in the Qt::ImCursorPosition case to return the correct position -Wrap text: wrap Thai sentences properly when selecting Tool / Word Wrap Document. (Question: where to fix if we want this wrapping to happen automatically?)
Created attachment 23243 [details] Fix several Thai related issues in Kate/Kwrite By Jakkapun Kwanroengjai URL: http://linux.thai.net/viewvc/viewvc.cgi/software/kde/kdelibs-4.0.0/kate_thai_patch.diff?view=log
Patch looks ok to me, if one of the other kate devs can try it out to check for regressions and it looks ok, it can be committed (sorry, no time to do so here at the moment)
Created attachment 23350 [details] Fix several Thai related issues in Kate/Kwrite Updated patch from Mr.Jakkapun Kwanroengjai + fix Thai word break problem in the case of dynamic word wrapping
Created attachment 23476 [details] Fix Thai word break crash in Kate/Kwrite Fix Thai word break crash in Kate/Kwrite
No idea about it? Commit it?
I've had another look at this... 1) "Question: where to fix if we want this wrapping to happen automatically?" As far as I understand, you'd need to patch Qt or at least report it to Trolltech. We use QTextOption::WrapAtWordBoundaryOrAnywhere now in katepart SVN head, and if Qt isn't breaking at the correct places, that's a Qt issue. 2) I'm not sure about having that break line vector in text line, that seems like a bit of an unnecessary use of memory, can't it be calculated only when needed, or stored somewhere else (eg. in KateTextLine / KateTextLayout) temporarily?
For 2), I don't want a line break vector in textline, that is overhead not justified just for thai linebreaks.
Created attachment 27096 [details] kdelibs/kate Thai wordbreak patch Updated patch for KDE 4.1 /Qt 4.4 -- use Qt/HarfBuzz to break words instead of doing it by ourselves (patch by Thanomsub Noppaburana)
Created attachment 27097 [details] kdelibs/kate im cursor query patch
We have patched Qt 4.4 to include Thai support and will send to Trolltech. The new patch above won't do the breaking by itself anymore but instead will consult Qt. Please help review. Cheers, Pattara
Thanks for the new patch, it seems to be more in line with what I wanted (support to mainly come from Qt). I'll take a look in detail soon. The im cursor query patch is already implemented in trunk, although a little differently to what you have done (it returns the start of the preedit string when one exists). Could you please test that?
I tested the code in trunk and found m_cursor.start().column() is always zero so XIM doesn't really work. Here I dump the values of m_cursor.start().column() compared to those of m_cursor.column() when typing a Thai word "ที่" m_cursor.start().column() = 0 m_cursor.column() = 1 m_cursor.start().column() = 0 m_cursor.column() = 2 m_cursor.start().column() = 0 m_cursor.column() = 3 m_cursor.start().column() = 0 m_cursor.column() = 3
This is to inform that the above two Thai language related patches for kwrite ( Thai wordbreak and IM cursor query) works OK on KDE 4.1.3/Qt 4.4.3 (just tested).
So any progress on this? Any comment with the patch? Commit it?
Can you please build current kate and check whether this is still an issue? As far as I know the patch was never committed. A tutorial on how to compile kate can be found here: http://gitorious.org/kate/pages/Building%20Kate
Created attachment 43547 [details] Fixed Thai-related problems in Kate (Word break and cursor movement) -word wrapping -cursor movement -delete and backspace
Yes the problem still exists and we have revised the patch against KDE 4.4.2 (source from Ubuntu Lucid). Correct the patch was never committed and we're wondering why...
Could you redo the patch without the ugly defines? I guess requiring Qt 4.4 is no problem, KDE anyways needs 4.5/6.
@Pattara: Can you build Kate again (http://kate-editor.org/get-it/), and if the bug still exists, redo your patch without the redefines? Maybe we'll finally get this in for KDE 4.6 then!
OK Dominik we'll try, thank you. Pattara
Any updates? It's been almost a year, and in the meantime KDE 4.7 is out.
Created attachment 67527 [details] Fixed Thai-related problems in Kate (Word break and cursor movement) Sorry for the long delay. We just tested against 4.7.3. The bug still exists. The revised patch is as attached. Please review.
Git commit 1d3b6bca55b8d73c88dd122861f5927cc3c3098e by Christoph Cullmann. Committed on 04/07/2012 at 16:39. Pushed by cullmann into branch 'master'. apply patch for thai we missed to have this for KDE 4.9, but without wider testing, I won't like to backport this now at least in master thanks for the patch, please review, if current behavior is now ok M +4 -7 part/document/katedocument.cpp M +16 -9 part/view/kateview.cpp M +73 -52 part/view/kateviewinternal.cpp http://commits.kde.org/kate/1d3b6bca55b8d73c88dd122861f5927cc3c3098e
Git commit f6a351d4e5fbd4a32c09ab312b463fcd65a33d2e by Christoph Cullmann. Committed on 05/07/2012 at 16:27. Pushed by cullmann into branch 'master'. try to fix selectWord did crash with thai patch sometimes, because out of range use hl functions again please review thai guys ;) M +21 -17 part/view/kateview.cpp http://commits.kde.org/kate/f6a351d4e5fbd4a32c09ab312b463fcd65a33d2e
Reopen, reverted commits because of regressions, see: On Wednesday 17 Oct 2012 21:50:55 Michel Ludwig wrote: > Hi, > > On Wed 17 Oct 2012 08:56:22 Simon St James wrote: > > The commit: > > > > https://projects.kde.org/projects/kde/kde- > > baseapps/kate/repository/revisions/1d3b6bca55b8d73c88dd122861f5927cc3c3098 > > e > > > > which fixes bug: > > > > https://bugs.kde.org/show_bug.cgi?id=156561 > > > > breaks word-wrapping pretty severely, making e.g. Kile almost unusable. A > > small test-case can be found by running vimode_test (it's currently the > > only failing test). I'd look into it myself, but I don't know enough about > > https://bugs.kde.org/show_bug.cgi?id=156561 to not break anything :/ > > Is this maybe related to bug 304258 as well? > > https://bugs.kde.org/show_bug.cgi?id=304258
In would need an updated patch, this own breaks word wrap and co :(
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone!