summaryrefslogtreecommitdiffstats
path: root/scintilla
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2013-01-01 12:19:03 +0200
committerXhmikosR <xhmikosr@users.sourceforge.net>2013-01-01 12:29:38 +0200
commitbc9766740475927282cad1175a58013b4c4a865c (patch)
treed137db05cee2cee06d6b5ffaf98fcdecd7cd9533 /scintilla
parente0a03f9d558f089f218a49d2a5d33e57db2ea164 (diff)
downloadnotepad2-mod-bc9766740475927282cad1175a58013b4c4a865c.zip
notepad2-mod-bc9766740475927282cad1175a58013b4c4a865c.tar.gz
notepad2-mod-bc9766740475927282cad1175a58013b4c4a865c.tar.bz2
update scintilla (74c71632dd1a HG)
Diffstat (limited to 'scintilla')
-rw-r--r--scintilla/doc/ScintillaDoc.html8
-rw-r--r--scintilla/doc/ScintillaHistory.html2
-rw-r--r--scintilla/doc/ScintillaRelated.html4
-rw-r--r--scintilla/include/Scintilla.h2
-rw-r--r--scintilla/include/Scintilla.iface7
-rw-r--r--scintilla/lexers/LexCPP.cxx32
-rw-r--r--scintilla/src/Editor.cxx12
-rw-r--r--scintilla/src/ScintillaBase.cxx1
-rw-r--r--scintilla/src/ViewStyle.cxx2
-rw-r--r--scintilla/src/ViewStyle.h1
10 files changed, 57 insertions, 14 deletions
diff --git a/scintilla/doc/ScintillaDoc.html b/scintilla/doc/ScintillaDoc.html
index 4eda3ca..8f11d84 100644
--- a/scintilla/doc/ScintillaDoc.html
+++ b/scintilla/doc/ScintillaDoc.html
@@ -2603,6 +2603,8 @@ struct Sci_TextToFind {
<a class="message" href="#SCI_GETCARETLINEBACK">SCI_GETCARETLINEBACK</a><br />
<a class="message" href="#SCI_SETCARETLINEBACKALPHA">SCI_SETCARETLINEBACKALPHA(int alpha)</a><br />
<a class="message" href="#SCI_GETCARETLINEBACKALPHA">SCI_GETCARETLINEBACKALPHA</a><br />
+ <a class="message" href="#SCI_SETCARETLINEVISIBLEALWAYS">SCI_SETCARETLINEVISIBLEALWAYS(bool alwaysVisible)</a><br />
+ <a class="message" href="#SCI_GETCARETLINEVISIBLEALWAYS">SCI_GETCARETLINEVISIBLEALWAYS</a><br />
<a class="message" href="#SCI_SETCARETPERIOD">SCI_SETCARETPERIOD(int milliseconds)</a><br />
<a class="message" href="#SCI_GETCARETPERIOD">SCI_GETCARETPERIOD</a><br />
<a class="message" href="#SCI_SETCARETSTYLE">SCI_SETCARETSTYLE(int style)</a><br />
@@ -2667,6 +2669,12 @@ struct Sci_TextToFind {
the caret line is drawn after all other features so will affect the colour of all other features.
</p>
+ <p><b id="SCI_SETCARETLINEVISIBLEALWAYS">SCI_SETCARETLINEVISIBLEALWAYS(bool alwaysVisible)</b><br />
+ <b id="SCI_GETCARETLINEVISIBLEALWAYS">SCI_GETCARETLINEVISIBLEALWAYS</b><br />
+ Choose to make the caret line always visible even when the window is not in focus.
+ Default behaviour <code>SCI_SETCARETLINEVISIBLEALWAYS(false)</code> the caret line is only visible when the window is in focus.
+ </p>
+
<p><b id="SCI_SETCARETPERIOD">SCI_SETCARETPERIOD(int milliseconds)</b><br />
<b id="SCI_GETCARETPERIOD">SCI_GETCARETPERIOD</b><br />
The rate at which the caret blinks can be set with <code>SCI_SETCARETPERIOD</code> which
diff --git a/scintilla/doc/ScintillaHistory.html b/scintilla/doc/ScintillaHistory.html
index 13f7fc7..032e7a0 100644
--- a/scintilla/doc/ScintillaHistory.html
+++ b/scintilla/doc/ScintillaHistory.html
@@ -413,6 +413,8 @@
</tr><tr>
<td>Sakshi Verma</td>
<td>Joel B. Mohler</td>
+ <td>Isiledhel</td>
+ <td>Vidya Wasi</td>
</tr>
</table>
<p>
diff --git a/scintilla/doc/ScintillaRelated.html b/scintilla/doc/ScintillaRelated.html
index af7f597..242bc62 100644
--- a/scintilla/doc/ScintillaRelated.html
+++ b/scintilla/doc/ScintillaRelated.html
@@ -127,6 +127,10 @@
Projects using Scintilla
</h3>
<p>
+ <a href="http://www.qgis.org/">Quantum GIS</a>
+ is a user friendly Open Source Geographic Information System (GIS).
+ </p>
+ <p>
<a href="https://gitorious.org/qgrinui">QGrinUI</a>
searches for a regex within all relevant files in a directory and shows matches using
SciTE through the director interface.
diff --git a/scintilla/include/Scintilla.h b/scintilla/include/Scintilla.h
index ac3ff10..053ec62 100644
--- a/scintilla/include/Scintilla.h
+++ b/scintilla/include/Scintilla.h
@@ -853,6 +853,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_FINDINDICATORHIDE 2642
#define SCI_VCHOMEDISPLAY 2652
#define SCI_VCHOMEDISPLAYEXTEND 2653
+#define SCI_GETCARETLINEVISIBLEALWAYS 2654
+#define SCI_SETCARETLINEVISIBLEALWAYS 2655
#define SCI_STARTRECORD 3001
#define SCI_STOPRECORD 3002
#define SCI_SETLEXER 4001
diff --git a/scintilla/include/Scintilla.iface b/scintilla/include/Scintilla.iface
index 446f67e..0691b1b 100644
--- a/scintilla/include/Scintilla.iface
+++ b/scintilla/include/Scintilla.iface
@@ -2267,6 +2267,12 @@ fun void VCHomeDisplay=2652(,)
# Like VCHomeDisplay but extending selection to new caret position.
fun void VCHomeDisplayExtend=2653(,)
+# Is the caret line always visible?
+get bool GetCaretLineVisibleAlways=2654(,)
+
+# Sets the caret line to always visible.
+set void SetCaretLineVisibleAlways=2655(bool alwaysVisible,)
+
# Start notifying the container of all key presses and commands.
fun void StartRecord=3001(,)
@@ -3408,6 +3414,7 @@ val SCE_KIX_FUNCTIONS=8
val SCE_KIX_OPERATOR=9
val SCE_KIX_IDENTIFIER=31
# Lexical states for SCLEX_GUI4CLI
+lex Gui4Cli=SCLEX_GUI4CLI SCE_GC_
val SCE_GC_DEFAULT=0
val SCE_GC_COMMENTLINE=1
val SCE_GC_COMMENTBLOCK=2
diff --git a/scintilla/lexers/LexCPP.cxx b/scintilla/lexers/LexCPP.cxx
index 0d7ea45..d08bc1b 100644
--- a/scintilla/lexers/LexCPP.cxx
+++ b/scintilla/lexers/LexCPP.cxx
@@ -88,10 +88,13 @@ static std::string GetRestOfLine(LexAccessor &styler, int start, bool allowSpace
int i =0;
char ch = styler.SafeGetCharAt(start, '\n');
while ((ch != '\r') && (ch != '\n')) {
+ char chNext = styler.SafeGetCharAt(start + i + 1, '\n');
+ if (ch == '/' && (chNext == '/' || chNext == '*'))
+ break;
if (allowSpace || (ch != ' '))
restOfLine += ch;
i++;
- ch = styler.SafeGetCharAt(start + i, '\n');
+ ch = chNext;
}
return restOfLine;
}
@@ -468,6 +471,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
bool continuationLine = false;
bool isIncludePreprocessor = false;
bool isStringInPreprocessor = false;
+ bool inRERange = false;
int lineCurrent = styler.GetLine(startPos);
if ((MaskActive(initStyle) == SCE_C_PREPROCESSOR) ||
@@ -541,6 +545,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
visibleChars = 0;
lastWordWasUUID = false;
isIncludePreprocessor = false;
+ inRERange = false;
if (preproc.IsInactive()) {
activitySet = activeFlag;
sc.SetState(sc.state | activitySet);
@@ -745,16 +750,18 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
case SCE_C_REGEX:
if (sc.atLineStart) {
sc.SetState(SCE_C_DEFAULT|activitySet);
- } else if (sc.ch == '/') {
+ } else if (! inRERange && sc.ch == '/') {
sc.Forward();
while ((sc.ch < 0x80) && islower(sc.ch))
sc.Forward(); // gobble regex flags
sc.SetState(SCE_C_DEFAULT|activitySet);
- } else if (sc.ch == '\\') {
- // Gobble up the quoted character
- if (sc.chNext == '\\' || sc.chNext == '/') {
- sc.Forward();
- }
+ } else if (sc.ch == '\\' && (sc.chNext != '\n' && sc.chNext != '\r')) {
+ // Gobble up the escaped character
+ sc.Forward();
+ } else if (sc.ch == '[') {
+ inRERange = true;
+ } else if (sc.ch == ']') {
+ inRERange = false;
}
break;
case SCE_C_STRINGEOL:
@@ -835,6 +842,7 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
&& (!setCouldBePostOp.Contains(chPrevNonWhite)
|| !FollowsPostfixOperator(sc, styler))) {
sc.SetState(SCE_C_REGEX|activitySet); // JavaScript's RegEx
+ inRERange = false;
} else if (sc.ch == '\"') {
if (sc.chPrev == 'R') {
styler.Flush();
@@ -1172,7 +1180,7 @@ bool LexerCPP::EvaluateExpression(const std::string &expr, const std::map<std::s
std::vector<std::string> tokens;
const char *cp = expr.c_str();
for (;;) {
- if (setWord.Contains(*cp)) {
+ if (setWord.Contains(static_cast<unsigned char>(*cp))) {
word += *cp;
} else {
std::map<std::string, std::string>::const_iterator it = preprocessorDefinitions.find(word);
@@ -1187,13 +1195,13 @@ bool LexerCPP::EvaluateExpression(const std::string &expr, const std::map<std::s
}
if ((*cp != ' ') && (*cp != '\t')) {
std::string op(cp, 1);
- if (setRelOp.Contains(*cp)) {
- if (setRelOp.Contains(cp[1])) {
+ if (setRelOp.Contains(static_cast<unsigned char>(*cp))) {
+ if (setRelOp.Contains(static_cast<unsigned char>(cp[1]))) {
op += cp[1];
cp++;
}
- } else if (setLogicalOp.Contains(*cp)) {
- if (setLogicalOp.Contains(cp[1])) {
+ } else if (setLogicalOp.Contains(static_cast<unsigned char>(*cp))) {
+ if (setLogicalOp.Contains(static_cast<unsigned char>(cp[1]))) {
op += cp[1];
cp++;
}
diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx
index e86ff6a..9d7ab1d 100644
--- a/scintilla/src/Editor.cxx
+++ b/scintilla/src/Editor.cxx
@@ -2743,7 +2743,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
// the color for the highest numbered one is used.
bool overrideBackground = false;
ColourDesired background;
- if (caret.active && vsDraw.showCaretLineBackground && (vsDraw.caretLineAlpha == SC_ALPHA_NOALPHA) && ll->containsCaret) {
+ if ((caret.active || vsDraw.alwaysShowCaretLineBackground) && vsDraw.showCaretLineBackground && (vsDraw.caretLineAlpha == SC_ALPHA_NOALPHA) && ll->containsCaret) {
overrideBackground = true;
background = vsDraw.caretLineBackground;
}
@@ -3193,7 +3193,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
// Draw any translucent whole line states
rcSegment = rcLine;
- if (caret.active && vsDraw.showCaretLineBackground && ll->containsCaret) {
+ if ((caret.active || vsDraw.alwaysShowCaretLineBackground) && vsDraw.showCaretLineBackground && ll->containsCaret) {
SimpleAlphaRectangle(surface, rcSegment, vsDraw.caretLineBackground, vsDraw.caretLineAlpha);
}
marks = pdoc->GetMark(line);
@@ -3738,6 +3738,7 @@ long Editor::FormatRange(bool draw, Sci_RangeToFormat *pfr) {
vsPrint.whitespaceBackgroundSet = false;
vsPrint.whitespaceForegroundSet = false;
vsPrint.showCaretLineBackground = false;
+ vsPrint.alwaysShowCaretLineBackground = false;
// Don't highlight matching braces using indicators
vsPrint.braceHighlightIndicatorSet = false;
vsPrint.braceBadLightIndicatorSet = false;
@@ -8338,6 +8339,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
vs.showCaretLineBackground = wParam != 0;
InvalidateStyleRedraw();
break;
+ case SCI_GETCARETLINEVISIBLEALWAYS:
+ return vs.alwaysShowCaretLineBackground;
+ case SCI_SETCARETLINEVISIBLEALWAYS:
+ vs.alwaysShowCaretLineBackground = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
case SCI_GETCARETLINEBACK:
return vs.caretLineBackground.AsLong();
case SCI_SETCARETLINEBACK:
diff --git a/scintilla/src/ScintillaBase.cxx b/scintilla/src/ScintillaBase.cxx
index aa1874b..4a88411 100644
--- a/scintilla/src/ScintillaBase.cxx
+++ b/scintilla/src/ScintillaBase.cxx
@@ -202,6 +202,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
const char *typeSep = strchr(list, ac.GetTypesep());
int lenInsert = typeSep ?
static_cast<int>(typeSep-list) : static_cast<int>(strlen(list));
+ UndoGroup ug(pdoc);
if (ac.ignoreCase) {
SetEmptySelection(sel.MainCaret() - lenEntered);
pdoc->DeleteChars(sel.MainCaret(), lenEntered);
diff --git a/scintilla/src/ViewStyle.cxx b/scintilla/src/ViewStyle.cxx
index 2f51723..cdad268 100644
--- a/scintilla/src/ViewStyle.cxx
+++ b/scintilla/src/ViewStyle.cxx
@@ -180,6 +180,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
caretcolour = source.caretcolour;
additionalCaretColour = source.additionalCaretColour;
showCaretLineBackground = source.showCaretLineBackground;
+ alwaysShowCaretLineBackground = source.alwaysShowCaretLineBackground;
caretLineBackground = source.caretLineBackground;
caretLineAlpha = source.caretLineAlpha;
edgecolour = source.edgecolour;
@@ -274,6 +275,7 @@ void ViewStyle::Init(size_t stylesSize_) {
caretcolour = ColourDesired(0, 0, 0);
additionalCaretColour = ColourDesired(0x7f, 0x7f, 0x7f);
showCaretLineBackground = false;
+ alwaysShowCaretLineBackground = false;
caretLineBackground = ColourDesired(0xff, 0xff, 0);
caretLineAlpha = SC_ALPHA_NOALPHA;
edgecolour = ColourDesired(0xc0, 0xc0, 0xc0);
diff --git a/scintilla/src/ViewStyle.h b/scintilla/src/ViewStyle.h
index 4c35db9..c54448d 100644
--- a/scintilla/src/ViewStyle.h
+++ b/scintilla/src/ViewStyle.h
@@ -115,6 +115,7 @@ public:
ColourDesired caretcolour;
ColourDesired additionalCaretColour;
bool showCaretLineBackground;
+ bool alwaysShowCaretLineBackground;
ColourDesired caretLineBackground;
int caretLineAlpha;
ColourDesired edgecolour;