aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2000-03-16 11:43:39 +0000
committernyamatongwe <devnull@localhost>2000-03-16 11:43:39 +0000
commit01cd695dc8d693c39500f24adf689d08d77d39da (patch)
tree3837357cf607234f40e4b4705c24da1e40ba0758 /src/Editor.cxx
parent8c214e65f503275192e2f3f9dea97fbb65a38254 (diff)
downloadscintilla-mirror-01cd695dc8d693c39500f24adf689d08d77d39da.tar.gz
Split up KeyWords.cxx into 7 individual lexer files Lex*.cxx.
Fixed setting up of second view to get right document length. Changed Python lexer to handle empty lines immediately after fold line and last line of document.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index a606671dd..7f9ce5980 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -991,10 +991,9 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
ypos += screenLinePaintFirst * vs.lineHeight;
int yposScreen = screenLinePaintFirst * vs.lineHeight;
- if (endPosPaint > pdoc->GetEndStyled()) {
- // Notify container to do some more styling
- NotifyStyleNeeded(endPosPaint);
- }
+ // Ensure we are styled as far as we are painting.
+ pdoc->EnsureStyledTo(endPosPaint);
+
if (needUpdateUI) {
NotifyUpdateUI();
needUpdateUI = false;
@@ -1009,7 +1008,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
}
if (paintState == paintAbandoned) {
- // Either NotifyStyleNeeded or NotifyUpdateUI noticed that painting is needed
+ // Either styling or NotifyUpdateUI noticed that painting is needed
// outside the current painting rectangle
//Platform::DebugPrintf("Abandoning paint\n");
return;
@@ -1212,10 +1211,9 @@ long Editor::FormatRange(bool draw, FORMATRANGE *pfr) {
if (linePrintLast < pdoc->LinesTotal())
endPosPrint = pdoc->LineStart(linePrintLast + 1);
- if (endPosPrint > pdoc->GetEndStyled()) {
- // Notify container to do some more styling
- NotifyStyleNeeded(endPosPrint);
- }
+ // Ensure we are styled to where we are formatting.
+ pdoc->EnsureStyledTo(endPosPrint);
+
int xStart = vsPrint.fixedColumnWidth + pfr->rc.left + lineNumberWidth;
int ypos = pfr->rc.top;
int line = linePrintStart;
@@ -1436,6 +1434,10 @@ void Editor::NotifyStyleNeeded(int endStyleNeeded) {
NotifyParent(scn);
}
+void Editor::NotifyStyleNeeded(Document*, void *, int endStyleNeeded) {
+ NotifyStyleNeeded(endStyleNeeded);
+}
+
void Editor::NotifyChar(char ch) {
SCNotification scn;
scn.nmhdr.code = SCN_CHARADDED;
@@ -1903,6 +1905,7 @@ int Editor::KeyCommand(UINT iMessage) {
case SCI_DELWORDRIGHT: {
int endWord = pdoc->NextWordStart(currentPos, 1);
pdoc->DeleteChars(currentPos, endWord - currentPos);
+ MovePositionTo(currentPos);
}
break;
}
@@ -2591,7 +2594,7 @@ void Editor::SetDocPointer(Document *document) {
pdoc->AddRef();
// Reset the contraction state to fully shown.
cs.Clear();
- cs.InsertLines(0, pdoc->LinesTotal());
+ cs.InsertLines(0, pdoc->LinesTotal()-1);
pdoc->AddWatcher(this, 0);
Redraw();