SF.net SVN: geany: [2410] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Wed Mar 26 16:42:55 UTC 2008


Revision: 2410
          http://geany.svn.sourceforge.net/geany/?rev=2410&view=rev
Author:   eht16
Date:     2008-03-26 09:42:50 -0700 (Wed, 26 Mar 2008)

Log Message:
-----------
Update Scintilla to version 1.76.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/scintilla/CellBuffer.cxx
    trunk/scintilla/Editor.cxx
    trunk/scintilla/Editor.h
    trunk/scintilla/LexCPP.cxx
    trunk/scintilla/LexPerl.cxx
    trunk/scintilla/LineMarker.cxx
    trunk/scintilla/RunStyles.cxx
    trunk/scintilla/RunStyles.h
    trunk/scintilla/ScintillaGTK.cxx
    trunk/scintilla/include/SciLexer.h
    trunk/scintilla/include/Scintilla.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-03-26 13:38:29 UTC (rev 2409)
+++ trunk/ChangeLog	2008-03-26 16:42:50 UTC (rev 2410)
@@ -1,3 +1,9 @@
+2008-03-26  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
+
+ * scintilla/*, scintilla/include/*:
+   Update Scintilla to version 1.76.
+
+
 2008-03-26  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
 
  * plugins/pluginmacros.h:

Modified: trunk/scintilla/CellBuffer.cxx
===================================================================
--- trunk/scintilla/CellBuffer.cxx	2008-03-26 13:38:29 UTC (rev 2409)
+++ trunk/scintilla/CellBuffer.cxx	2008-03-26 16:42:50 UTC (rev 2410)
@@ -729,13 +729,14 @@
 void CellBuffer::InsertLine(int line, int position) {
 	lv.InsertLine(line, position);
 	if (lineStates.Length()) {
+		lineStates.EnsureLength(line);
 		lineStates.Insert(line, 0);
 	}
 }
 
 void CellBuffer::RemoveLine(int line) {
 	lv.RemoveLine(line);
-	if (lineStates.Length()) {
+	if (lineStates.Length() > line) {
 		lineStates.Delete(line);
 	}
 }

Modified: trunk/scintilla/Editor.cxx
===================================================================
--- trunk/scintilla/Editor.cxx	2008-03-26 13:38:29 UTC (rev 2409)
+++ trunk/scintilla/Editor.cxx	2008-03-26 16:42:50 UTC (rev 2410)
@@ -225,8 +225,8 @@
 
 void Editor::InvalidateStyleData() {
 	stylesValid = false;
+	DropGraphics();
 	palette.Release();
-	DropGraphics();
 	llc.Invalidate(LineLayout::llInvalid);
 	posCache.Clear();
 	if (selType == selRectangle) {
@@ -719,19 +719,26 @@
 	}
 }
 
-void Editor::InvalidateSelection(int currentPos_, int anchor_) {
-	int firstAffected = anchor;
-	if (firstAffected > currentPos)
-		firstAffected = currentPos;
-	if (firstAffected > anchor_)
-		firstAffected = anchor_;
+void Editor::InvalidateSelection(int currentPos_, int anchor_, bool invalidateWholeSelection) {
+	if (anchor != anchor_ || selType == selRectangle) {
+		invalidateWholeSelection = true;
+	}
+	int firstAffected = currentPos;
+	if (invalidateWholeSelection) {
+		if (firstAffected > anchor)
+			firstAffected = anchor;
+		if (firstAffected > anchor_)
+			firstAffected = anchor_;
+	}
 	if (firstAffected > currentPos_)
 		firstAffected = currentPos_;
-	int lastAffected = anchor;
-	if (lastAffected < currentPos)
-		lastAffected = currentPos;
-	if (lastAffected < anchor_)
-		lastAffected = anchor_;
+	int lastAffected = currentPos;
+	if (invalidateWholeSelection) {
+		if (lastAffected < anchor)
+			lastAffected = anchor;
+		if (lastAffected < anchor_)
+			lastAffected = anchor_;
+	}
 	if (lastAffected < (currentPos_ + 1))	// +1 ensures caret repainted
 		lastAffected = (currentPos_ + 1);
 	needUpdateUI = true;
@@ -742,7 +749,7 @@
 	currentPos_ = pdoc->ClampPositionIntoDocument(currentPos_);
 	anchor_ = pdoc->ClampPositionIntoDocument(anchor_);
 	if ((currentPos != currentPos_) || (anchor != anchor_)) {
-		InvalidateSelection(currentPos_, anchor_);
+		InvalidateSelection(currentPos_, anchor_, true);
 		currentPos = currentPos_;
 		anchor = anchor_;
 	}
@@ -753,7 +760,7 @@
 void Editor::SetSelection(int currentPos_) {
 	currentPos_ = pdoc->ClampPositionIntoDocument(currentPos_);
 	if (currentPos != currentPos_) {
-		InvalidateSelection(currentPos_, currentPos_);
+		InvalidateSelection(currentPos_, anchor, false);
 		currentPos = currentPos_;
 	}
 	SetRectangularRange();
@@ -1400,7 +1407,7 @@
 	}
 }
 
-const char *StringFromEOLMode(int eolMode) {
+const char *Editor::StringFromEOLMode(int eolMode) {
 	if (eolMode == SC_EOL_CRLF) {
 		return "\r\n";
 	} else if (eolMode == SC_EOL_CR) {
@@ -2382,8 +2389,10 @@
 						if (ll->chars[cpos + startseg] == ' ') {
 							if (drawWhitespaceBackground &&
 							        (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) {
-								PRectangle rcSpace(ll->positions[cpos + startseg] + xStart, rcSegment.top,
-								        ll->positions[cpos + startseg + 1] + xStart, rcSegment.bottom);
+								PRectangle rcSpace(ll->positions[cpos + startseg] + xStart - subLineStart,
+									rcSegment.top,
+									ll->positions[cpos + startseg + 1] + xStart - subLineStart,
+									rcSegment.bottom);
 								surface->FillRectangle(rcSpace, vsDraw.whitespaceBackground.allocated);
 							}
 						} else {
@@ -2515,7 +2524,10 @@
 									if (!twoPhaseDraw && drawWhitespaceBackground &&
 									        (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) {
 										textBack = vsDraw.whitespaceBackground.allocated;
-										PRectangle rcSpace(ll->positions[cpos + startseg] + xStart, rcSegment.top, ll->positions[cpos + startseg + 1] + xStart, rcSegment.bottom);
+										PRectangle rcSpace(ll->positions[cpos + startseg] + xStart - subLineStart,
+											rcSegment.top,
+											ll->positions[cpos + startseg + 1] + xStart - subLineStart,
+											rcSegment.bottom);
 										surface->FillRectangle(rcSpace, textBack);
 									}
 									PRectangle rcDot(xmid + xStart - subLineStart, rcSegment.top + vsDraw.lineHeight / 2, 0, 0);
@@ -2770,6 +2782,7 @@
 	//Platform::DebugPrintf("Paint:%1d (%3d,%3d) ... (%3d,%3d)\n",
 	//	paintingAllText, rcArea.left, rcArea.top, rcArea.right, rcArea.bottom);
 
+	pixmapLine->Release();
 	RefreshStyleData();
 	RefreshPixMaps(surfaceWindow);
 
@@ -2799,10 +2812,17 @@
 	pdoc->EnsureStyledTo(endPosPaint);
 	bool paintAbandonedByStyling = paintState == paintAbandoned;
 	if (needUpdateUI) {
+		// Deselect palette by selecting a temporary palette
+		Palette palTemp;
+		surfaceWindow->SetPalette(&palTemp, true);
+
 		NotifyUpdateUI();
 		needUpdateUI = false;
+
 		RefreshStyleData();
 		RefreshPixMaps(surfaceWindow);
+		surfaceWindow->SetPalette(&palette, true);
+		pixmapLine->SetPalette(&palette, !hasFocus);
 	}
 
 	// Call priority lines wrap on a window of lines which are likely
@@ -3515,6 +3535,12 @@
 	pdoc->ClearLevels();
 }
 
+void Editor::CopyAllowLine() {
+	SelectionText selectedText;
+	CopySelectionRange(&selectedText, true);
+	CopyToClipboard(selectedText);
+}
+
 void Editor::Cut() {
 	pdoc->CheckReadOnly();
 	if (!pdoc->IsReadOnly() && !SelectionContainsProtected()) {
@@ -4118,6 +4144,7 @@
 	case SCI_PAGEUPRECTEXTEND:
 	case SCI_PAGEDOWNRECTEXTEND:
 	case SCI_SELECTIONDUPLICATE:
+	case SCI_COPYALLOWLINE:
 		break;
 
 		// Filter out all others like display changes. Also, newlines are redundant
@@ -4984,14 +5011,37 @@
 	return text;
 }
 
-void Editor::CopySelectionFromRange(SelectionText *ss, int start, int end) {
-	ss->Set(CopyRange(start, end), end - start + 1,
-	        pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false);
+void Editor::CopySelectionFromRange(SelectionText *ss, bool allowLineCopy, int start, int end) {
+	bool isLine = allowLineCopy && (start == end);
+	if (isLine) {
+		int currentLine = pdoc->LineFromPosition(currentPos);
+		start = pdoc->LineStart(currentLine);
+		end = pdoc->LineEnd(currentLine);
+
+		char *text = CopyRange(start, end);
+		int textLen = text ? strlen(text) : 0;
+		// include room for \r\n\0
+		textLen += 3;
+		char *textWithEndl = new char[textLen];
+		textWithEndl[0] = '\0';
+		if (text)
+			strncat(textWithEndl, text, textLen);
+		if (pdoc->eolMode != SC_EOL_LF)
+			strncat(textWithEndl, "\r", textLen);
+		if (pdoc->eolMode != SC_EOL_CR)
+			strncat(textWithEndl, "\n", textLen);
+		ss->Set(textWithEndl, strlen(textWithEndl),
+			pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, true);
+		delete []text;
+	} else {
+		ss->Set(CopyRange(start, end), end - start + 1,
+			pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, false);
+	}
 }
 
-void Editor::CopySelectionRange(SelectionText *ss) {
+void Editor::CopySelectionRange(SelectionText *ss, bool allowLineCopy) {
 	if (selType == selStream) {
-		CopySelectionFromRange(ss, SelectionStart(), SelectionEnd());
+		CopySelectionFromRange(ss, allowLineCopy, SelectionStart(), SelectionEnd());
 	} else {
 		char *text = 0;
 		int size = 0;
@@ -5029,7 +5079,7 @@
 			}
 		}
 		ss->Set(text, size + 1, pdoc->dbcsCodePage,
-		        vs.styles[STYLE_DEFAULT].characterSet, selType == selRectangle);
+			vs.styles[STYLE_DEFAULT].characterSet, selType == selRectangle, selType == selLines);
 	}
 }
 
@@ -5038,14 +5088,14 @@
 	end = pdoc->ClampPositionIntoDocument(end);
 	SelectionText selectedText;
 	selectedText.Set(CopyRange(start, end), end - start + 1,
-	        pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false);
+		pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, false);
 	CopyToClipboard(selectedText);
 }
 
 void Editor::CopyText(int length, const char *text) {
 	SelectionText selectedText;
 	selectedText.Copy(text, length + 1,
-	        pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false);
+		pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, false);
 	CopyToClipboard(selectedText);
 }
 
@@ -5470,11 +5520,11 @@
 			if (lineMove < 0) {
 				lineMove = cs.DisplayFromDoc(pdoc->LinesTotal() - 1);
 			}
-			ScrollTo(lineMove - LinesOnScreen() + 5);
+			ScrollTo(lineMove - LinesOnScreen() + 1);
 			Redraw();
 		} else if (pt.y < rcClient.top) {
 			int lineMove = cs.DisplayFromDoc(LineFromLocation(pt));
-			ScrollTo(lineMove - 5);
+			ScrollTo(lineMove - 1);
 			Redraw();
 		}
 		EnsureCaretVisible(false, false, true);
@@ -6022,6 +6072,10 @@
 		Copy();
 		break;
 
+	case SCI_COPYALLOWLINE:
+		CopyAllowLine();
+		break;
+
 	case SCI_COPYRANGE:
 		CopyRangeToClipboard(wParam, lParam);
 		break;
@@ -7482,7 +7536,7 @@
 				moveExtendsSelection = !moveExtendsSelection || (selType != selStream);
 				selType = selStream;
 			}
-			InvalidateSelection(currentPos, anchor);
+			InvalidateSelection(currentPos, anchor, true);
 		}
 	case SCI_GETSELECTIONMODE:
 		switch (selType) {

Modified: trunk/scintilla/Editor.h
===================================================================
--- trunk/scintilla/Editor.h	2008-03-26 13:38:29 UTC (rev 2409)
+++ trunk/scintilla/Editor.h	2008-03-26 16:42:50 UTC (rev 2410)
@@ -54,16 +54,17 @@
 	char *s;
 	int len;
 	bool rectangular;
+	bool lineCopy;
 	int codePage;
 	int characterSet;
-	SelectionText() : s(0), len(0), rectangular(false), codePage(0), characterSet(0) {}
+	SelectionText() : s(0), len(0), rectangular(false), lineCopy(false), codePage(0), characterSet(0) {}
 	~SelectionText() {
 		Free();
 	}
 	void Free() {
-		Set(0, 0, 0, 0, false);
+		Set(0, 0, 0, 0, false, false);
 	}
-	void Set(char *s_, int len_, int codePage_, int characterSet_, bool rectangular_) {
+	void Set(char *s_, int len_, int codePage_, int characterSet_, bool rectangular_, bool lineCopy_) {
 		delete []s;
 		s = s_;
 		if (s)
@@ -73,8 +74,9 @@
 		codePage = codePage_;
 		characterSet = characterSet_;
 		rectangular = rectangular_;
+		lineCopy = lineCopy_;
 	}
-	void Copy(const char *s_, int len_, int codePage_, int characterSet_, bool rectangular_) {
+	void Copy(const char *s_, int len_, int codePage_, int characterSet_, bool rectangular_, bool lineCopy_) {
 		delete []s;
 		s = new char[len_];
 		if (s) {
@@ -88,9 +90,10 @@
 		codePage = codePage_;
 		characterSet = characterSet_;
 		rectangular = rectangular_;
+		lineCopy = lineCopy_;
 	}
 	void Copy(const SelectionText &other) {
-		Copy(other.s, other.len, other.codePage, other.characterSet, other.rectangular);
+		Copy(other.s, other.len, other.codePage, other.characterSet, other.rectangular, other.lineCopy);
 	}
 };
 
@@ -276,7 +279,7 @@
 	int SelectionStart();
 	int SelectionEnd();
 	void SetRectangularRange();
-	void InvalidateSelection(int currentPos_, int anchor_);
+	void InvalidateSelection(int currentPos_, int anchor_, bool invalidateWholeSelection);
 	void SetSelection(int currentPos_, int anchor_);
 	void SetSelection(int currentPos_);
 	void SetEmptySelection(int currentPos_);
@@ -342,6 +345,7 @@
 	void Cut();
 	void PasteRectangular(int pos, const char *ptr, int len);
 	virtual void Copy() = 0;
+	virtual void CopyAllowLine();
 	virtual bool CanPaste();
 	virtual void Paste() = 0;
 	void Clear();
@@ -406,8 +410,8 @@
 
 	virtual void CopyToClipboard(const SelectionText &selectedText) = 0;
 	char *CopyRange(int start, int end);
-	void CopySelectionFromRange(SelectionText *ss, int start, int end);
-	void CopySelectionRange(SelectionText *ss);
+	void CopySelectionFromRange(SelectionText *ss, bool allowLineCopy, int start, int end);
+	void CopySelectionRange(SelectionText *ss, bool allowLineCopy=false);
 	void CopyRangeToClipboard(int start, int end);
 	void CopyText(int length, const char *text);
 	void SetDragPosition(int newPos);
@@ -460,6 +464,8 @@
 	void StyleSetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
 	sptr_t StyleGetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
 
+	static const char *StringFromEOLMode(int eolMode);
+
 public:
 	// Public so the COM thunks can access it.
 	bool IsUnicodeMode() const;

Modified: trunk/scintilla/LexCPP.cxx
===================================================================
--- trunk/scintilla/LexCPP.cxx	2008-03-26 13:38:29 UTC (rev 2409)
+++ trunk/scintilla/LexCPP.cxx	2008-03-26 16:42:50 UTC (rev 2410)
@@ -424,7 +424,9 @@
 				levelNext--;
 			}
 		}
-		if (atEOL) {
+		if (!IsASpace(ch))
+			visibleChars++;
+		if (atEOL || (i == endPos-1)) {
 			int levelUse = levelCurrent;
 			if (foldAtElse) {
 				levelUse = levelMinCurrent;
@@ -442,8 +444,6 @@
 			levelMinCurrent = levelCurrent;
 			visibleChars = 0;
 		}
-		if (!IsASpace(ch))
-			visibleChars++;
 	}
 }
 

Modified: trunk/scintilla/LexPerl.cxx
===================================================================
--- trunk/scintilla/LexPerl.cxx	2008-03-26 13:38:29 UTC (rev 2409)
+++ trunk/scintilla/LexPerl.cxx	2008-03-26 16:42:50 UTC (rev 2410)
@@ -2,7 +2,7 @@
 /** @file LexPerl.cxx
  ** Lexer for subset of Perl.
  **/
