diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-02-28 09:35:08 +0000 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-02-28 09:35:08 +0000 |
commit | 30d007d8a6bd01960f9c700f69449c82b14f3835 (patch) | |
tree | b9f71897c8db9fdf2ab2659f8f0841fec60bb7e3 | |
parent | 35874e9a390a13de8f1b1a427a712cff3f38a0e1 (diff) | |
download | notepad2-mod-30d007d8a6bd01960f9c700f69449c82b14f3835.zip notepad2-mod-30d007d8a6bd01960f9c700f69449c82b14f3835.tar.gz notepad2-mod-30d007d8a6bd01960f9c700f69449c82b14f3835.tar.bz2 |
update scintilla
git-svn-id: https://notepad2-mod.googlecode.com/svn/trunk@715 28bd50df-7adb-d945-0439-6e466c6a13cc
-rw-r--r-- | Readme-mod.txt | 2 | ||||
-rw-r--r-- | scintilla/lexers/LexPerl.cxx | 3 | ||||
-rw-r--r-- | scintilla/lexers/LexRuby.cxx | 2 | ||||
-rw-r--r-- | scintilla/lexers/LexTADS3.cxx | 2 | ||||
-rw-r--r-- | scintilla/src/Editor.cxx | 25 | ||||
-rw-r--r-- | scintilla/src/LineMarker.cxx | 6 | ||||
-rw-r--r-- | scintilla/src/LineMarker.h | 2 | ||||
-rw-r--r-- | scintilla/src/ViewStyle.cxx | 25 | ||||
-rw-r--r-- | scintilla/src/ViewStyle.h | 3 |
9 files changed, 50 insertions, 20 deletions
diff --git a/Readme-mod.txt b/Readme-mod.txt index 332b0cc..1ec33bf 100644 --- a/Readme-mod.txt +++ b/Readme-mod.txt @@ -32,5 +32,5 @@ 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.0.3.
-You can use WDK 7.1, MSVC 2010 or Intel C++ Compiler XE 2011 SP1 Update 8
+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/lexers/LexPerl.cxx b/scintilla/lexers/LexPerl.cxx index 2473498..4b33f44 100644 --- a/scintilla/lexers/LexPerl.cxx +++ b/scintilla/lexers/LexPerl.cxx @@ -945,8 +945,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle, sc.SetState(SCE_PL_POD);
} else
fw = fw2;
- } else
- pod = SCE_PL_POD;
+ }
} else {
if (pod == SCE_PL_POD_VERB // still part of current paragraph
&& (styler.GetLineState(ln - 1) == SCE_PL_POD)) {
diff --git a/scintilla/lexers/LexRuby.cxx b/scintilla/lexers/LexRuby.cxx index ee59f3b..58b0fd3 100644 --- a/scintilla/lexers/LexRuby.cxx +++ b/scintilla/lexers/LexRuby.cxx @@ -1192,7 +1192,6 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle, state = SCE_RB_DEFAULT;
i--;
chNext = ch;
- chNext2 = chNext;
preferRE = false;
} else if (HereDoc.Quoted) {
if (ch == HereDoc.Quote) { // closing quote => end of delimiter
@@ -1349,7 +1348,6 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle, }
}
chNext = styler.SafeGetCharAt(i + 1);
- chNext2 = styler.SafeGetCharAt(i + 2);
}
}
// Quotes of all kinds...
diff --git a/scintilla/lexers/LexTADS3.cxx b/scintilla/lexers/LexTADS3.cxx index eab6245..490f1f7 100644 --- a/scintilla/lexers/LexTADS3.cxx +++ b/scintilla/lexers/LexTADS3.cxx @@ -697,7 +697,7 @@ static inline bool IsAnIdentifier(const int style) { }
static inline bool IsAnOperator(const int style) {
- return style == SCE_T3_OPERATOR || SCE_T3_BRACE;
+ return style == SCE_T3_OPERATOR || style == SCE_T3_BRACE;
}
static inline bool IsSpaceEquivalent(const int ch, const int style) {
diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx index 0331ab3..e900982 100644 --- a/scintilla/src/Editor.cxx +++ b/scintilla/src/Editor.cxx @@ -639,6 +639,18 @@ void Editor::RedrawSelMargin(int line, bool allAfter) { if (line != -1) {
int position = pdoc->LineStart(line);
PRectangle rcLine = RectangleFromRange(position, position);
+
+ // Inflate line rectangle if there are image markers with height larger than line height
+ if (vs.largestMarkerHeight > vs.lineHeight) {
+ int delta = (vs.largestMarkerHeight - vs.lineHeight + 1) / 2;
+ rcLine.top -= delta;
+ rcLine.bottom += delta;
+ if (rcLine.top < rcSelMargin.top)
+ rcLine.top = rcSelMargin.top;
+ if (rcLine.bottom > rcSelMargin.bottom)
+ rcLine.bottom = rcSelMargin.bottom;
+ }
+
rcSelMargin.top = rcLine.top;
if (!allAfter)
rcSelMargin.bottom = rcLine.bottom;
@@ -1979,7 +1991,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { tFold = LineMarker::tail;
}
}
- vs.markers[markBit].Draw(surface, rcMarker, vs.styles[STYLE_LINENUMBER].font, tFold);
+ vs.markers[markBit].Draw(surface, rcMarker, vs.styles[STYLE_LINENUMBER].font, tFold, vs.ms[margin].style);
}
marks >>= 1;
}
@@ -8057,8 +8069,10 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { // Marker definition and setting
case SCI_MARKERDEFINE:
- if (wParam <= MARKER_MAX)
+ if (wParam <= MARKER_MAX) {
vs.markers[wParam].markType = lParam;
+ vs.CalcLargestMarkerHeight();
+ }
InvalidateStyleData();
RedrawSelMargin();
break;
@@ -8078,11 +8092,12 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_MARKERSETBACKSELECTED:
if (wParam <= MARKER_MAX)
vs.markers[wParam].backSelected = ColourDesired(lParam);
- InvalidateStyleRedraw();
+ InvalidateStyleData();
+ RedrawSelMargin();
break;
case SCI_MARKERENABLEHIGHLIGHT:
highlightDelimiter.isEnabled = wParam == 1;
- InvalidateStyleRedraw();
+ RedrawSelMargin();
break;
case SCI_MARKERSETBACK:
if (wParam <= MARKER_MAX)
@@ -8129,6 +8144,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_MARKERDEFINEPIXMAP:
if (wParam <= MARKER_MAX) {
vs.markers[wParam].SetXPM(CharPtrFromSPtr(lParam));
+ vs.CalcLargestMarkerHeight();
};
InvalidateStyleData();
RedrawSelMargin();
@@ -8145,6 +8161,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_MARKERDEFINERGBAIMAGE:
if (wParam <= MARKER_MAX) {
vs.markers[wParam].SetRGBAImage(sizeRGBAImage, reinterpret_cast<unsigned char *>(lParam));
+ vs.CalcLargestMarkerHeight();
};
InvalidateStyleData();
RedrawSelMargin();
diff --git a/scintilla/src/LineMarker.cxx b/scintilla/src/LineMarker.cxx index bdbc532..8162b2c 100644 --- a/scintilla/src/LineMarker.cxx +++ b/scintilla/src/LineMarker.cxx @@ -68,7 +68,7 @@ static void DrawMinus(Surface *surface, int centreX, int centreY, int armSize, C surface->FillRectangle(rcH, fore);
}
-void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, typeOfFold tFold) {
+void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharacter, typeOfFold tFold, int marginStyle) {
ColourDesired head = back;
ColourDesired body = back;
ColourDesired tail = back;
@@ -112,8 +112,8 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac int dimOn4 = minDim / 4;
int blobSize = dimOn2-1;
int armSize = dimOn2-2;
- if (rc.Width() > (rc.Height() * 2)) {
- // Wide column is line number so move to left to try to avoid overlapping number
+ if (marginStyle == SC_MARGIN_NUMBER || marginStyle == SC_MARGIN_TEXT || marginStyle == SC_MARGIN_RTEXT) {
+ // On textual margins move marker to the left to try to avoid overlapping the text
centreX = rc.left + dimOn2 + 1;
}
if (markType == SC_MARK_ROUNDRECT) {
diff --git a/scintilla/src/LineMarker.h b/scintilla/src/LineMarker.h index 8607959..c845323 100644 --- a/scintilla/src/LineMarker.h +++ b/scintilla/src/LineMarker.h @@ -65,7 +65,7 @@ public: void SetXPM(const char *textForm);
void SetXPM(const char *const *linesForm);
void SetRGBAImage(Point sizeRGBAImage, const unsigned char *pixelsRGBAImage);
- void Draw(Surface *surface, PRectangle &rc, Font &fontForCharacter, typeOfFold tFold);
+ void Draw(Surface *surface, PRectangle &rc, Font &fontForCharacter, typeOfFold tFold, int marginStyle);
};
#ifdef SCI_NAMESPACE
diff --git a/scintilla/src/ViewStyle.cxx b/scintilla/src/ViewStyle.cxx index 882decc..f7357b1 100644 --- a/scintilla/src/ViewStyle.cxx +++ b/scintilla/src/ViewStyle.cxx @@ -145,6 +145,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) { for (int mrk=0; mrk<=MARKER_MAX; mrk++) {
markers[mrk] = source.markers[mrk];
}
+ CalcLargestMarkerHeight();
for (int ind=0; ind<=INDIC_MAX; ind++) {
indicators[ind] = source.indicators[ind];
}
@@ -194,7 +195,6 @@ ViewStyle::ViewStyle(const ViewStyle &source) { for (int i=0; i < margins; i++) {
ms[i] = source.ms[i];
}
- symbolMargin = source.symbolMargin;
maskInLine = source.maskInLine;
fixedColumnWidth = source.fixedColumnWidth;
zoomLevel = source.zoomLevel;
@@ -230,6 +230,9 @@ void ViewStyle::Init(size_t stylesSize_) { fontNames.Clear();
ResetDefaultStyle();
+ // There are no image markers by default, so no need for calling CalcLargestMarkerHeight()
+ largestMarkerHeight = 0;
+
indicators[0].style = INDIC_SQUIGGLE;
indicators[0].under = false;
indicators[0].fore = ColourDesired(0, 0x7f, 0);
@@ -302,11 +305,9 @@ void ViewStyle::Init(size_t stylesSize_) { ms[2].width = 0;
ms[2].mask = 0;
fixedColumnWidth = leftMarginWidth;
- symbolMargin = false;
maskInLine = 0xffffffff;
for (int margin=0; margin < margins; margin++) {
fixedColumnWidth += ms[margin].width;
- symbolMargin = symbolMargin || (ms[margin].style != SC_MARGIN_NUMBER);
if (ms[margin].width > 0)
maskInLine &= ~ms[margin].mask;
}
@@ -385,11 +386,9 @@ void ViewStyle::Refresh(Surface &surface) { spaceWidth = styles[STYLE_DEFAULT].spaceWidth;
fixedColumnWidth = leftMarginWidth;
- symbolMargin = false;
maskInLine = 0xffffffff;
for (int margin=0; margin < margins; margin++) {
fixedColumnWidth += ms[margin].width;
- symbolMargin = symbolMargin || (ms[margin].style != SC_MARGIN_NUMBER);
if (ms[margin].width > 0)
maskInLine &= ~ms[margin].mask;
}
@@ -457,3 +456,19 @@ bool ViewStyle::ValidStyle(size_t styleIndex) const { return styleIndex < stylesSize;
}
+void ViewStyle::CalcLargestMarkerHeight() {
+ largestMarkerHeight = 0;
+ for (int m = 0; m <= MARKER_MAX; ++m) {
+ switch (markers[m].markType) {
+ case SC_MARK_PIXMAP:
+ if (markers[m].pxpm->GetHeight() > largestMarkerHeight)
+ largestMarkerHeight = markers[m].pxpm->GetHeight();
+ break;
+ case SC_MARK_RGBAIMAGE:
+ if (markers[m].image->GetHeight() > largestMarkerHeight)
+ largestMarkerHeight = markers[m].image->GetHeight();
+ break;
+ }
+ }
+}
+
diff --git a/scintilla/src/ViewStyle.h b/scintilla/src/ViewStyle.h index 331832e..2087b81 100644 --- a/scintilla/src/ViewStyle.h +++ b/scintilla/src/ViewStyle.h @@ -66,6 +66,7 @@ public: size_t stylesSize;
Style *styles;
LineMarker markers[MARKER_MAX + 1];
+ int largestMarkerHeight;
Indicator indicators[INDIC_MAX + 1];
int technology;
int lineHeight;
@@ -103,7 +104,6 @@ public: enum { margins=5 };
int leftMarginWidth; ///< Spacing margin on left of text
int rightMarginWidth; ///< Spacing margin on left of text
- bool symbolMargin;
int maskInLine; ///< Mask for markers to be put into text because there is nowhere for them to go in margin
MarginStyle ms[margins];
int fixedColumnWidth;
@@ -148,6 +148,7 @@ public: void SetStyleFontName(int styleIndex, const char *name);
bool ProtectionActive() const;
bool ValidStyle(size_t styleIndex) const;
+ void CalcLargestMarkerHeight();
};
#ifdef SCI_NAMESPACE
|