diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2011-09-23 08:33:32 +0000 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2011-09-23 08:33:32 +0000 |
commit | 9ec2572dd796bd73a82c2a0512bc75cc4139b245 (patch) | |
tree | 726687904db9eb11339cd32326f635730c6e92c0 | |
parent | ab6ec83702436ef852a7a20d2ca227d0de7ca4e6 (diff) | |
download | notepad2-mod-9ec2572dd796bd73a82c2a0512bc75cc4139b245.zip notepad2-mod-9ec2572dd796bd73a82c2a0512bc75cc4139b245.tar.gz notepad2-mod-9ec2572dd796bd73a82c2a0512bc75cc4139b245.tar.bz2 |
update Scintilla
git-svn-id: https://notepad2-mod.googlecode.com/svn/trunk@574 28bd50df-7adb-d945-0439-6e466c6a13cc
-rw-r--r-- | scintilla/include/Face.py | 6 | ||||
-rw-r--r-- | scintilla/include/SciLexer.h | 1 | ||||
-rw-r--r-- | scintilla/include/Scintilla.h | 1 | ||||
-rw-r--r-- | scintilla/include/Scintilla.iface | 4 | ||||
-rw-r--r-- | scintilla/lexers/LexCPP.cxx | 17 | ||||
-rw-r--r-- | scintilla/src/Editor.cxx | 11 | ||||
-rw-r--r-- | scintilla/src/Editor.h | 1 |
7 files changed, 36 insertions, 5 deletions
diff --git a/scintilla/include/Face.py b/scintilla/include/Face.py index 9a92bb0..642b957 100644 --- a/scintilla/include/Face.py +++ b/scintilla/include/Face.py @@ -72,7 +72,7 @@ class Face: "Category": currentCategory, "Comment": currentComment
}
if value in self.values:
- raise "Duplicate value " + value + " " + name
+ raise Exception("Duplicate value " + value + " " + name)
self.values[value] = 1
self.order.append(name)
elif featureType == "evt":
@@ -84,7 +84,7 @@ class Face: "Category": currentCategory, "Comment": currentComment
}
if value in self.events:
- raise "Duplicate event " + value + " " + name
+ raise Exception("Duplicate event " + value + " " + name)
self.events[value] = 1
self.order.append(name)
elif featureType == "cat":
@@ -94,7 +94,7 @@ class Face: name, value = featureVal.split("=", 1)
except ValueError:
print("Failure %s" % featureVal)
- raise
+ raise Exception()
self.features[name] = {
"FeatureType": featureType,
"Category": currentCategory,
diff --git a/scintilla/include/SciLexer.h b/scintilla/include/SciLexer.h index ed102e5..0bba3b5 100644 --- a/scintilla/include/SciLexer.h +++ b/scintilla/include/SciLexer.h @@ -154,6 +154,7 @@ #define SCE_C_GLOBALCLASS 19
#define SCE_C_STRINGRAW 20
#define SCE_C_TRIPLEVERBATIM 21
+#define SCE_C_HASHQUOTEDSTRING 22
#define SCE_D_DEFAULT 0
#define SCE_D_COMMENT 1
#define SCE_D_COMMENTLINE 2
diff --git a/scintilla/include/Scintilla.h b/scintilla/include/Scintilla.h index a5a9aad..3de254d 100644 --- a/scintilla/include/Scintilla.h +++ b/scintilla/include/Scintilla.h @@ -423,6 +423,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SHOWLINES 2226
#define SCI_HIDELINES 2227
#define SCI_GETLINEVISIBLE 2228
+#define SCI_GETALLLINESVISIBLE 2236
#define SCI_SETFOLDEXPANDED 2229
#define SCI_GETFOLDEXPANDED 2230
#define SCI_TOGGLEFOLD 2231
diff --git a/scintilla/include/Scintilla.iface b/scintilla/include/Scintilla.iface index eb1eb16..1018229 100644 --- a/scintilla/include/Scintilla.iface +++ b/scintilla/include/Scintilla.iface @@ -1065,6 +1065,9 @@ fun void HideLines=2227(int lineStart, int lineEnd) # Is a line visible?
get bool GetLineVisible=2228(int line,)
+# Are all lines visible?
+get bool GetAllLinesVisible=2236(,)
+
# Show the children of a header line.
set void SetFoldExpanded=2229(int line, bool expanded)
@@ -2472,6 +2475,7 @@ val SCE_C_COMMENTDOCKEYWORDERROR=18 val SCE_C_GLOBALCLASS=19
val SCE_C_STRINGRAW=20
val SCE_C_TRIPLEVERBATIM=21
+val SCE_C_HASHQUOTEDSTRING=22
# Lexical states for SCLEX_D
lex D=SCLEX_D SCE_D_
val SCE_D_DEFAULT=0
diff --git a/scintilla/lexers/LexCPP.cxx b/scintilla/lexers/LexCPP.cxx index 8034823..c799d91 100644 --- a/scintilla/lexers/LexCPP.cxx +++ b/scintilla/lexers/LexCPP.cxx @@ -209,6 +209,7 @@ struct OptionsCPP { bool trackPreprocessor;
bool updatePreprocessor;
bool triplequotedStrings;
+ bool hashquotedStrings;
bool fold;
bool foldSyntaxBased;
bool foldComment;
@@ -226,6 +227,7 @@ struct OptionsCPP { trackPreprocessor = true;
updatePreprocessor = true;
triplequotedStrings = false;
+ hashquotedStrings = false;
fold = false;
foldSyntaxBased = true;
foldComment = false;
@@ -268,6 +270,9 @@ struct OptionSetCPP : public OptionSet<OptionsCPP> { DefineProperty("lexer.cpp.triplequoted.strings", &OptionsCPP::triplequotedStrings,
"Set to 1 to enable highlighting of triple-quoted strings.");
+ DefineProperty("lexer.cpp.hashquoted.strings", &OptionsCPP::hashquotedStrings,
+ "Set to 1 to enable highlighting of hash-quoted strings.");
+
DefineProperty("fold", &OptionsCPP::fold);
DefineProperty("fold.cpp.syntax.based", &OptionsCPP::foldSyntaxBased,
@@ -692,6 +697,15 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle, sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
}
break;
+ case SCE_C_HASHQUOTEDSTRING:
+ if (sc.ch == '\\') {
+ if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
+ sc.Forward();
+ }
+ } else if (sc.ch == '\"') {
+ sc.ForwardSetState(SCE_C_DEFAULT|activitySet);
+ }
+ break;
case SCE_C_STRINGRAW:
if (sc.Match(rawStringTerminator.c_str())) {
for (size_t termPos=rawStringTerminator.size(); termPos; termPos--)
@@ -768,6 +782,9 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle, } else if (options.triplequotedStrings && sc.Match("\"\"\"")) {
sc.SetState(SCE_C_TRIPLEVERBATIM|activitySet);
sc.Forward(2);
+ } else if (options.hashquotedStrings && sc.Match('#', '\"')) {
+ sc.SetState(SCE_C_HASHQUOTEDSTRING|activitySet);
+ sc.Forward();
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
if (lastWordWasUUID) {
sc.SetState(SCE_C_UUID|activitySet);
diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx index c955129..0d37504 100644 --- a/scintilla/src/Editor.cxx +++ b/scintilla/src/Editor.cxx @@ -193,6 +193,7 @@ Editor::Editor() { theEdge = 0;
paintState = notPainting;
+ willRedrawAll = false;
modEventMask = SC_MODEVENTMASKALL;
@@ -984,6 +985,8 @@ void Editor::ScrollTo(int line, bool moveThumb) { // Try to optimise small scrolls
#ifndef UNDER_CE
int linesToMove = topLine - topLineNew;
+ bool performBlit = (abs(linesToMove) <= 10) && (paintState == notPainting);
+ willRedrawAll = !performBlit;
#endif
SetTopLine(topLineNew);
// Optimize by styling the view as this will invalidate any needed area
@@ -991,11 +994,12 @@ void Editor::ScrollTo(int line, bool moveThumb) { StyleToPositionInView(PositionAfterArea(GetClientRectangle()));
#ifndef UNDER_CE
// Perform redraw rather than scroll if many lines would be redrawn anyway.
- if ((abs(linesToMove) <= 10) && (paintState == notPainting)) {
+ if (performBlit) {
ScrollText(linesToMove);
} else {
Redraw();
}
+ willRedrawAll = false;
#else
Redraw();
#endif
@@ -4649,7 +4653,7 @@ void Editor::NotifyModified(Document *, DocModification mh, void *) { }
if ((mh.modificationType & SC_MOD_CHANGEMARKER) || (mh.modificationType & SC_MOD_CHANGEMARGIN)) {
- if ((paintState == notPainting) || !PaintContainsMargin()) {
+ if ((!willRedrawAll) && ((paintState == notPainting) || !PaintContainsMargin())) {
if (mh.modificationType & SC_MOD_CHANGEFOLD) {
// Fold changes can affect the drawing of following lines so redraw whole margin
RedrawSelMargin(mh.line-1, true);
@@ -8276,6 +8280,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_GETLINEVISIBLE:
return cs.GetVisible(wParam);
+ case SCI_GETALLLINESVISIBLE:
+ return cs.HiddenLines() ? 0 : 1;
+
case SCI_SETFOLDEXPANDED:
if (cs.SetExpanded(wParam, lParam != 0)) {
RedrawSelMargin();
diff --git a/scintilla/src/Editor.h b/scintilla/src/Editor.h index d28e8d0..518ce07 100644 --- a/scintilla/src/Editor.h +++ b/scintilla/src/Editor.h @@ -226,6 +226,7 @@ protected: // ScintillaBase subclass needs access to much of Editor enum { notPainting, painting, paintAbandoned } paintState;
PRectangle rcPaint;
bool paintingAllText;
+ bool willRedrawAll;
StyleNeeded styleNeeded;
int modEventMask;
|