diff options
author | nyamatongwe <devnull@localhost> | 2007-07-05 00:21:02 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2007-07-05 00:21:02 +0000 |
commit | 814e96c36aa707008ae218f5f97f6f085682ff2b (patch) | |
tree | 792606a63152df696ff4a3b85e3432e0723f3c4d /src | |
parent | c439bce8d8a29ba6ba6960361ad3fa15bca0c617 (diff) | |
download | scintilla-mirror-814e96c36aa707008ae218f5f97f6f085682ff2b.tar.gz |
Moved expansion and contraction of decorators from Editor to Document
as its slightly better modularity.
Diffstat (limited to 'src')
-rw-r--r-- | src/Document.cxx | 5 | ||||
-rw-r--r-- | src/Editor.cxx | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 51800b905..4461e0e72 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -1407,6 +1407,11 @@ void Document::NotifySavePoint(bool atSavePoint) { } void Document::NotifyModified(DocModification mh) { + if (mh.modificationType & SC_MOD_INSERTTEXT) { + decorations.InsertSpace(mh.position, mh.length); + } else if (mh.modificationType & SC_MOD_DELETETEXT) { + decorations.DeleteRange(mh.position, mh.length); + } for (int i = 0; i < lenWatchers; i++) { watchers[i].watcher->NotifyModified(this, mh, watchers[i].userData); } diff --git a/src/Editor.cxx b/src/Editor.cxx index 5d79d550a..916f32316 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3698,13 +3698,11 @@ void Editor::NotifyModified(Document*, DocModification mh, void *) { anchor = MovePositionForInsertion(anchor, mh.position, mh.length); braces[0] = MovePositionForInsertion(braces[0], mh.position, mh.length); braces[1] = MovePositionForInsertion(braces[1], mh.position, mh.length); - pdoc->decorations.InsertSpace(mh.position, mh.length); } else if (mh.modificationType & SC_MOD_DELETETEXT) { currentPos = MovePositionForDeletion(currentPos, mh.position, mh.length); anchor = MovePositionForDeletion(anchor, mh.position, mh.length); braces[0] = MovePositionForDeletion(braces[0], mh.position, mh.length); braces[1] = MovePositionForDeletion(braces[1], mh.position, mh.length); - pdoc->decorations.DeleteRange(mh.position, mh.length); } if (cs.LinesDisplayed() < cs.LinesInDoc()) { // Some lines are hidden so may need shown. |