diff options
author | nyamatongwe <devnull@localhost> | 2007-07-26 07:28:36 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2007-07-26 07:28:36 +0000 |
commit | ca93cd78c042364a4ccef5b9a60702dc4082574d (patch) | |
tree | dab4414ba658b2148c4ebd76ffb52abaac4a0fd3 /src/Document.cxx | |
parent | 6edcf7418b8777ff542502bde920dc7c80e12347 (diff) | |
download | scintilla-mirror-ca93cd78c042364a4ccef5b9a60702dc4082574d.tar.gz |
Added notification for changing line state and use it to redraw if a line
state change overruns the end of painting.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 686758d92..db9949edc 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -113,7 +113,6 @@ void Document::SetSavePoint() { int Document::AddMark(int line, int markerNum) { int prev = cb.AddMark(line, markerNum); DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line); - mh.line = line; NotifyModified(mh); return prev; } @@ -124,14 +123,12 @@ void Document::AddMarkSet(int line, int valueSet) { if (m & 1) cb.AddMark(line, i); DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line); - mh.line = line; NotifyModified(mh); } void Document::DeleteMark(int line, int markerNum) { cb.DeleteMark(line, markerNum); DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, 0, line); - mh.line = line; NotifyModified(mh); } @@ -191,8 +188,7 @@ int Document::SetLevel(int line, int level) { int prev = cb.SetLevel(line, level); if (prev != level) { DocModification mh(SC_MOD_CHANGEFOLD | SC_MOD_CHANGEMARKER, - LineStart(line), 0, 0, 0); - mh.line = line; + LineStart(line), 0, 0, 0, line); mh.foldLevelNow = level; mh.foldLevelPrev = prev; NotifyModified(mh); @@ -1335,11 +1331,17 @@ void Document::EnsureStyledTo(int pos) { } } -void Document::IncrementStyleClock() { - styleClock++; - if (styleClock > 0x100000) { - styleClock = 0; +int Document::SetLineState(int line, int state) { + int statePrevious = cb.SetLineState(line, state); + if (state != statePrevious) { + DocModification mh(SC_MOD_CHANGELINESTATE, 0, 0, 0, 0, line); + NotifyModified(mh); } + return statePrevious; +} + +void Document::IncrementStyleClock() { + styleClock = (styleClock + 1) % 0x100000; } void Document::DecorationFillRange(int position, int value, int fillLength) { |