diff options
author | nyamatongwe <devnull@localhost> | 2009-07-10 04:24:46 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2009-07-10 04:24:46 +0000 |
commit | f69c0d399c57d25cda78177a197a0b71d1dc5118 (patch) | |
tree | 7dfdab1ffa28fd8f49bb447e5ecf7b3a240d92e9 /src/Document.h | |
parent | 3eeaf52c92f9524044cf9d118ca3c92ea41769f5 (diff) | |
download | scintilla-mirror-f69c0d399c57d25cda78177a197a0b71d1dc5118.tar.gz |
Duplicate works on discontiguous selections by duplicating each selection.
UndoGroup class simplifies grouping actions together in the undo history.
Diffstat (limited to 'src/Document.h')
-rw-r--r-- | src/Document.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Document.h b/src/Document.h index 4751cd2c8..240d59e39 100644 --- a/src/Document.h +++ b/src/Document.h @@ -320,6 +320,27 @@ private: void NotifyModified(DocModification mh); }; +class UndoGroup { + Document *pdoc; + bool groupNeeded; +public: + UndoGroup(Document *pdoc_, bool groupNeeded_=true) : + pdoc(pdoc_), groupNeeded(groupNeeded_) { + if (groupNeeded) { + pdoc->BeginUndoAction(); + } + } + ~UndoGroup() { + if (groupNeeded) { + pdoc->EndUndoAction(); + } + } + bool Needed() const { + return groupNeeded; + } +}; + + /** * To optimise processing of document modifications by DocWatchers, a hint is passed indicating the * scope of the change. |