Update Scintilla to version 1.76.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2410 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
5b512c4c0a
commit
8d3a9047ca
@ -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:
|
||||
|
@ -729,13 +729,14 @@ int CellBuffer::LineFromHandle(int markerHandle) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -225,8 +225,8 @@ void Editor::DropGraphics() {
|
||||
|
||||
void Editor::InvalidateStyleData() {
|
||||
stylesValid = false;
|
||||
palette.Release();
|
||||
DropGraphics();
|
||||
palette.Release();
|
||||
llc.Invalidate(LineLayout::llInvalid);
|
||||
posCache.Clear();
|
||||
if (selType == selRectangle) {
|
||||
@ -719,19 +719,26 @@ void Editor::SetRectangularRange() {
|
||||
}
|
||||
}
|
||||
|
||||
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 @@ void Editor::SetSelection(int currentPos_, int anchor_) {
|
||||
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_, int anchor_) {
|
||||
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 @@ void Editor::LinesJoin() {
|
||||
}
|
||||
}
|
||||
|
||||
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 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
|
||||
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 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
|
||||
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 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
|
||||
//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 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
|
||||
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 @@ void Editor::ClearDocumentStyle() {
|
||||
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 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lPar
|
||||
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 @@ char *Editor::CopyRange(int start, int end) {
|
||||
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 @@ void Editor::CopySelectionRange(SelectionText *ss) {
|
||||
}
|
||||
}
|
||||
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 @@ void Editor::CopyRangeToClipboard(int start, int end) {
|
||||
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 @@ void Editor::ButtonMove(Point pt) {
|
||||
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 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
||||
Copy();
|
||||
break;
|
||||
|
||||
case SCI_COPYALLOWLINE:
|
||||
CopyAllowLine();
|
||||
break;
|
||||
|
||||
case SCI_COPYRANGE:
|
||||
CopyRangeToClipboard(wParam, lParam);
|
||||
break;
|
||||
@ -7482,7 +7536,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
||||
moveExtendsSelection = !moveExtendsSelection || (selType != selStream);
|
||||
selType = selStream;
|
||||
}
|
||||
InvalidateSelection(currentPos, anchor);
|
||||
InvalidateSelection(currentPos, anchor, true);
|
||||
}
|
||||
case SCI_GETSELECTIONMODE:
|
||||
switch (selType) {
|
||||
|
@ -54,16 +54,17 @@ public:
|
||||
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 @@ public:
|
||||
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 @@ public:
|
||||
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 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
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 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
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 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
|
||||
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 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
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;
|
||||
|
@ -424,7 +424,9 @@ static void FoldCppDoc(unsigned int startPos, int length, int initStyle,
|
||||
levelNext--;
|
||||
}
|
||||
}
|
||||
if (atEOL) {
|
||||
if (!IsASpace(ch))
|
||||
visibleChars++;
|
||||
if (atEOL || (i == endPos-1)) {
|
||||
int levelUse = levelCurrent;
|
||||
if (foldAtElse) {
|
||||
levelUse = levelMinCurrent;
|
||||
@ -442,8 +444,6 @@ static void FoldCppDoc(unsigned int startPos, int length, int initStyle,
|
||||
levelMinCurrent = levelCurrent;
|
||||
visibleChars = 0;
|
||||
}
|
||||
if (!IsASpace(ch))
|
||||
visibleChars++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
/** @file LexPerl.cxx
|
||||
** Lexer for subset of Perl.
|
||||
**/
|
||||
// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
|
||||
// Copyright 1998-2008 by Neil Hodgson <neilh@scintilla.org>
|
||||
// Lexical analysis fixes by Kein-Hong Man <mkh@pl.jaring.my>
|
||||
// The License.txt file describes the conditions under which this software may be distributed.
|
||||
|
||||
@ -666,8 +666,9 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
}
|
||||
} 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 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
// 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 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
|
||||
state = SCE_PL_REGEX;
|
||||
Quote.New(1);
|
||||
Quote.Open(ch);
|
||||
} else { // / operator
|
||||
} else { // / and // operators
|
||||
if (chNext == '/') {
|
||||
i++;
|
||||
ch = chNext;
|
||||
chNext = chNext2;
|
||||
}
|
||||
goto handleOperator;
|
||||
}
|
||||
}
|
||||
|
@ -299,6 +299,10 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
|
||||
};
|
||||
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);
|
||||
}
|
||||
|
@ -77,11 +77,11 @@ RunStyles::~RunStyles() {
|
||||
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));
|
||||
}
|
||||
|
||||
|
@ -23,8 +23,8 @@ public:
|
||||
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);
|
||||
|
@ -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 @@ void ScintillaGTK::ScrollText(int linesToMove) {
|
||||
|
||||
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 @@ void ScintillaGTK::GetGtkSelectionText(GtkSelectionData *selectionData, Selectio
|
||||
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 @@ void ScintillaGTK::GetGtkSelectionText(GtkSelectionData *selectionData, Selectio
|
||||
// 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 @@ void ScintillaGTK::GetGtkSelectionText(GtkSelectionData *selectionData, Selectio
|
||||
// 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::ReceivedDrop(GtkSelectionData *selection_data) {
|
||||
|
||||
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 @@ void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, Se
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -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*/
|
||||
|
@ -118,6 +118,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#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 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#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
|
||||
|
Loading…
x
Reference in New Issue
Block a user