diff options
| author | nyamatongwe <unknown> | 2009-07-10 04:24:46 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2009-07-10 04:24:46 +0000 | 
| commit | b9c0ee83ce4b36dd6bdb121cf80ec2a95359e16e (patch) | |
| tree | 7dfdab1ffa28fd8f49bb447e5ecf7b3a240d92e9 /src/Document.h | |
| parent | d97f2a1f599a6fdfa408a5a6c01411c03569a899 (diff) | |
| download | scintilla-mirror-b9c0ee83ce4b36dd6bdb121cf80ec2a95359e16e.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. | 
