Version: (using KDE Devel) Installed from: Compiled sources Compiler: gcc 3.2.2 OS: Linux When I open a file and I play with the code folding, all works well. But if I close the file and I re-open it, all the function that I've "closed" are opened again! I'd like that the status of the document is saved.
Hope it's coming soon... Martin
*** Bug 134374 has been marked as a duplicate of this bug. ***
*** Bug 271227 has been marked as a duplicate of this bug. ***
So the code folding needs load / save routines to serialize and deserialize.
In progress...
Git commit f5a86bdda1531d297a0c26ca23779e5a3c2065ad by Adrian Lungu. Committed on 03/08/2011 at 21:01. Pushed by lungu into branch 'master'. BUG: 56958 Automatic folding (remember folding from last sesion) was implemented M +10 -1 part/syntax/katecodefolding.h M +11 -0 part/document/katedocument.cpp M +2 -1 ktexteditor/sessionconfiginterface.h M +73 -4 part/syntax/katecodefolding.cpp http://commits.kde.org/kate/f5a86bdda1531d297a0c26ca23779e5a3c2065ad
Again open since KDE 4.11: Implement in KateView::read/writeSessionConfig()
Created attachment 87390 [details] minimal java file
Created attachment 87391 [details] minimal php file
remembering code folding from previous session does work for some files (e.g php) and not for some others (e.g java) whereas session file contains correct folding informations for both : [Document 0] ... FoldedColumns=0,3 FoldedLines=3,7 ... URL=file:///tmp/file.php [Document 1] ... FoldedColumns=0,3 FoldedLines=2,6 ... URL=file:///tmp/file.java
Cannot reproduce this difference java/php today. Still folding info seems to be saved but not loaded. Qt: 4.8.6 KDE Development Platform: 4.13.1 Kate: 3.13.1
I made a mistake with the version (I use two different ones) In latest kate (Qt: 4.8.6/KDE Development Platform: 4.13.1/Kate: 3.13.1) code folding information is NOT stored in the session file. In an earlier 3.11.3 version of kate, code folding information was stored. But not loaded...
building from the latest source and trying to implement the feature looks like "TextFolding" info moved in the session file from [Document] to [Viewspace], must have something to do with http://kate-editor.org/2013/03/27/new-text-folding-in-kate-git-master/ but only commas written here for now as "TextFolding=" info in session file trying to figure out how to output/input the code folding data : "QVariant(QVariantMap, QMap(("endColumn", QVariant(int, 0) ) ( "endLine" , QVariant(int, 56) ) ( "flags" , QVariant(int, 2) ) ( "startColumn" , QVariant(int, 1) ) ( "startLine" , QVariant(int, 46) ) ) )"
data successfully saved/loaded as list "TextFolding=1420,1,1425,1,2" (start line, start column, end line, end column, flags) code folding state seems functionnal again (maybe more tests needed) see attachment
Created attachment 87498 [details] modified readSession/writeSession functions (code folding state)
Cool, Phil! Can you post a diff of you patch (git diff on the command line) on reviewboard.kde.org ? This is the standard way to do a review request in KDE/Kate. Thanks!
done https://git.reviewboard.kde.org/r/119083/
*** Bug 316184 has been marked as a duplicate of this bug. ***
...as I wrote Christoph a few years ago: For me it would be enough to fold all stuff in the same level using mouse_right or mouse_middle. So a class would look before/after folding: class foo{ function foo_1(){ ... } function foo_2(){ ... } function foo_3(){ ... } } class foo{ function foo_1(){ function foo_2(){ function foo_3(){ } This should not be so hard to program and it would also make files, that never had been opend by kate before, easy to handle.
Git commit 390612444dc65f132e6671f564c311fb1e0bf61a by Dominik Haumann. Committed on 05/10/2014 at 16:45. Pushed by dhaumann into branch 'master'. fix: remember code folding state past sessions REVIEW: 120436 FIXED-IN: 5.0 M +1 -1 autotests/src/katetextbuffertest.cpp M +0 -117 autotests/src/kateview_test.cpp M +0 -5 autotests/src/kateview_test.h M +12 -8 src/buffer/katetextfolding.cpp M +7 -5 src/buffer/katetextfolding.h M +8 -8 src/view/kateview.cpp M +1 -1 src/view/kateview.h http://commits.kde.org/ktexteditor/390612444dc65f132e6671f564c311fb1e0bf61a