-// Copyright 1998-2007 by Neil Hodgson <neilh at scintilla.org>
+// Copyright 1998-2008 by Neil Hodgson <neilh at scintilla.org>
 // Lexical analysis fixes by Kein-Hong Man <mkh at pl.jaring.my>
 // The License.txt file describes the conditions under which this software may be distributed.
 
@@ -666,8 +666,9 @@
 								}
 							} else {
                                 // bare identifier, if '/', /PATTERN/ unless digit/space immediately after '/'
+                                // if '//', always expect defined-or operator to follow identifier
 								if (!isHereDoc &&
-                                    (isspacechar(chNext) || isdigit(chNext)))
+                                    (isspacechar(chNext) || isdigit(chNext) || chNext == '/'))
                                     preferRE = false;
 								// HERE docs cannot have a space after the >>
                                 if (isspacechar(chNext))
@@ -688,13 +689,14 @@
                         // adopt heuristics similar to vim-style rules:
                         // keywords always forced as /PATTERN/: split, if, elsif, while
                         // everything else /PATTERN/ unless digit/space immediately after '/'
+                        // for '//', defined-or favoured unless special keywords
                         bkend = bk + 1;
 						while (bk > 0 && styler.StyleAt(bk-1) == SCE_PL_WORD) {
 							bk--;
 						}
                         if (isPerlKeyword(bk, bkend, reWords, styler))
                             break;
