diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-04-24 17:09:20 +0000 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-04-24 17:09:20 +0000 |
commit | 6140d91c1e4ae27ed14e82d248b89f0a02003960 (patch) | |
tree | f900b9083ba482a18daf5feec4082fab75ab9123 | |
parent | 0e2eb77911c3cfec255a8f3db2da06dd3d3d9988 (diff) | |
download | notepad2-mod-6140d91c1e4ae27ed14e82d248b89f0a02003960.zip notepad2-mod-6140d91c1e4ae27ed14e82d248b89f0a02003960.tar.gz notepad2-mod-6140d91c1e4ae27ed14e82d248b89f0a02003960.tar.bz2 |
update scintilla
git-svn-id: https://notepad2-mod.googlecode.com/svn/trunk@734 28bd50df-7adb-d945-0439-6e466c6a13cc
-rw-r--r-- | Readme-mod.txt | 2 | ||||
-rw-r--r-- | scintilla/doc/ScintillaDoc.html | 6 | ||||
-rw-r--r-- | scintilla/include/Scintilla.h | 1 | ||||
-rw-r--r-- | scintilla/include/Scintilla.iface | 1 | ||||
-rw-r--r-- | scintilla/lexers/LexHTML.cxx | 11 | ||||
-rw-r--r-- | scintilla/lexlib/LexAccessor.h | 2 | ||||
-rw-r--r-- | scintilla/src/Editor.cxx | 52 | ||||
-rw-r--r-- | scintilla/src/LineMarker.h | 26 |
8 files changed, 61 insertions, 40 deletions
diff --git a/Readme-mod.txt b/Readme-mod.txt index f900fff..02ee14e 100644 --- a/Readme-mod.txt +++ b/Readme-mod.txt @@ -31,6 +31,6 @@ Ctrl+Alt+F2 Expand selection to next match. Ctrl+Alt+Shift+F2 Expand selection to previous match.
Ctrl+Shift+Enter New line with toggled auto indent option.
-Notepad2-mod 4.2.25 has been created with Scintilla 3.1.0.
+Notepad2-mod 4.2.25 has been created with Scintilla 3.1.0 HG b14cefb66637.
You can use WDK 7.1, MSVC 2010 or Intel C++ Compiler XE 2011 SP1 Update 9
to build Notepad2-mod.
diff --git a/scintilla/doc/ScintillaDoc.html b/scintilla/doc/ScintillaDoc.html index fba1237..e02da3c 100644 --- a/scintilla/doc/ScintillaDoc.html +++ b/scintilla/doc/ScintillaDoc.html @@ -5249,6 +5249,12 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ Subline is indented by at least 1 to make room for the flag.<br />
</td>
</tr>
+
+ <tr>
+ <td align="left"><code>SC_WRAPVISUALFLAG_MARGIN</code></td>
+ <td align="center">4</td>
+ <td>Visual flag in line number margin.</td>
+ </tr>
</tbody>
</table>
diff --git a/scintilla/include/Scintilla.h b/scintilla/include/Scintilla.h index 0aaf0de..b9697e9 100644 --- a/scintilla/include/Scintilla.h +++ b/scintilla/include/Scintilla.h @@ -460,6 +460,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_WRAPVISUALFLAG_NONE 0x0000
#define SC_WRAPVISUALFLAG_END 0x0001
#define SC_WRAPVISUALFLAG_START 0x0002
+#define SC_WRAPVISUALFLAG_MARGIN 0x0004
#define SCI_SETWRAPVISUALFLAGS 2460
#define SCI_GETWRAPVISUALFLAGS 2461
#define SC_WRAPVISUALFLAGLOC_DEFAULT 0x0000
diff --git a/scintilla/include/Scintilla.iface b/scintilla/include/Scintilla.iface index 0f8ef89..7da9c61 100644 --- a/scintilla/include/Scintilla.iface +++ b/scintilla/include/Scintilla.iface @@ -1152,6 +1152,7 @@ enu WrapVisualFlag=SC_WRAPVISUALFLAG_ val SC_WRAPVISUALFLAG_NONE=0x0000
val SC_WRAPVISUALFLAG_END=0x0001
val SC_WRAPVISUALFLAG_START=0x0002
+val SC_WRAPVISUALFLAG_MARGIN=0x0004
# Set the display mode of visual flags for wrapped lines.
set void SetWrapVisualFlags=2460(int wrapVisualFlags,)
diff --git a/scintilla/lexers/LexHTML.cxx b/scintilla/lexers/LexHTML.cxx index abfa98f..7bda6cf 100644 --- a/scintilla/lexers/LexHTML.cxx +++ b/scintilla/lexers/LexHTML.cxx @@ -598,11 +598,12 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty char djangoBlockType[2];
djangoBlockType[0] = '\0';
- // If inside a tag, it may be a script tag, so reread from the start to ensure any language tags are seen
+ // If inside a tag, it may be a script tag, so reread from the start of line starting tag to ensure any language tags are seen
if (InTagState(state)) {
while ((startPos > 0) && (InTagState(styler.StyleAt(startPos - 1)))) {
- startPos--;
- length++;
+ int backLineStart = styler.LineStart(styler.GetLine(startPos-1));
+ length += startPos - backLineStart;
+ startPos = backLineStart;
}
state = SCE_H_DEFAULT;
}
@@ -1584,6 +1585,10 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty state = SCE_HJ_COMMENTDOC;
else
state = SCE_HJ_COMMENT;
+ if (chNext2 == '/') {
+ // Eat the * so it isn't used for the end of the comment
+ i++;
+ }
} else if (ch == '/' && chNext == '/') {
styler.ColourTo(i - 1, StateToPrint);
state = SCE_HJ_COMMENTLINE;
diff --git a/scintilla/lexlib/LexAccessor.h b/scintilla/lexlib/LexAccessor.h index 0ad7bc1..4072059 100644 --- a/scintilla/lexlib/LexAccessor.h +++ b/scintilla/lexlib/LexAccessor.h @@ -146,7 +146,7 @@ public: } else {
if (chAttr != chWhile)
chFlags = 0;
- chAttr |= chFlags;
+ chAttr = static_cast<char>(chAttr | chFlags);
for (unsigned int i = startSeg; i <= pos; i++) {
assert((startPosStyling + validLen) < Length());
styleBuf[validLen++] = static_cast<char>(chAttr);
diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx index d8d591d..928154e 100644 --- a/scintilla/src/Editor.cxx +++ b/scintilla/src/Editor.cxx @@ -1939,28 +1939,33 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { rcMarker.top = yposScreen;
rcMarker.bottom = yposScreen + vs.lineHeight;
if (vs.ms[margin].style == SC_MARGIN_NUMBER) {
- char number[100];
- number[0] = '\0';
- if (firstSubLine)
+ if (firstSubLine) {
+ char number[100];
sprintf(number, "%d", lineDoc + 1);
- if (foldFlags & SC_FOLDFLAG_LEVELNUMBERS) {
- int lev = pdoc->GetLevel(lineDoc);
- sprintf(number, "%c%c %03X %03X",
- (lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_',
- (lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_',
- lev & SC_FOLDLEVELNUMBERMASK,
- lev >> 16
- );
+ if (foldFlags & SC_FOLDFLAG_LEVELNUMBERS) {
+ int lev = pdoc->GetLevel(lineDoc);
+ sprintf(number, "%c%c %03X %03X",
+ (lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_',
+ (lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_',
+ lev & SC_FOLDLEVELNUMBERMASK,
+ lev >> 16
+ );
+ }
+ PRectangle rcNumber = rcMarker;
+ // Right justify
+ XYPOSITION width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, istrlen(number));
+ XYPOSITION xpos = rcNumber.right - width - 3;
+ rcNumber.left = xpos;
+ surface->DrawTextNoClip(rcNumber, vs.styles[STYLE_LINENUMBER].font,
+ rcNumber.top + vs.maxAscent, number, istrlen(number),
+ vs.styles[STYLE_LINENUMBER].fore,
+ vs.styles[STYLE_LINENUMBER].back);
+ } else if (wrapVisualFlags & SC_WRAPVISUALFLAG_MARGIN) {
+ PRectangle rcWrapMarker = rcMarker;
+ rcWrapMarker.right -= 3;
+ rcWrapMarker.left = rcWrapMarker.right - vs.styles[STYLE_LINENUMBER].aveCharWidth;
+ DrawWrapMarker(surface, rcWrapMarker, false, vs.styles[STYLE_LINENUMBER].fore);
}
- PRectangle rcNumber = rcMarker;
- // Right justify
- XYPOSITION width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, istrlen(number));
- XYPOSITION xpos = rcNumber.right - width - 3;
- rcNumber.left = xpos;
- surface->DrawTextNoClip(rcNumber, vs.styles[STYLE_LINENUMBER].font,
- rcNumber.top + vs.maxAscent, number, istrlen(number),
- vs.styles[STYLE_LINENUMBER].fore,
- vs.styles[STYLE_LINENUMBER].back);
} else if (vs.ms[margin].style == SC_MARGIN_TEXT || vs.ms[margin].style == SC_MARGIN_RTEXT) {
if (firstSubLine) {
const StyledText stMargin = pdoc->MarginStyledText(lineDoc);
@@ -2757,7 +2762,6 @@ void Editor::DrawAnnotation(Surface *surface, ViewStyle &vsDraw, int line, int x widthAnnotation += vsDraw.spaceWidth * 2; // Margins
rcSegment.left = xStart + indent;
rcSegment.right = rcSegment.left + widthAnnotation;
- surface->PenColour(vsDraw.styles[vsDraw.annotationStyleOffset].fore);
} else {
rcSegment.left = xStart;
}
@@ -2779,6 +2783,7 @@ void Editor::DrawAnnotation(Surface *surface, ViewStyle &vsDraw, int line, int x DrawStyledText(surface, vsDraw, vsDraw.annotationStyleOffset, rcText, rcText.top + vsDraw.maxAscent,
stAnnotation, start, lengthAnnotation);
if (vs.annotationVisible == ANNOTATION_BOXED) {
+ surface->PenColour(vsDraw.styles[vsDraw.annotationStyleOffset].fore);
surface->MoveTo(rcSegment.left, rcSegment.top);
surface->LineTo(rcSegment.left, rcSegment.bottom);
surface->MoveTo(rcSegment.right, rcSegment.top);
@@ -6214,7 +6219,7 @@ void Editor::MouseLeave() { }
static bool AllowVirtualSpace(int virtualSpaceOptions, bool rectangular) {
- return ((virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0)
+ return (!rectangular && ((virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0))
|| (rectangular && ((virtualSpaceOptions & SCVS_RECTANGULARSELECTION) != 0));
}
@@ -6245,7 +6250,8 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b if (((curTime - lastClickTime) < Platform::DoubleClickTime()) && Close(pt, lastClick)) {
//Platform::DebugPrintf("Double click %d %d = %d\n", curTime, lastClickTime, curTime - lastClickTime);
SetMouseCapture(true);
- SetEmptySelection(newPos.Position());
+ if (!ctrl || !multipleSelection || (selectionType != selChar && selectionType != selWord))
+ SetEmptySelection(newPos.Position());
bool doubleClick = false;
// Stop mouse button bounce changing selection type
if (!Platform::MouseButtonBounce() || curTime != lastClickTime) {
diff --git a/scintilla/src/LineMarker.h b/scintilla/src/LineMarker.h index c845323..f8960c8 100644 --- a/scintilla/src/LineMarker.h +++ b/scintilla/src/LineMarker.h @@ -36,7 +36,7 @@ public: image = NULL;
}
LineMarker(const LineMarker &) {
- // Defined to avoid pxpm being blindly copied, not as real copy constructor
+ // Defined to avoid pxpm being blindly copied, not as a complete copy constructor
markType = SC_MARK_CIRCLE;
fore = ColourDesired(0,0,0);
back = ColourDesired(0xff,0xff,0xff);
@@ -49,17 +49,19 @@ public: delete pxpm;
delete image;
}
- LineMarker &operator=(const LineMarker &) {
- // Defined to avoid pxpm being blindly copied, not as real assignment operator
- markType = SC_MARK_CIRCLE;
- fore = ColourDesired(0,0,0);
- back = ColourDesired(0xff,0xff,0xff);
- backSelected = ColourDesired(0xff,0x00,0x00);
- alpha = SC_ALPHA_NOALPHA;
- delete pxpm;
- pxpm = NULL;
- delete image;
- image = NULL;
+ LineMarker &operator=(const LineMarker &other) {
+ // Defined to avoid pxpm being blindly copied, not as a complete assignment operator
+ if (this != &other) {
+ markType = SC_MARK_CIRCLE;
+ fore = ColourDesired(0,0,0);
+ back = ColourDesired(0xff,0xff,0xff);
+ backSelected = ColourDesired(0xff,0x00,0x00);
+ alpha = SC_ALPHA_NOALPHA;
+ delete pxpm;
+ pxpm = NULL;
+ delete image;
+ image = NULL;
+ }
return *this;
}
void SetXPM(const char *textForm);
|