diff options
author | nyamatongwe <unknown> | 2006-10-17 00:32:34 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2006-10-17 00:32:34 +0000 |
commit | 672b30f73d556b09af3dc4d3afdc5ad24b841a44 (patch) | |
tree | 8df7c305d4f7536b2fe3bb1756449ceb11a4efe4 /src/Document.cxx | |
parent | 924270507fe35db90f99a88eb13242e1c5799bbc (diff) | |
download | scintilla-mirror-672b30f73d556b09af3dc4d3afdc5ad24b841a44.tar.gz |
Armel Asselin contributed a feature that adds the flag SC_STARTACTION to
modification notifications where the modification is the first step of an
undo transaction. This is used to synchronize with the container's undo
stack.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 92be92691..fee76840d 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -380,7 +380,8 @@ bool Document::DeleteChars(int pos, int len) { 0, 0)); int prevLinesTotal = LinesTotal(); bool startSavePoint = cb.IsSavePoint(); - const char *text = cb.DeleteChars(pos * 2, len * 2); + bool startSequence = false; + const char *text = cb.DeleteChars(pos * 2, len * 2, startSequence); if (startSavePoint && cb.IsCollectingUndo()) NotifySavePoint(!startSavePoint); if ((pos < Length()) || (pos == 0)) @@ -389,7 +390,7 @@ bool Document::DeleteChars(int pos, int len) { ModifiedAt(pos-1); NotifyModified( DocModification( - SC_MOD_DELETETEXT | SC_PERFORMED_USER, + SC_MOD_DELETETEXT | SC_PERFORMED_USER | (startSequence?SC_STARTACTION:0), pos, len, LinesTotal() - prevLinesTotal, text)); } @@ -415,13 +416,14 @@ bool Document::InsertStyledString(int position, char *s, int insertLength) { 0, s)); int prevLinesTotal = LinesTotal(); bool startSavePoint = cb.IsSavePoint(); - const char *text = cb.InsertString(position, s, insertLength); + bool startSequence = false; + const char *text = cb.InsertString(position, s, insertLength, startSequence); if (startSavePoint && cb.IsCollectingUndo()) NotifySavePoint(!startSavePoint); ModifiedAt(position / 2); NotifyModified( DocModification( - SC_MOD_INSERTTEXT | SC_PERFORMED_USER, + SC_MOD_INSERTTEXT | SC_PERFORMED_USER | (startSequence?SC_STARTACTION:0), position / 2, insertLength / 2, LinesTotal() - prevLinesTotal, text)); } |