-                        if (isspacechar(chNext) || isdigit(chNext))
+                        if (isspacechar(chNext) || isdigit(chNext) || chNext == '/')
                             preferRE = false;
                         break;
 					// other styles uses the default, preferRE=false
@@ -724,7 +726,12 @@
                         state = SCE_PL_REGEX;
                         Quote.New(1);
                         Quote.Open(ch);
-                    } else {        // / operator
+                    } else {        // / and // operators
+                        if (chNext == '/') {
+                            i++;
+                            ch = chNext;
+                            chNext = chNext2;
+                        }
                         goto handleOperator;
                     }
                 }

Modified: trunk/scintilla/LineMarker.cxx
===================================================================
--- trunk/scintilla/LineMarker.cxx	2008-03-26 13:38:29 UTC (rev 2409)
+++ trunk/scintilla/LineMarker.cxx	2008-03-26 16:42:50 UTC (rev 2410)
@@ -299,6 +299,10 @@
 		};
 		surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
 				fore.allocated, back.allocated);
+	} else if (markType == SC_MARK_LEFTRECT) {
+		PRectangle rcLeft = rcWhole;
+		rcLeft.right = rcLeft.left + 4;
+		surface->FillRectangle(rcLeft, back.allocated);
 	} else { // SC_MARK_FULLRECT
 		surface->FillRectangle(rcWhole, back.allocated);
 	}

