Bug 314381 - [PATCH] JJ: Kate remembers place after unchecking metata and deleting sessions file
Summary: [PATCH] JJ: Kate remembers place after unchecking metata and deleting session...
Status: RESOLVED INTENTIONAL
Alias: None
Product: kate
Classification: Applications
Component: sessions (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: LO wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL: http://forum.kde.org/viewtopic.php?f=...
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2013-02-03 20:50 UTC by Greg Lepore
Modified: 2015-10-08 09:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to disable saving any viewspace metadata (cursor position, jump lists, etc.) if so configured (1.25 KB, patch)
2013-02-28 06:19 UTC, Jon Dubovsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Lepore 2013-02-03 20:50:01 UTC
As I understand, the checkbox for Keep meta-information past sessions controls Kate remembering the last edited place in the file and re-opens the file to that place.  However, unchecking that box and deleting the sessions info (~/.kde/share/apps/kate/sessions) is resulting in Kate still remembering places in edited files, but not all of them.  On the files it does occur on, it always occurs.

Reproducible: Always

Steps to Reproduce:
1. Uncheck meta information box
2. Re-open previously edited file

Actual Results:  
3. Kate opens file in last edited place (sometimes)

Expected Results:  
Kate opens file with cursor and view at top of file

Kate version 3.9.5
Kde version 4.95
Comment 1 Greg Lepore 2013-02-08 12:03:24 UTC
Ben Cooksley over at the KDE forums has identified ~/.kde/share/config/katerc as the actual home for the last-edited-place information, along with tons of other information.  Therefore, this bug report should become a wishlist request for Kate to add a GUI feature to disable the remembering of the last-edited-place. Renaming or better explaining the meta-information checkbox would also be helpful.
Comment 2 Greg Lepore 2013-02-14 11:51:28 UTC
Changing this back to a bug because the solution listed above does not work in all (or most) cases.  Kate still remembers the last edited place, even after unchecking the meta-information checkbox and deleting katerc.
Comment 3 Dominik Haumann 2013-02-15 08:30:27 UTC
There is a What's this help telling you that it's for instance about bookmarks.

Looking at the code, the *document* it will save/load:
- the encoding
- the mode/filetype
- the highlighting style
- the indentation mode
- the bookmarks
- the state of the code folding

This depends on the variable m_saveMetaData in KateDocManager.

However, KateViewSpace::saveConfig() and ::restoreConfig() always calls write/readSessionConfig() of all views, saving the line/column in KateView::writeSessionConfig().

If you do not want the line/column tuples to be saved, KateViewSpace would need to honor m_saveMetaData from KateDocManager.

Care to send a patch? Just follow http://kate-editor.org/get-it/ to build and patch Kate.
Comment 4 Dominik Haumann 2013-02-15 11:29:13 UTC
Btw, what's the problem with Kate remembering the cursor position?
Comment 5 Greg Lepore 2013-02-15 11:36:03 UTC
The problem is that I don't want Kate to remember the cursor position, yet it insists (usually) on remembering the cursor position.  I would like every document to open with the cursor at the top, rather than where it was when I last saved the document.  At the very least a configurable setting to reset the cursor position on every load.
Comment 6 Dominik Haumann 2013-02-15 14:08:46 UTC
> At the very least a configurable setting to reset the cursor position on every load.

I object, since if we add an option for such small details, we'll end up with thousands of options.

There are two solutions:
a) close this report as wont-fix
b) honor this in the option [x] Keep Meta Data
Comment 7 Greg Lepore 2013-02-15 14:39:43 UTC
Generally, I agree with you, and I would prefer option B, honoring this as part of Keep Meta Data.  Isn't that exactly what this is  - keeping metadata after the file has been closed?  Were any case studies done to determine if this behavior is preferred by users of the software, or was it just added in for some other reason?

Please don't close it as a Won't Fix until there's persuasive evidence that this is the designed behavior, rather than being because it didn't get put under Keep Meta Data.  Thanks.
Comment 8 Jon Dubovsky 2013-02-28 06:19:41 UTC
Created attachment 77643 [details]
Patch to disable saving any viewspace metadata (cursor position, jump lists, etc.) if so configured

I was in the code for something unrelated and happened to have seen this bug earlier today via a G+ link about junior jobs.  This makes this part of katerc go from:
 [MainWindow0-Splitter 0]
 Children=MainWindow0-ViewSpace 0
 Sizes=982

 [MainWindow0-ViewSpace 0]
 Active View=file:///home/jdubovsky/test.txt
 Count=1
 View 0=file:///home/jdubovsky/test.txt

 [MainWindow0-ViewSpace 0 file:///home/jdubovsky/kde/kate/kate/app/kateviewspace.cpp]
 CursorColumn=67
 CursorLine=204
 JumpList=
 ViMarks=
to:
 [MainWindow0-Splitter 0]
 Children=MainWindow0-ViewSpace 0
 Sizes=982

 [MainWindow0-ViewSpace 0]
 Active View=file:///home/jdubovsky/test.txt
 Count=1
 View 0=file:///home/jdubovsky/test.txt

I don't know much at all about the internals of KEdit, but perhaps this patch will help.
Comment 9 Dominik Haumann 2013-02-28 07:43:59 UTC
Thinking about it, it's rather session related information. Maybe we should add an option to the Sessions config tab in "Elements of Sessions"?
Comment 10 Christoph Cullmann 2015-10-08 09:03:47 UTC
Dear user,

this wish list item is now closed, as it wasn't touched in the last two years and no contributor stepped up to implement it.

The Kate/KTextEditor team is very small and we can just try to keep up with fixing bugs. Therefore wishs that show no activity for two years or more will be closed from now on to keep at least a bit overview about 'current' wishs of the users.

If you want your feature to be implemented, please step up to provide some patch for it. If you think it is really needed, you can reopen your request, but keep in mind, if no new good arguments are made and no people get attracted to help out to implement it, it will expire in two years again.

We have a nice website kate-editor.org that provides all the information needed to contribute, please make use of it. For highlighting improvements our user manual shows how to write syntax definition files.

Greetings
Christoph