summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scintilla/lexers/LexHTML.cxx2
-rw-r--r--scintilla/lexers/LexNsis.cxx1
-rw-r--r--scintilla/src/Decoration.cxx4
-rw-r--r--scintilla/src/Editor.cxx52
-rw-r--r--scintilla/src/XPM.cxx8
5 files changed, 33 insertions, 34 deletions
diff --git a/scintilla/lexers/LexHTML.cxx b/scintilla/lexers/LexHTML.cxx
index 5fe4746..abfa98f 100644
--- a/scintilla/lexers/LexHTML.cxx
+++ b/scintilla/lexers/LexHTML.cxx
@@ -903,7 +903,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
(chNext == '?') &&
!IsScriptCommentState(state)) {
beforeLanguage = scriptLanguage;
- scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 6, eScriptPHP);
+ scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 6, isXml ? eScriptXML : eScriptPHP);
if (scriptLanguage != eScriptPHP && isStringState(state)) continue;
styler.ColourTo(i - 1, StateToPrint);
beforePreProc = state;
diff --git a/scintilla/lexers/LexNsis.cxx b/scintilla/lexers/LexNsis.cxx
index 35c5cdb..b448830 100644
--- a/scintilla/lexers/LexNsis.cxx
+++ b/scintilla/lexers/LexNsis.cxx
@@ -142,6 +142,7 @@ static int calculateFoldNsis(unsigned int start, unsigned int end, int foldlevel
bIgnoreCase = true;
char s[20]; // The key word we are looking for has atmost 13 characters
+ s[0] = '\0';
for (unsigned int i = 0; i < end - start + 1 && i < 19; i++)
{
s[i] = static_cast<char>( styler[ start + i ] );
diff --git a/scintilla/src/Decoration.cxx b/scintilla/src/Decoration.cxx
index 5d88332..4ed0b46 100644
--- a/scintilla/src/Decoration.cxx
+++ b/scintilla/src/Decoration.cxx
@@ -28,7 +28,7 @@ Decoration::~Decoration() {
}
bool Decoration::Empty() {
- return rs.Runs() == 1;
+ return (rs.Runs() == 1) && (rs.AllSameAs(0));
}
DecorationList::DecorationList() : currentIndicator(0), currentValue(1), current(0),
@@ -148,7 +148,7 @@ void DecorationList::DeleteRange(int position, int deleteLength) {
void DecorationList::DeleteAnyEmpty() {
Decoration *deco = root;
while (deco) {
- if (deco->Empty()) {
+ if ((lengthDocument == 0) || deco->Empty()) {
Delete(deco->indicator);
deco = root;
} else {
diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx
index b461445..3d90642 100644
--- a/scintilla/src/Editor.cxx
+++ b/scintilla/src/Editor.cxx
@@ -6201,15 +6201,21 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
inDragDrop = ddNone;
sel.SetMoveExtends(false);
- bool processed = NotifyMarginClick(pt, shift, ctrl, alt);
- if (processed)
+ if (NotifyMarginClick(pt, shift, ctrl, alt))
return;
NotifyIndicatorClick(true, newPos.Position(), shift, ctrl, alt);
bool inSelMargin = PointInSelMargin(pt);
- if (shift & !inSelMargin) {
- SetSelection(newPos.Position());
+ // In margin ctrl+(double)click should always select everything
+ if (ctrl && inSelMargin) {
+ SelectAll();
+ lastClickTime = curTime;
+ lastClick = pt;
+ return;
+ }
+ if (shift && !inSelMargin) {
+ SetSelection(newPos);
}
if (((curTime - lastClickTime) < Platform::DoubleClickTime()) && Close(pt, lastClick)) {
//Platform::DebugPrintf("Double click %d %d = %d\n", curTime, lastClickTime, curTime - lastClickTime);
@@ -6218,20 +6224,24 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
bool doubleClick = false;
// Stop mouse button bounce changing selection type
if (!Platform::MouseButtonBounce() || curTime != lastClickTime) {
- if (selectionType == selChar) {
- selectionType = selWord;
- doubleClick = true;
- } else if (selectionType == selWord) {
- // Since we ended up here, we're inside a *triple* click, which should always select
- // whole line irregardless of word wrap being enabled or not.
- selectionType = selWholeLine;
- } else {
- if (inSelMargin) {
- // Selection type is either selSubLine or selWholeLine here and we're inside margin.
+ if (inSelMargin) {
+ // Inside margin selection type should be either selSubLine or selWholeLine.
+ if (selectionType == selSubLine) {
// If it is selSubLine, we're inside a *double* click and word wrap is enabled,
// so we switch to selWholeLine in order to select whole line.
- if (selectionType == selSubLine)
- selectionType = selWholeLine;
+ selectionType = selWholeLine;
+ } else if (selectionType != selSubLine && selectionType != selWholeLine) {
+ // If it is neither, reset selection type to line selection.
+ selectionType = ((wrapState != eWrapNone) && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine;
+ }
+ } else {
+ if (selectionType == selChar) {
+ selectionType = selWord;
+ doubleClick = true;
+ } else if (selectionType == selWord) {
+ // Since we ended up here, we're inside a *triple* click, which should always select
+ // whole line irregardless of word wrap being enabled or not.
+ selectionType = selWholeLine;
} else {
selectionType = selChar;
originalAnchorPos = sel.MainCaret();
@@ -6283,11 +6293,6 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
} else { // Single click
if (inSelMargin) {
sel.selType = Selection::selStream;
- if (ctrl) {
- SelectAll();
- lastClickTime = curTime;
- return;
- }
if (!shift) {
// Single click in margin: select whole line or only subline if word wrap is enabled
lineAnchorPos = newPos.Position();
@@ -6303,7 +6308,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
// This ensures that we don't end up stuck in previous selection mode, which is no longer valid.
// Otherwise, if there's a non empty selection, reset selection type only if it differs from selSubLine and selWholeLine.
// This ensures that we continue selecting in the same selection mode.
- if (sel.Empty() || (selectionType != selSubLine && selectionType != selWholeLine))
+ if (sel.Empty() || (selectionType != selSubLine && selectionType != selWholeLine))
selectionType = ((wrapState != eWrapNone) && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine;
LineSelection(newPos.Position(), lineAnchorPos, selectionType == selWholeLine);
}
@@ -6352,6 +6357,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
}
}
lastClickTime = curTime;
+ lastClick = pt;
lastXChosen = pt.x + xOffset;
ShowCaretAtCurrentPosition();
}
@@ -6521,7 +6527,7 @@ void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {
newPos = MovePositionOutsideChar(newPos, sel.MainCaret() - newPos.Position());
if (inDragDrop == ddInitial) {
inDragDrop = ddNone;
- SetEmptySelection(newPos.Position());
+ SetEmptySelection(newPos);
selectionType = selChar;
originalAnchorPos = sel.MainCaret();
}
diff --git a/scintilla/src/XPM.cxx b/scintilla/src/XPM.cxx
index 07d36b4..7b25892 100644
--- a/scintilla/src/XPM.cxx
+++ b/scintilla/src/XPM.cxx
@@ -47,14 +47,6 @@ ColourDesired XPM::ColourDesiredFromCode(int ch) const {
ColourDesired XPM::ColourFromCode(int ch) const {
return *colourCodeTable[ch];
-#ifdef SLOW
- for (int i=0; i<nColours; i++) {
- if (codes[i] == ch) {
- return colours[i].allocated;
- }
- }
- return colours[0].allocated;
-#endif
}
void XPM::FillRun(Surface *surface, int code, int startX, int y, int x) {