Modified: trunk/scintilla/RunStyles.cxx
===================================================================
--- trunk/scintilla/RunStyles.cxx	2008-03-26 13:38:29 UTC (rev 2409)
+++ trunk/scintilla/RunStyles.cxx	2008-03-26 16:42:50 UTC (rev 2410)
@@ -77,11 +77,11 @@
 	styles = NULL;
 }
 
-int RunStyles::Length() {
+int RunStyles::Length() const {
 	return starts->PositionFromPartition(starts->Partitions());
 }
 
-int RunStyles::ValueAt(int position) {
+int RunStyles::ValueAt(int position) const {
 	return styles->ValueAt(starts->PartitionFromPosition(position));
 }
 

Modified: trunk/scintilla/RunStyles.h
===================================================================
--- trunk/scintilla/RunStyles.h	2008-03-26 13:38:29 UTC (rev 2409)
+++ trunk/scintilla/RunStyles.h	2008-03-26 16:42:50 UTC (rev 2410)
@@ -23,8 +23,8 @@
 public:
 	RunStyles();
 	~RunStyles();
-	int Length();
-	int ValueAt(int position);
+	int Length() const;
+	int ValueAt(int position) const;
 	int FindNextChange(int position, int end);
 	int StartRun(int position);
 	int EndRun(int position);

Modified: trunk/scintilla/ScintillaGTK.cxx
===================================================================
--- trunk/scintilla/ScintillaGTK.cxx	2008-03-26 13:38:29 UTC (rev 2409)
+++ trunk/scintilla/ScintillaGTK.cxx	2008-03-26 16:42:50 UTC (rev 2410)
@@ -78,7 +78,7 @@
 #pragma warning(disable: 4505)
 #endif
 
-#if GTK_CHECK_VERSION(2,2,0)
+#if GTK_CHECK_VERSION(2,6,0)
 #define USE_GTK_CLIPBOARD
 #endif
 
@@ -1155,11 +1155,6 @@
 
 	gdk_gc_unref(gc);
 #else
-    // check if e.g. an existing scroll event has occurred
-    if (rgnUpdate != NULL) {
-        Redraw();
-        return;
-    }
 	gdk_window_scroll(wi->window, 0, -diff);
 	gdk_window_process_updates(wi->window, FALSE);
 #endif
@@ -1417,7 +1412,7 @@
 	if ((selectionType != GDK_TARGET_STRING) && (selectionType != atomUTF8)) {
 		char *empty = new char[1];
 		empty[0] = '\0';
-		selText.Set(empty, 0, SC_CP_UTF8, 0, false);
+		selText.Set(empty, 0, SC_CP_UTF8, 0, false, false);
 		return;
 	}
 
@@ -1436,16 +1431,16 @@
 			// Unknown encoding so assume in Latin1
 			char *destPrevious = dest;
 			dest = UTF8FromLatin1(dest, len);
-			selText.Set(dest, len, SC_CP_UTF8, 0, selText.rectangular);
+			selText.Set(dest, len, SC_CP_UTF8, 0, selText.rectangular, false);
 			delete []destPrevious;
 		} else {
 			// Assume buffer is in same encoding as selection
 			selText.Set(dest, len, pdoc->dbcsCodePage,
-				vs.styles[STYLE_DEFAULT].characterSet, isRectangular);
+				vs.styles[STYLE_DEFAULT].characterSet, isRectangular, false);
 		}
 	} else {	// UTF-8
 		dest = Document::TransformLineEnds(&len, data, len, pdoc->eolMode);
-		selText.Set(dest, len, SC_CP_UTF8, 0, isRectangular);
+		selText.Set(dest, len, SC_CP_UTF8, 0, isRectangular, false);
 #ifdef USE_CONVERTER
 		const char *charSetBuffer = CharacterSetID();
 		if (!IsUnicodeMode() && *charSetBuffer) {
@@ -1453,7 +1448,7 @@
 				// Convert to locale
 				dest = ConvertText(&len, selText.s, selText.len, charSetBuffer, "UTF-8", true);
 				selText.Set(dest, len, pdoc->dbcsCodePage,
-					vs.styles[STYLE_DEFAULT].characterSet, selText.rectangular);
+					vs.styles[STYLE_DEFAULT].characterSet, selText.rectangular, false);
 		}
 #endif
 	}
