Insert the following text into the editor: oooossssssss { } ssssss---------- 1. select C++ highlighing 2. fold the code 3. select text from o|s to s|- (the fold is still folded) 4. type x Expected result: oooox---------- Actual result: oooo------x---- The folded node somehow leads to broken code. This bug exists also in KDE 4.6. Maybe this is related to crashes, so the severity is set to major. kate/part/tests/foldedselection_test.cpp contains a unit test for this.
Git commit 9a058c00b71de765753ccbeaa583f55082630715 by Dominik Haumann. Committed on 09/03/2012 at 20:43. Pushed by dhaumann into branch 'master'. unit test for broken text after replacing folded code M +11 -0 part/tests/CMakeLists.txt A +80 -0 part/tests/foldedselection_test.cpp [License: LGPL (v2+)] A +36 -0 part/tests/foldedselection_test.h [License: LGPL (v2+)] http://commits.kde.org/kate/9a058c00b71de765753ccbeaa583f55082630715
Git commit 4bcccf2906139ed523567f242464cf927e393716 by Christoph Cullmann. Committed on 09/03/2012 at 22:41. Pushed by cullmann into branch 'master'. fix problem with folding and deletion of selection, fixes foldedselection_test M +1 -10 part/document/katedocument.cpp M +2 -0 part/view/kateviewinternal.cpp http://commits.kde.org/kate/4bcccf2906139ed523567f242464cf927e393716
The following part (and more) was added by commit http://websvn.kde.org/?revision=1064050&view=revision to fix bug #200858 m_preserveX = true; KTextEditor::Cursor newPos = toRealCursor(toVirtualCursor(m_cursor)); KateTextLayout newLine = cache()->textLayout(newPos); newPos = renderer()->xToCursor(newLine, m_preservedX, !m_view->wrapCursor()); updateCursor(newPos, true); Pascal, Milian: Do you still remember what went wrong without this code in bug #200858 ?
In any case: moving the cursor is a bad idea here, as then it will have a wrong position for next editing actions ;) The problem is that m_cursor might still be wrong I think. And after my testing, it just looked ok. But perhaps there is a corner case when the cursor is hidden in the region.
Git commit e68d2ccf57462a057306e777c2a7960a8338182e by Dominik Haumann. Committed on 16/04/2013 at 14:59. Pushed by dhaumann into branch 'master'. bring back test for bug 295632 This test makes sure that, - if you have selected text - that spans a folded range, - and the cursor is at the end of the text selection, - and you type a char, e.g. 'x', then the resulting text is correct, and changing region visibility does not mess around with the text cursor. M +39 -0 tests/katefoldingtest.cpp M +1 -0 tests/katefoldingtest.h http://commits.kde.org/kate/e68d2ccf57462a057306e777c2a7960a8338182e