diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-02-06 11:35:38 +0000 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-02-06 11:35:38 +0000 |
commit | 990cfd26e83364ece0ec427d9e63c2d0c32551d6 (patch) | |
tree | cb82e330557509d4854afb3dc6165d645d24d74c /scintilla/src | |
parent | b1b4b135ac68a30e8ab0d6b7deef3dad60b5a0bc (diff) | |
download | notepad2-mod-990cfd26e83364ece0ec427d9e63c2d0c32551d6.zip notepad2-mod-990cfd26e83364ece0ec427d9e63c2d0c32551d6.tar.gz notepad2-mod-990cfd26e83364ece0ec427d9e63c2d0c32551d6.tar.bz2 |
update scintilla
git-svn-id: https://notepad2-mod.googlecode.com/svn/trunk@711 28bd50df-7adb-d945-0439-6e466c6a13cc
Diffstat (limited to 'scintilla/src')
-rw-r--r-- | scintilla/src/Editor.cxx | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx index a37d9c6..b643ad3 100644 --- a/scintilla/src/Editor.cxx +++ b/scintilla/src/Editor.cxx @@ -4496,6 +4496,7 @@ void Editor::CheckModificationForWrap(DocModification mh) { if (wrapState != eWrapNone) {
NeedWrapping(lineDoc, lineDoc + lines + 1);
}
+ RefreshStyleData();
// Fix up annotation heights
SetAnnotationHeights(lineDoc, lineDoc + lines + 2);
}
@@ -5001,30 +5002,50 @@ void Editor::CursorUpOrDown(int direction, Selection::selTypes selt) { caretToUse = sel.Rectangular().caret;
}
}
+
Point pt = LocationFromPosition(caretToUse);
- int lineDoc = pdoc->LineFromPosition(caretToUse.Position());
- Point ptStartLine = LocationFromPosition(pdoc->LineStart(lineDoc));
- int subLine = (pt.y - ptStartLine.y) / vs.lineHeight;
- int commentLines = vs.annotationVisible ? pdoc->AnnotationLines(lineDoc) : 0;
- SelectionPosition posNew = SPositionFromLocation(
- Point(lastXChosen - xOffset, pt.y + direction * vs.lineHeight), false, false, UserVirtualSpace());
- if ((direction > 0) && (subLine >= (cs.GetHeight(lineDoc) - 1 - commentLines))) {
- posNew = SPositionFromLocation(
- Point(lastXChosen - xOffset, pt.y + (commentLines + 1) * vs.lineHeight), false, false, UserVirtualSpace());
+ int skipLines = 0;
+
+ if (vs.annotationVisible) {
+ int lineDoc = pdoc->LineFromPosition(caretToUse.Position());
+ Point ptStartLine = LocationFromPosition(pdoc->LineStart(lineDoc));
+ int subLine = (pt.y - ptStartLine.y) / vs.lineHeight;
+
+ if (direction < 0 && subLine == 0) {
+ int lineDisplay = cs.DisplayFromDoc(lineDoc);
+ if (lineDisplay > 0) {
+ skipLines = pdoc->AnnotationLines(cs.DocFromDisplay(lineDisplay - 1));
+ }
+ } else if (direction > 0 && subLine >= (cs.GetHeight(lineDoc) - 1 - pdoc->AnnotationLines(lineDoc))) {
+ skipLines = pdoc->AnnotationLines(lineDoc);
+ }
}
+
+ int newY = pt.y + (1 + skipLines) * direction * vs.lineHeight;
+ SelectionPosition posNew = SPositionFromLocation(
+ Point(lastXChosen - xOffset, newY), false, false, UserVirtualSpace());
+
if (direction < 0) {
// Line wrapping may lead to a location on the same line, so
// seek back if that is the case.
- // There is an equivalent case when moving down which skips
- // over a line but as that does not trap the user it is fine.
Point ptNew = LocationFromPosition(posNew.Position());
while ((posNew.Position() > 0) && (pt.y == ptNew.y)) {
- posNew.Add(- 1);
+ posNew.Add(-1);
+ posNew.SetVirtualSpace(0);
+ ptNew = LocationFromPosition(posNew.Position());
+ }
+ } else if (direction > 0 && posNew.Position() != pdoc->Length()) {
+ // There is an equivalent case when moving down which skips
+ // over a line.
+ Point ptNew = LocationFromPosition(posNew.Position());
+ while ((posNew.Position() > caretToUse.Position()) && (ptNew.y > newY)) {
+ posNew.Add(-1);
posNew.SetVirtualSpace(0);
ptNew = LocationFromPosition(posNew.Position());
}
}
- MovePositionTo(posNew, selt);
+
+ MovePositionTo(MovePositionSoVisible(posNew, direction), selt);
}
void Editor::ParaUpOrDown(int direction, Selection::selTypes selt) {
|