@@ -1516,15 +1511,15 @@
 
 void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, SelectionText *text) {
 #if PLAT_GTK_WIN32
-	// Many native win32 programs require \n line endings, so make a copy of
-	// the clip text now with newlines converted.  Use { } to hide symbols
+	// GDK on Win32 expands any \n into \r\n, so make a copy of
+	// the clip text now with newlines converted to \n.  Use { } to hide symbols
 	// from code below
 	SelectionText *newline_normalized = NULL;
 	{
 		int tmpstr_len;
 		char *tmpstr = Document::TransformLineEnds(&tmpstr_len, text->s, text->len, SC_EOL_LF);
 		newline_normalized = new SelectionText();
-		newline_normalized->Set(tmpstr, tmpstr_len, SC_CP_UTF8, 0, text->rectangular);
+		newline_normalized->Set(tmpstr, tmpstr_len, SC_CP_UTF8, 0, text->rectangular, false);
 		text = newline_normalized;
 	}
 #endif
@@ -1538,7 +1533,7 @@
 			int new_len;
 			char* tmputf = ConvertText(&new_len, text->s, text->len, "UTF-8", charSet, false);
 			converted = new SelectionText();
-			converted->Set(tmputf, new_len, SC_CP_UTF8, 0, text->rectangular);
+			converted->Set(tmputf, new_len, SC_CP_UTF8, 0, text->rectangular, false);
 			text = converted;
 		}
 	}

