SUMMARY Bookmarks are lost after the file is reloaded from "Documents modified on Disk" window STEPS TO REPRODUCE 1. Open or create a non-empty file 2. Place a bookmark on it with Ctrl+B somewhere in the middle. 3. Place cursor somewhere higher 4. Open this file with any other editor and update its content. 5. Return to the first Kate and press "Reload" in the "Documents modified on Disk" window. OBSERVED RESULT The bookmark is disappeared. EXPECTED RESULT The bookmark must be present. SOFTWARE/OS VERSIONS Operating System: Slackware 15.0-rc3 KDE Plasma Version: 5.23.5 KDE Frameworks Version: 5.90.0 Qt Version: 5.15.3 Kernel Version: 5.15.15 (64-bit) Graphics Platform: X11 Processors: 12 × Intel® Core™ i7-9750H CPU @ 2.60GHz Memory: 31.1 GiB of RAM Graphics Processor: Mesa Intel® UHD Graphics 630 ADDITIONAL INFORMATION
They are only restored if the text lines for the marks have not changed. e.g. if you insert a new line at the beginning of the document externally, all marks will vanish. If you just append lines, all should stay. This is handled in bool KTextEditor::DocumentPrivate::documentReload()
(In reply to Christoph Cullmann from comment #1) > They are only restored if the text lines for the marks have not changed. > e.g. if you insert a new line at the beginning of the document externally, > all marks will vanish. > If you just append lines, all should stay. > This is handled in bool KTextEditor::DocumentPrivate::documentReload() The lines with the bookmarks I'm losing never change. Even if a line is changed the bookmark must not be lost, since a diff is available.
Hi, the algorithm is as described below. And no, there is no diff available as that is not implemented in the editor. Naturally one can improve this by implementing a more versatile detection how to move the bookmarks, but that must be done. At the moment, if lines move, their bookmarks are lost. You are free to improve this behavior or find somebody how does that. And this is no grave bug, sorry, not each and every behavior that doesn't fit your needs is a grave issue. For others it is inconvenient if bookmarks end up on wrong lines.
(In reply to Christoph Cullmann from comment #3) > Hi, > > the algorithm is as described below. > > And no, there is no diff available as that is not implemented in the editor. The diffs are available at the moment I press "Reload" since below is a button "See the diff". > > Naturally one can improve this by implementing a more versatile detection > how to move the bookmarks, but that must be done. I could but I have no time. > > At the moment, if lines move, their bookmarks are lost. It is very easy to implement not to do that. Just leave them where they are. > > You are free to improve this behavior or find somebody how does that. Thanks, If I had time or a guy I'd do that, but I do not. > > And this is no grave bug, sorry, not each and every behavior that doesn't > fit your needs is a grave issue. This is really a grave bug as I have to restore 100 bookmarks every week. Is not it? > For others it is inconvenient if bookmarks end up on wrong lines. It is much better than losing them completely. Make a poll.
*** Bug 407602 has been marked as a duplicate of this bug. ***