Bug 200753

Summary: Adding a "recently modified lines" system
Product: [Applications] kate Reporter: Jean-Marie Favreau <jm.trivial>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: bugzilla
Priority: HI    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In: 4.8.0
Attachments: Virtual example of the suggested system

Description Jean-Marie Favreau 2009-07-19 11:30:48 UTC
Version:            (using KDE 4.2.2)
OS:                Linux
Installed from:    Debian testing/unstable Packages

A system to bookmark lines is currently available in kate and other kde editors since years.
But a new automatic system as described in the following should be more easy to use.

The idea is to use, as for the bookmarked lines, the scroll bar to add colored marks corresponding to recently modified lines. A shaded system (from white to red for example) may be used to described elapsed time since the last modification, as in the kate list of edited files.
Comment 1 Jean-Marie Favreau 2009-07-19 11:41:33 UTC
Created attachment 35455 [details]
Virtual example of the suggested system
Comment 2 Dominik Haumann 2009-07-19 11:44:26 UTC
Another idea is to use vertical bars as in qt-creator http://www.qtsoftware.com/images/products/screenshot-qt-creator-editor. This indicates what lines are new and saved. We could even have a look at how they implement it.
Comment 3 Jean-Marie Favreau 2009-07-19 12:11:59 UTC
The main advantage of the scroll bar choice is the overview of the integral document. The navigation is more easy with this approach. However the two approaches are mutually complementary.
Comment 4 Dominik Haumann 2010-11-14 22:46:49 UTC
*** Bug 170082 has been marked as a duplicate of this bug. ***
Comment 5 Dominik Haumann 2010-11-21 11:28:58 UTC
Btw, perfectly suited as a GSoC project.
Comment 6 Dominik Haumann 2011-09-03 20:35:34 UTC
Git commit c5946bf2c15bf166be3f83c93c0ac49396582c94 by Dominik Haumann.
Committed on 03/09/2011 at 22:20.
Pushed by dhaumann into branch 'master'.

implement line modification system

TODO:
- unit test
- improve visual appearance
- enable / disable in config page
- optionally show modified lines in scroll bar
- fine tuning

PS: Qt Creator's line modification system is totally buggy :^)
Example: http://wstaw.org/m/2011/09/03/plasma-desktopgz5185.jpg

CCBUG: 200753
CCMAIL: kwrite-devel@kde.org

M  +3    -2    part/undo/kateundomanager.h
M  +14   -1    part/view/kateviewhelpers.cpp
M  +326  -14   part/undo/kateundo.cpp
M  +31   -8    part/undo/kateundomanager.cpp
M  +34   -1    part/buffer/katetextline.h
M  +5    -0    part/buffer/katetextbuffer.h
M  +53   -36   part/undo/kateundo.h
M  +3    -6    part/document/katedocument.cpp
M  +43   -4    part/buffer/katetextblock.cpp
M  +9    -0    part/buffer/katetextbuffer.cpp
M  +5    -0    part/buffer/katetextblock.h

http://commits.kde.org/kate/c5946bf2c15bf166be3f83c93c0ac49396582c94
Comment 7 Dominik Haumann 2011-09-04 19:42:00 UTC
Implemented for KDE 4.8 and works perfectly! If you want, you can try it already now: http://kate-editor.org/get-it/

It does not have scroll-bar marks yet, though. It could be added optionally, but it does not scale: For each modification (typing a character for instance), we'd have to iterate over all lines to repaint the marks in the scrollbar correctly.