Modified: trunk/scintilla/include/SciLexer.h
===================================================================
--- trunk/scintilla/include/SciLexer.h	2008-03-26 13:38:29 UTC (rev 2409)
+++ trunk/scintilla/include/SciLexer.h	2008-03-26 16:42:50 UTC (rev 2410)
@@ -99,7 +99,9 @@
 #define SCLEX_ABAQUS 84
 #define SCLEX_ASYMPTOTE 85
 #define SCLEX_R 86
-#define SCLEX_OMS 87
+#define SCLEX_MAGIK 87
+#define SCLEX_POWERSHELL 88
+#define SCLEX_OMS 89
 #define SCLEX_AUTOMATIC 1000
 #define SCE_P_DEFAULT 0
 #define SCE_P_COMMENTLINE 1
@@ -1204,6 +1206,34 @@
 #define SCE_R_IDENTIFIER 9
 #define SCE_R_INFIX 10
 #define SCE_R_INFIXEOL 11
+#define SCE_MAGIK_DEFAULT 0
+#define SCE_MAGIK_COMMENT 1
+#define SCE_MAGIK_HYPER_COMMENT 16
+#define SCE_MAGIK_STRING 2
+#define SCE_MAGIK_CHARACTER 3
+#define SCE_MAGIK_NUMBER 4
+#define SCE_MAGIK_IDENTIFIER 5
+#define SCE_MAGIK_OPERATOR 6
+#define SCE_MAGIK_FLOW 7
+#define SCE_MAGIK_CONTAINER 8
+#define SCE_MAGIK_BRACKET_BLOCK 9
+#define SCE_MAGIK_BRACE_BLOCK 10
+#define SCE_MAGIK_SQBRACKET_BLOCK 11
+#define SCE_MAGIK_UNKNOWN_KEYWORD 12
+#define SCE_MAGIK_KEYWORD 13
+#define SCE_MAGIK_PRAGMA 14
+#define SCE_MAGIK_SYMBOL 15
+#define SCE_POWERSHELL_DEFAULT 0
+#define SCE_POWERSHELL_COMMENT 1
+#define SCE_POWERSHELL_STRING 2
+#define SCE_POWERSHELL_CHARACTER 3
+#define SCE_POWERSHELL_NUMBER 4
+#define SCE_POWERSHELL_VARIABLE 5
+#define SCE_POWERSHELL_OPERATOR 6
+#define SCE_POWERSHELL_IDENTIFIER 7
+#define SCE_POWERSHELL_KEYWORD 8
+#define SCE_POWERSHELL_CMDLET 9
+#define SCE_POWERSHELL_ALIAS 10
 #define SCLEX_ASP 29
 #define SCLEX_PHP 30
 /*--Autogenerated -- end of section automatically generated from Scintilla.iface*/

Modified: trunk/scintilla/include/Scintilla.h
===================================================================
--- trunk/scintilla/include/Scintilla.h	2008-03-26 13:38:29 UTC (rev 2409)
+++ trunk/scintilla/include/Scintilla.h	2008-03-26 16:42:50 UTC (rev 2410)
@@ -118,6 +118,7 @@
 #define SC_MARK_ARROWS 24
 #define SC_MARK_PIXMAP 25
 #define SC_MARK_FULLRECT 26
+#define SC_MARK_LEFTRECT 27
 #define SC_MARK_CHARACTER 10000
 #define SC_MARKNUM_FOLDEREND 25
 #define SC_MARKNUM_FOLDEROPENMID 26
@@ -666,6 +667,7 @@
 #define SCI_INDICATOREND 2509
 #define SCI_SETPOSITIONCACHE 2514
 #define SCI_GETPOSITIONCACHE 2515
+#define SCI_COPYALLOWLINE 2519
 #define SCI_STARTRECORD 3001
 #define SCI_STOPRECORD 3002
 #define SCI_SETLEXER 4001


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list