diff options
author | Neil <nyamatongwe@gmail.com> | 2024-02-09 21:45:35 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2024-02-09 21:45:35 +1100 |
commit | bd53ffcbefe4e7a22fc493b1916939bae5f9dc1d (patch) | |
tree | bfe435d75b222d464a9cbb21e25583d33c591936 /src/Editor.cxx | |
parent | 07a7683902feb4b9944394b9378f0a1a51972497 (diff) | |
download | scintilla-mirror-bd53ffcbefe4e7a22fc493b1916939bae5f9dc1d.tar.gz |
Implement API to read and write undo history from applications.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 2d7d07e22..b8ed636d3 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -6586,6 +6586,49 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { pdoc->EndUndoAction(); return 0; + case Message::GetUndoActions: + return pdoc->UndoActions(); + + case Message::SetUndoSavePoint: + pdoc->SetUndoSavePoint(static_cast<int>(wParam)); + break; + + case Message::GetUndoSavePoint: + return pdoc->UndoSavePoint(); + + case Message::SetUndoCurrent: + pdoc->SetUndoCurrent(static_cast<int>(wParam)); + break; + + case Message::GetUndoCurrent: + return pdoc->UndoCurrent(); + + case Message::SetUndoTentative: + pdoc->SetUndoTentative(static_cast<int>(wParam)); + break; + + case Message::GetUndoTentative: + return pdoc->UndoTentative(); + + case Message::GetUndoActionType: + return pdoc->UndoActionType(static_cast<int>(wParam)); + + case Message::GetUndoActionPosition: + return pdoc->UndoActionPosition(static_cast<int>(wParam)); + + case Message::GetUndoActionText: { + std::string_view text = pdoc->UndoActionText(static_cast<int>(wParam)); + return BytesResult(lParam, reinterpret_cast<const unsigned char *>(text.data()), text.length()); + } + + case Message::PushUndoActionType: + pdoc->PushUndoActionType(static_cast<int>(wParam), lParam); + break; + + case Message::ChangeLastUndoActionText: + pdoc->ChangeLastUndoActionText(wParam, CharPtrFromSPtr(lParam)); + break; + case Message::GetCaretPeriod: return caret.period; |