aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2022-07-31 15:51:53 +1000
committerNeil <nyamatongwe@gmail.com>2022-07-31 15:51:53 +1000
commit926cb6f7d228b347db16a45e1f2632da475da1f0 (patch)
tree6263662cb8c023502d61b61eed34baa93ed35843 /src/Editor.cxx
parent535e20189d5a2dd9b43a6ea0a74749a50678d631 (diff)
downloadscintilla-mirror-926cb6f7d228b347db16a45e1f2632da475da1f0.tar.gz
Added change history which can display document changes (modified, saved, ...)
in the margin or in the text.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index ccf187c65..c2c31f0d1 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -2405,6 +2405,9 @@ void Editor::NotifySavePoint(bool isSavePoint) {
NotificationData scn = {};
if (isSavePoint) {
scn.nmhdr.code = Notification::SavePointReached;
+ if (changeHistoryOption != ChangeHistoryOption::Disabled) {
+ Redraw();
+ }
} else {
scn.nmhdr.code = Notification::SavePointLeft;
}
@@ -2733,6 +2736,9 @@ void Editor::NotifyModified(Document *, DocModification mh, void *) {
QueueIdleWork(WorkItems::style, mh.position + mh.length);
}
InvalidateRange(mh.position, mh.position + mh.length);
+ if (FlagSet(changeHistoryOption, ChangeHistoryOption::Markers)) {
+ RedrawSelMargin(pdoc->SciLineFromPosition(mh.position));
+ }
}
}
}
@@ -8349,6 +8355,14 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) {
case Message::GetGapPosition:
return pdoc->GapPosition();
+ case Message::SetChangeHistory:
+ changeHistoryOption = static_cast<ChangeHistoryOption>(wParam);
+ pdoc->ChangeHistorySet(wParam & 1);
+ break;
+
+ case Message::GetChangeHistory:
+ return static_cast<sptr_t>(changeHistoryOption);
+
case Message::SetExtraAscent:
vs.extraAscent = static_cast<int>(wParam);
InvalidateStyleRedraw();