Merge branch 'scintilla-update-351-pre'
This commit is contained in:
commit
96806bf639
@ -19,6 +19,7 @@ sqlplus=default
|
||||
sqlplus_prompt=default
|
||||
sqlplus_comment=comment
|
||||
quotedidentifier=identifier_2
|
||||
qoperator=operator
|
||||
|
||||
[keywords]
|
||||
# all items must be in one line
|
||||
|
@ -4,6 +4,7 @@
|
||||
default=default
|
||||
comment=comment
|
||||
comment_line_bang=comment_line
|
||||
block_comment=comment
|
||||
number=number_1
|
||||
string=string_1
|
||||
operator=operator
|
||||
|
@ -811,9 +811,9 @@ void SurfaceImpl::DrawRGBAImage(PRectangle rc, int width, int height, const unsi
|
||||
#endif
|
||||
int ucs = stride * height;
|
||||
std::vector<unsigned char> image(ucs);
|
||||
for (int y=0; y<height; y++) {
|
||||
for (int x=0; x<width; x++) {
|
||||
unsigned char *pixel = &image[0] + y*stride + x * 4;
|
||||
for (int iy=0; iy<height; iy++) {
|
||||
for (int ix=0; ix<width; ix++) {
|
||||
unsigned char *pixel = &image[0] + iy*stride + ix * 4;
|
||||
unsigned char alpha = pixelsImage[3];
|
||||
pixel[2] = (*pixelsImage++) * alpha / 255;
|
||||
pixel[1] = (*pixelsImage++) * alpha / 255;
|
||||
@ -822,12 +822,12 @@ void SurfaceImpl::DrawRGBAImage(PRectangle rc, int width, int height, const unsi
|
||||
}
|
||||
}
|
||||
|
||||
cairo_surface_t *psurf = cairo_image_surface_create_for_data(&image[0], CAIRO_FORMAT_ARGB32, width, height, stride);
|
||||
cairo_set_source_surface(context, psurf, rc.left, rc.top);
|
||||
cairo_surface_t *psurfImage = cairo_image_surface_create_for_data(&image[0], CAIRO_FORMAT_ARGB32, width, height, stride);
|
||||
cairo_set_source_surface(context, psurfImage, rc.left, rc.top);
|
||||
cairo_rectangle(context, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top);
|
||||
cairo_fill(context);
|
||||
|
||||
cairo_surface_destroy(psurf);
|
||||
cairo_surface_destroy(psurfImage);
|
||||
}
|
||||
|
||||
void SurfaceImpl::Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back) {
|
||||
@ -1625,10 +1625,10 @@ void ListBoxX::Create(Window &, int, Point, int, bool, int) {
|
||||
if (g_object_class_find_property(G_OBJECT_GET_CLASS(list), "fixed-height-mode"))
|
||||
g_object_set(G_OBJECT(list), "fixed-height-mode", TRUE, NULL);
|
||||
|
||||
GtkWidget *wid = PWidget(list); // No code inside the G_OBJECT macro
|
||||
gtk_container_add(GTK_CONTAINER(PWidget(scroller)), wid);
|
||||
gtk_widget_show(wid);
|
||||
g_signal_connect(G_OBJECT(wid), "button_press_event",
|
||||
GtkWidget *widget = PWidget(list); // No code inside the G_OBJECT macro
|
||||
gtk_container_add(GTK_CONTAINER(PWidget(scroller)), widget);
|
||||
gtk_widget_show(widget);
|
||||
g_signal_connect(G_OBJECT(widget), "button_press_event",
|
||||
G_CALLBACK(ButtonPress), this);
|
||||
}
|
||||
|
||||
@ -1658,6 +1658,14 @@ int ListBoxX::GetVisibleRows() const {
|
||||
|
||||
int ListBoxX::GetRowHeight()
|
||||
{
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
// This version sometimes reports erroneous results on GTK2, but the GTK2
|
||||
// version is inaccurate for GTK 3.14.
|
||||
GdkRectangle rect;
|
||||
GtkTreePath *path = gtk_tree_path_new_first();
|
||||
gtk_tree_view_get_background_area(GTK_TREE_VIEW(list), path, NULL, &rect);
|
||||
return rect.height;
|
||||
#else
|
||||
int row_height=0;
|
||||
int vertical_separator=0;
|
||||
int expander_size=0;
|
||||
@ -1669,6 +1677,7 @@ int ListBoxX::GetRowHeight()
|
||||
row_height += vertical_separator;
|
||||
row_height = Platform::Maximum(row_height, expander_size);
|
||||
return row_height;
|
||||
#endif
|
||||
}
|
||||
|
||||
PRectangle ListBoxX::GetDesiredRect() {
|
||||
|
@ -55,6 +55,7 @@
|
||||
#include "Document.h"
|
||||
#include "CaseConvert.h"
|
||||
#include "UniConversion.h"
|
||||
#include "UnicodeFromUTF8.h"
|
||||
#include "Selection.h"
|
||||
#include "PositionCache.h"
|
||||
#include "EditModel.h"
|
||||
@ -63,7 +64,6 @@
|
||||
#include "Editor.h"
|
||||
#include "AutoComplete.h"
|
||||
#include "ScintillaBase.h"
|
||||
#include "UnicodeFromUTF8.h"
|
||||
|
||||
#ifdef SCI_LEXER
|
||||
#include "ExternalLexer.h"
|
||||
|
@ -128,6 +128,7 @@
|
||||
#define SCLEX_AS 113
|
||||
#define SCLEX_DMIS 114
|
||||
#define SCLEX_REGISTRY 115
|
||||
#define SCLEX_BIBTEX 116
|
||||
#define SCLEX_AUTOMATIC 1000
|
||||
#define SCE_P_DEFAULT 0
|
||||
#define SCE_P_COMMENTLINE 1
|
||||
@ -1004,6 +1005,7 @@
|
||||
#define SCE_VHDL_STDPACKAGE 12
|
||||
#define SCE_VHDL_STDTYPE 13
|
||||
#define SCE_VHDL_USERWORD 14
|
||||
#define SCE_VHDL_BLOCK_COMMENT 15
|
||||
#define SCE_CAML_DEFAULT 0
|
||||
#define SCE_CAML_IDENTIFIER 1
|
||||
#define SCE_CAML_TAGNAME 2
|
||||
@ -1115,6 +1117,7 @@
|
||||
#define SCE_SQL_USER3 21
|
||||
#define SCE_SQL_USER4 22
|
||||
#define SCE_SQL_QUOTEDIDENTIFIER 23
|
||||
#define SCE_SQL_QOPERATOR 24
|
||||
#define SCE_ST_DEFAULT 0
|
||||
#define SCE_ST_STRING 1
|
||||
#define SCE_ST_NUMBER 2
|
||||
@ -1731,6 +1734,13 @@
|
||||
#define SCE_REG_STRING_GUID 10
|
||||
#define SCE_REG_PARAMETER 11
|
||||
#define SCE_REG_OPERATOR 12
|
||||
#define SCE_BIBTEX_DEFAULT 0
|
||||
#define SCE_BIBTEX_ENTRY 1
|
||||
#define SCE_BIBTEX_UNKNOWN_ENTRY 2
|
||||
#define SCE_BIBTEX_KEY 3
|
||||
#define SCE_BIBTEX_PARAMETER 4
|
||||
#define SCE_BIBTEX_VALUE 5
|
||||
#define SCE_BIBTEX_COMMENT 6
|
||||
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
|
||||
|
||||
#endif
|
||||
|
@ -97,6 +97,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_GETNEXTTABSTOP 2677
|
||||
#define SC_CP_UTF8 65001
|
||||
#define SCI_SETCODEPAGE 2037
|
||||
#define SC_IME_WINDOWED 0
|
||||
#define SC_IME_INLINE 1
|
||||
#define SCI_GETIMEINTERACTION 2678
|
||||
#define SCI_SETIMEINTERACTION 2679
|
||||
#define MARKER_MAX 31
|
||||
#define SC_MARK_CIRCLE 0
|
||||
#define SC_MARK_ROUNDRECT 1
|
||||
@ -888,6 +892,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
||||
#define SCI_SCROLLTOEND 2629
|
||||
#define SC_TECHNOLOGY_DEFAULT 0
|
||||
#define SC_TECHNOLOGY_DIRECTWRITE 1
|
||||
#define SC_TECHNOLOGY_DIRECTWRITERETAIN 2
|
||||
#define SCI_SETTECHNOLOGY 2630
|
||||
#define SCI_GETTECHNOLOGY 2631
|
||||
#define SCI_CREATELOADER 2632
|
||||
|
@ -243,6 +243,16 @@ val SC_CP_UTF8=65001
|
||||
# The SC_CP_UTF8 value can be used to enter Unicode mode.
|
||||
set void SetCodePage=2037(int codePage,)
|
||||
|
||||
enu IMEInteraction=SC_IME_
|
||||
val SC_IME_WINDOWED=0
|
||||
val SC_IME_INLINE=1
|
||||
|
||||
# Is the IME displayed in a winow or inline?
|
||||
get int GetIMEInteraction=2678(,)
|
||||
|
||||
# Choose to display the the IME in a winow or inline.
|
||||
set void SetIMEInteraction=2679(int imeInteraction,)
|
||||
|
||||
enu MarkerSymbol=SC_MARK_
|
||||
val MARKER_MAX=31
|
||||
val SC_MARK_CIRCLE=0
|
||||
@ -2349,6 +2359,7 @@ fun void ScrollToEnd=2629(,)
|
||||
|
||||
val SC_TECHNOLOGY_DEFAULT=0
|
||||
val SC_TECHNOLOGY_DIRECTWRITE=1
|
||||
val SC_TECHNOLOGY_DIRECTWRITERETAIN=2
|
||||
|
||||
# Set the technology used.
|
||||
set void SetTechnology=2630(int technology,)
|
||||
@ -2700,6 +2711,7 @@ val SCLEX_DMAP=112
|
||||
val SCLEX_AS=113
|
||||
val SCLEX_DMIS=114
|
||||
val SCLEX_REGISTRY=115
|
||||
val SCLEX_BIBTEX=116
|
||||
|
||||
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
|
||||
# value assigned in sequence from SCLEX_AUTOMATIC+1.
|
||||
@ -3703,6 +3715,7 @@ val SCE_VHDL_STDFUNCTION=11
|
||||
val SCE_VHDL_STDPACKAGE=12
|
||||
val SCE_VHDL_STDTYPE=13
|
||||
val SCE_VHDL_USERWORD=14
|
||||
val SCE_VHDL_BLOCK_COMMENT=15
|
||||
# Lexical states for SCLEX_CAML
|
||||
lex Caml=SCLEX_CAML SCE_CAML_
|
||||
val SCE_CAML_DEFAULT=0
|
||||
@ -3824,6 +3837,7 @@ val SCE_SQL_USER2=20
|
||||
val SCE_SQL_USER3=21
|
||||
val SCE_SQL_USER4=22
|
||||
val SCE_SQL_QUOTEDIDENTIFIER=23
|
||||
val SCE_SQL_QOPERATOR=24
|
||||
# Lexical states for SCLEX_SMALLTALK
|
||||
lex Smalltalk=SCLEX_SMALLTALK SCE_ST_
|
||||
val SCE_ST_DEFAULT=0
|
||||
@ -4512,6 +4526,15 @@ val SCE_REG_KEYPATH_GUID=9
|
||||
val SCE_REG_STRING_GUID=10
|
||||
val SCE_REG_PARAMETER=11
|
||||
val SCE_REG_OPERATOR=12
|
||||
# Lexical state for SCLEX_BIBTEX
|
||||
lex BibTeX=SCLEX_BIBTEX SCE_BIBTEX_
|
||||
val SCE_BIBTEX_DEFAULT=0
|
||||
val SCE_BIBTEX_ENTRY=1
|
||||
val SCE_BIBTEX_UNKNOWN_ENTRY=2
|
||||
val SCE_BIBTEX_KEY=3
|
||||
val SCE_BIBTEX_PARAMETER=4
|
||||
val SCE_BIBTEX_VALUE=5
|
||||
val SCE_BIBTEX_COMMENT=6
|
||||
|
||||
# Events
|
||||
|
||||
|
@ -444,6 +444,8 @@ void SCI_METHOD LexerSQL::Lex(unsigned int startPos, int length, int initStyle,
|
||||
StyleContext sc(startPos, length, initStyle, styler);
|
||||
int styleBeforeDCKeyword = SCE_SQL_DEFAULT;
|
||||
int offset = 0;
|
||||
char qOperator = 0x00;
|
||||
|
||||
for (; sc.More(); sc.Forward(), offset++) {
|
||||
// Determine if the current state should terminate.
|
||||
switch (sc.state) {
|
||||
@ -556,11 +558,39 @@ void SCI_METHOD LexerSQL::Lex(unsigned int startPos, int length, int initStyle,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SCE_SQL_QOPERATOR:
|
||||
if (qOperator == 0x00) {
|
||||
qOperator = sc.ch;
|
||||
} else {
|
||||
char qComplement = 0x00;
|
||||
|
||||
if (qOperator == '<') {
|
||||
qComplement = '>';
|
||||
} else if (qOperator == '(') {
|
||||
qComplement = ')';
|
||||
} else if (qOperator == '{') {
|
||||
qComplement = '}';
|
||||
} else if (qOperator == '[') {
|
||||
qComplement = ']';
|
||||
} else {
|
||||
qComplement = qOperator;
|
||||
}
|
||||
|
||||
if (sc.Match(qComplement, '\'')) {
|
||||
sc.Forward();
|
||||
sc.ForwardSetState(SCE_SQL_DEFAULT);
|
||||
qOperator = 0x00;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Determine if a new state should be entered.
|
||||
if (sc.state == SCE_SQL_DEFAULT) {
|
||||
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
|
||||
if (sc.Match('q', '\'') || sc.Match('Q', '\'')) {
|
||||
sc.SetState(SCE_SQL_QOPERATOR);
|
||||
sc.Forward();
|
||||
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
|
||||
sc.SetState(SCE_SQL_NUMBER);
|
||||
} else if (IsAWordStart(sc.ch)) {
|
||||
sc.SetState(SCE_SQL_IDENTIFIER);
|
||||
|
@ -119,6 +119,11 @@ static void ColouriseVHDLDoc(
|
||||
sc.ChangeState(SCE_VHDL_STRINGEOL);
|
||||
sc.ForwardSetState(SCE_VHDL_DEFAULT);
|
||||
}
|
||||
} else if (sc.state == SCE_VHDL_BLOCK_COMMENT){
|
||||
if(sc.ch == '*' && sc.chNext == '/'){
|
||||
sc.Forward();
|
||||
sc.ForwardSetState(SCE_VHDL_DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
// Determine if a new state should be entered.
|
||||
@ -132,6 +137,8 @@ static void ColouriseVHDLDoc(
|
||||
sc.SetState(SCE_VHDL_COMMENTLINEBANG);
|
||||
else
|
||||
sc.SetState(SCE_VHDL_COMMENT);
|
||||
} else if (sc.Match('/', '*')){
|
||||
sc.SetState(SCE_VHDL_BLOCK_COMMENT);
|
||||
} else if (sc.ch == '\"') {
|
||||
sc.SetState(SCE_VHDL_STRING);
|
||||
} else if (isoperator(static_cast<char>(sc.ch))) {
|
||||
@ -155,6 +162,39 @@ static bool IsCommentLine(int line, Accessor &styler) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
static bool IsCommentBlockStart(int line, Accessor &styler)
|
||||
{
|
||||
int pos = styler.LineStart(line);
|
||||
int eol_pos = styler.LineStart(line + 1) - 1;
|
||||
for (int i = pos; i < eol_pos; i++) {
|
||||
char ch = styler[i];
|
||||
char chNext = styler[i+1];
|
||||
char style = styler.StyleAt(i);
|
||||
if ((style == SCE_VHDL_BLOCK_COMMENT) && (ch == '/') && (chNext == '*'))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool IsCommentBlockEnd(int line, Accessor &styler)
|
||||
{
|
||||
int pos = styler.LineStart(line);
|
||||
int eol_pos = styler.LineStart(line + 1) - 1;
|
||||
|
||||
for (int i = pos; i < eol_pos; i++) {
|
||||
char ch = styler[i];
|
||||
char chNext = styler[i+1];
|
||||
char style = styler.StyleAt(i);
|
||||
if ((style == SCE_VHDL_BLOCK_COMMENT) && (ch == '*') && (chNext == '/'))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool IsCommentStyle(char style)
|
||||
{
|
||||
return style == SCE_VHDL_BLOCK_COMMENT || style == SCE_VHDL_COMMENT || style == SCE_VHDL_COMMENTLINEBANG;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Folding the code
|
||||
@ -207,14 +247,14 @@ static void FoldNoBoxVHDLDoc(
|
||||
char chPrev = styler.SafeGetCharAt(j-1);
|
||||
int style = styler.StyleAt(j);
|
||||
int stylePrev = styler.StyleAt(j-1);
|
||||
if ((stylePrev != SCE_VHDL_COMMENT) && (stylePrev != SCE_VHDL_STRING))
|
||||
if ((!IsCommentStyle(style)) && (stylePrev != SCE_VHDL_STRING))
|
||||
{
|
||||
if(IsAWordChar(chPrev) && !IsAWordChar(ch))
|
||||
{
|
||||
end = j-1;
|
||||
}
|
||||
}
|
||||
if ((style != SCE_VHDL_COMMENT) && (style != SCE_VHDL_STRING))
|
||||
if ((!IsCommentStyle(style)) && (style != SCE_VHDL_STRING))
|
||||
{
|
||||
if(!IsAWordChar(chPrev) && IsAWordStart(ch) && (end != 0))
|
||||
{
|
||||
@ -236,7 +276,7 @@ static void FoldNoBoxVHDLDoc(
|
||||
{
|
||||
char ch = styler.SafeGetCharAt(j);
|
||||
int style = styler.StyleAt(j);
|
||||
if ((style != SCE_VHDL_COMMENT) && (style != SCE_VHDL_STRING))
|
||||
if ((!IsCommentStyle(style)) && (style != SCE_VHDL_STRING))
|
||||
{
|
||||
if((ch == ';') && (strcmp(prevWord, "end") == 0))
|
||||
{
|
||||
@ -268,15 +308,29 @@ static void FoldNoBoxVHDLDoc(
|
||||
styleNext = styler.StyleAt(i + 1);
|
||||
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
|
||||
|
||||
if (foldComment && atEOL && IsCommentLine(lineCurrent, styler))
|
||||
if (foldComment && atEOL)
|
||||
{
|
||||
if(!IsCommentLine(lineCurrent-1, styler) && IsCommentLine(lineCurrent+1, styler))
|
||||
if(IsCommentLine(lineCurrent, styler))
|
||||
{
|
||||
levelNext++;
|
||||
if(!IsCommentLine(lineCurrent-1, styler) && IsCommentLine(lineCurrent+1, styler))
|
||||
{
|
||||
levelNext++;
|
||||
}
|
||||
else if(IsCommentLine(lineCurrent-1, styler) && !IsCommentLine(lineCurrent+1, styler))
|
||||
{
|
||||
levelNext--;
|
||||
}
|
||||
}
|
||||
else if(IsCommentLine(lineCurrent-1, styler) && !IsCommentLine(lineCurrent+1, styler))
|
||||
else
|
||||
{
|
||||
levelNext--;
|
||||
if (IsCommentBlockStart(lineCurrent, styler) && !IsCommentBlockEnd(lineCurrent, styler))
|
||||
{
|
||||
levelNext++;
|
||||
}
|
||||
else if (IsCommentBlockEnd(lineCurrent, styler) && !IsCommentBlockStart(lineCurrent, styler))
|
||||
{
|
||||
levelNext--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -289,7 +343,7 @@ static void FoldNoBoxVHDLDoc(
|
||||
}
|
||||
}
|
||||
|
||||
if ((style != SCE_VHDL_COMMENT) && (style != SCE_VHDL_STRING))
|
||||
if ((!IsCommentStyle(style)) && (style != SCE_VHDL_STRING))
|
||||
{
|
||||
if((ch == ';') && (strcmp(prevWord, "end") == 0))
|
||||
{
|
||||
@ -301,7 +355,7 @@ static void FoldNoBoxVHDLDoc(
|
||||
lastStart = i;
|
||||
}
|
||||
|
||||
if(iswordchar(ch) && !iswordchar(chNext)) {
|
||||
if(IsAWordChar(ch) && !IsAWordChar(chNext)) {
|
||||
char s[32];
|
||||
unsigned int k;
|
||||
for(k=0; (k<31 ) && (k<i-lastStart+1 ); k++) {
|
||||
@ -314,8 +368,6 @@ static void FoldNoBoxVHDLDoc(
|
||||
if (
|
||||
strcmp(s, "architecture") == 0 ||
|
||||
strcmp(s, "case") == 0 ||
|
||||
strcmp(s, "component") == 0 ||
|
||||
strcmp(s, "entity") == 0 ||
|
||||
strcmp(s, "generate") == 0 ||
|
||||
strcmp(s, "loop") == 0 ||
|
||||
strcmp(s, "package") ==0 ||
|
||||
@ -330,6 +382,32 @@ static void FoldNoBoxVHDLDoc(
|
||||
}
|
||||
levelNext++;
|
||||
}
|
||||
} else if (
|
||||
strcmp(s, "component") == 0 ||
|
||||
strcmp(s, "entity") == 0 ||
|
||||
strcmp(s, "configuration") == 0 )
|
||||
{
|
||||
if (strcmp(prevWord, "end") != 0)
|
||||
{ // check for instantiated unit by backward searching for the colon.
|
||||
unsigned pos = lastStart-1;
|
||||
char chAtPos, styleAtPos;
|
||||
do{// skip white spaces
|
||||
styleAtPos = styler.StyleAt(pos);
|
||||
chAtPos = styler.SafeGetCharAt(pos--);
|
||||
}while(pos>0 &&
|
||||
(chAtPos == ' ' || chAtPos == '\t' ||
|
||||
chAtPos == '\n' || chAtPos == '\r' ||
|
||||
IsCommentStyle(styleAtPos)));
|
||||
|
||||
// check for a colon (':') before the instantiated units "entity", "component" or "configuration". Don't fold thereafter.
|
||||
if (chAtPos != ':')
|
||||
{
|
||||
if (levelMinCurrentElse > levelNext) {
|
||||
levelMinCurrentElse = levelNext;
|
||||
}
|
||||
levelNext++;
|
||||
}
|
||||
}
|
||||
} else if (
|
||||
strcmp(s, "procedure") == 0 ||
|
||||
strcmp(s, "function") == 0)
|
||||
@ -338,19 +416,19 @@ static void FoldNoBoxVHDLDoc(
|
||||
{ // This code checks to see if the procedure / function is a definition within a "package"
|
||||
// rather than the actual code in the body.
|
||||
int BracketLevel = 0;
|
||||
for(int j=i+1; j<styler.Length(); j++)
|
||||
for(int pos=i+1; pos<styler.Length(); pos++)
|
||||
{
|
||||
int LocalStyle = styler.StyleAt(j);
|
||||
char LocalCh = styler.SafeGetCharAt(j);
|
||||
if(LocalCh == '(') BracketLevel++;
|
||||
if(LocalCh == ')') BracketLevel--;
|
||||
int styleAtPos = styler.StyleAt(pos);
|
||||
char chAtPos = styler.SafeGetCharAt(pos);
|
||||
if(chAtPos == '(') BracketLevel++;
|
||||
if(chAtPos == ')') BracketLevel--;
|
||||
if(
|
||||
(BracketLevel == 0) &&
|
||||
(LocalStyle != SCE_VHDL_COMMENT) &&
|
||||
(LocalStyle != SCE_VHDL_STRING) &&
|
||||
!iswordchar(styler.SafeGetCharAt(j-1)) &&
|
||||
styler.Match(j, "is") &&
|
||||
!iswordchar(styler.SafeGetCharAt(j+2)))
|
||||
(!IsCommentStyle(styleAtPos)) &&
|
||||
(styleAtPos != SCE_VHDL_STRING) &&
|
||||
!iswordchar(styler.SafeGetCharAt(pos-1)) &&
|
||||
styler.Match(pos, "is") &&
|
||||
!iswordchar(styler.SafeGetCharAt(pos+2)))
|
||||
{
|
||||
if (levelMinCurrentElse > levelNext) {
|
||||
levelMinCurrentElse = levelNext;
|
||||
@ -358,7 +436,7 @@ static void FoldNoBoxVHDLDoc(
|
||||
levelNext++;
|
||||
break;
|
||||
}
|
||||
if((BracketLevel == 0) && (LocalCh == ';'))
|
||||
if((BracketLevel == 0) && (chAtPos == ';'))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ diff --git b/scintilla/src/Catalogue.cxx a/scintilla/src/Catalogue.cxx
|
||||
index 41d5d54..70ce3bc 100644
|
||||
--- scintilla/src/Catalogue.cxx
|
||||
+++ scintilla/src/Catalogue.cxx
|
||||
@@ -76,116 +76,48 @@ int Scintilla_LinkLexers() {
|
||||
@@ -76,117 +76,48 @@ int Scintilla_LinkLexers() {
|
||||
|
||||
//++Autogenerated -- run scripts/LexGen.py to regenerate
|
||||
//**\(\tLINK_LEXER(\*);\n\)
|
||||
@ -49,6 +49,7 @@ index 41d5d54..70ce3bc 100644
|
||||
- LINK_LEXER(lmBaan);
|
||||
LINK_LEXER(lmBash);
|
||||
LINK_LEXER(lmBatch);
|
||||
- LINK_LEXER(lmBibTeX);
|
||||
- LINK_LEXER(lmBlitzBasic);
|
||||
- LINK_LEXER(lmBullant);
|
||||
LINK_LEXER(lmCaml);
|
||||
|
@ -937,6 +937,8 @@ void Document::CheckReadOnly() {
|
||||
// SetStyleAt does not change the persistent state of a document
|
||||
|
||||
bool Document::DeleteChars(int pos, int len) {
|
||||
if (pos < 0)
|
||||
return false;
|
||||
if (len <= 0)
|
||||
return false;
|
||||
if ((pos + len) > Length())
|
||||
@ -2198,8 +2200,8 @@ public:
|
||||
long BuiltinRegex::FindText(Document *doc, int minPos, int maxPos, const char *s,
|
||||
bool caseSensitive, bool, bool, int flags,
|
||||
int *length) {
|
||||
bool posix = (flags & SCFIND_POSIX) != 0;
|
||||
int increment = (minPos <= maxPos) ? 1 : -1;
|
||||
const bool posix = (flags & SCFIND_POSIX) != 0;
|
||||
const int increment = (minPos <= maxPos) ? 1 : -1;
|
||||
|
||||
int startPos = minPos;
|
||||
int endPos = maxPos;
|
||||
@ -2217,7 +2219,7 @@ long BuiltinRegex::FindText(Document *doc, int minPos, int maxPos, const char *s
|
||||
// Search: \$(\([A-Za-z0-9_-]+\)\.\([A-Za-z0-9_.]+\))
|
||||
// Replace: $(\1-\2)
|
||||
int lineRangeStart = doc->LineFromPosition(startPos);
|
||||
int lineRangeEnd = doc->LineFromPosition(endPos);
|
||||
const int lineRangeEnd = doc->LineFromPosition(endPos);
|
||||
if ((increment == 1) &&
|
||||
(startPos >= doc->LineEnd(lineRangeStart)) &&
|
||||
(lineRangeStart < lineRangeEnd)) {
|
||||
@ -2233,9 +2235,9 @@ long BuiltinRegex::FindText(Document *doc, int minPos, int maxPos, const char *s
|
||||
}
|
||||
int pos = -1;
|
||||
int lenRet = 0;
|
||||
char searchEnd = s[*length - 1];
|
||||
char searchEndPrev = (*length > 1) ? s[*length - 2] : '\0';
|
||||
int lineRangeBreak = lineRangeEnd + increment;
|
||||
const char searchEnd = s[*length - 1];
|
||||
const char searchEndPrev = (*length > 1) ? s[*length - 2] : '\0';
|
||||
const int lineRangeBreak = lineRangeEnd + increment;
|
||||
for (int line = lineRangeStart; line != lineRangeBreak; line += increment) {
|
||||
int startOfLine = doc->LineStart(line);
|
||||
int endOfLine = doc->LineEnd(line);
|
||||
|
@ -61,6 +61,7 @@ EditModel::EditModel() {
|
||||
bracesMatchStyle = STYLE_BRACEBAD;
|
||||
highlightGuideColumn = 0;
|
||||
primarySelection = true;
|
||||
imeInteraction = imeWindowed;
|
||||
foldFlags = 0;
|
||||
hotspot = Range(invalidPosition);
|
||||
wrapWidth = LineLayout::wrapWidthInfinite;
|
||||
|
@ -42,6 +42,8 @@ public:
|
||||
Selection sel;
|
||||
bool primarySelection;
|
||||
|
||||
enum IMEInteraction { imeWindowed, imeInline } imeInteraction;
|
||||
|
||||
int foldFlags;
|
||||
ContractionState cs;
|
||||
// Hotspot support
|
||||
|
@ -215,11 +215,11 @@ void EditView::ClearAllTabstops() {
|
||||
ldTabstops = 0;
|
||||
}
|
||||
|
||||
int EditView::NextTabstopPos(int line, int x, int tabWidth) const {
|
||||
int next = GetNextTabstop(line, x);
|
||||
XYPOSITION EditView::NextTabstopPos(int line, XYPOSITION x, XYPOSITION tabWidth) const {
|
||||
int next = GetNextTabstop(line, static_cast<int>(x + 2));
|
||||
if (next > 0)
|
||||
return next;
|
||||
return ((((x + 2) / tabWidth) + 1) * tabWidth);
|
||||
return static_cast<XYPOSITION>(next);
|
||||
return (static_cast<int>((x + 2) / tabWidth) + 1) * tabWidth;
|
||||
}
|
||||
|
||||
bool EditView::ClearTabstops(int line) {
|
||||
@ -452,9 +452,8 @@ void EditView::LayoutLine(const EditModel &model, int line, Surface *surface, co
|
||||
XYPOSITION representationWidth = vstyle.controlCharWidth;
|
||||
if (ll->chars[ts.start] == '\t') {
|
||||
// Tab is a special case of representation, taking a variable amount of space
|
||||
const int x = static_cast<int>(ll->positions[ts.start]);
|
||||
const int tabWidth = static_cast<int>(vstyle.tabWidth);
|
||||
representationWidth = static_cast<XYPOSITION>(NextTabstopPos(line, x, tabWidth) - ll->positions[ts.start]);
|
||||
const XYPOSITION x = ll->positions[ts.start];
|
||||
representationWidth = NextTabstopPos(line, x, vstyle.tabWidth) - ll->positions[ts.start];
|
||||
} else {
|
||||
if (representationWidth <= 0.0) {
|
||||
XYPOSITION positionsRepr[256]; // Should expand when needed
|
||||
|
@ -32,7 +32,7 @@ enum DrawPhase {
|
||||
drawLineTranslucent = 0x40,
|
||||
drawFoldLines = 0x80,
|
||||
drawCarets = 0x100,
|
||||
drawAll = 0x1FF,
|
||||
drawAll = 0x1FF
|
||||
};
|
||||
|
||||
bool ValidStyledText(const ViewStyle &vs, size_t styleOffset, const StyledText &st);
|
||||
@ -86,7 +86,7 @@ public:
|
||||
bool LinesOverlap() const;
|
||||
|
||||
void ClearAllTabstops();
|
||||
int NextTabstopPos(int line, int x, int tabWidth) const;
|
||||
XYPOSITION NextTabstopPos(int line, XYPOSITION x, XYPOSITION tabWidth) const;
|
||||
bool ClearTabstops(int line);
|
||||
bool AddTabstop(int line, int x);
|
||||
int GetNextTabstop(int line, int x) const;
|
||||
|
@ -2132,14 +2132,6 @@ void Editor::Redo() {
|
||||
}
|
||||
}
|
||||
|
||||
void Editor::DelChar() {
|
||||
if (!RangeContainsProtected(sel.MainCaret(), sel.MainCaret() + 1)) {
|
||||
pdoc->DelChar(sel.MainCaret());
|
||||
}
|
||||
// Avoid blinking during rapid typing:
|
||||
ShowCaretAtCurrentPosition();
|
||||
}
|
||||
|
||||
void Editor::DelCharBack(bool allowLineStartDeletion) {
|
||||
RefreshStyleData();
|
||||
if (!sel.IsRectangular())
|
||||
@ -4284,7 +4276,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
|
||||
}
|
||||
|
||||
bool Editor::PositionIsHotspot(int position) const {
|
||||
return vs.styles[pdoc->StyleAt(position)].hotspot;
|
||||
return vs.styles[static_cast<unsigned char>(pdoc->StyleAt(position))].hotspot;
|
||||
}
|
||||
|
||||
bool Editor::PointIsHotspot(Point pt) {
|
||||
@ -6259,6 +6251,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
||||
case SCI_GETCODEPAGE:
|
||||
return pdoc->dbcsCodePage;
|
||||
|
||||
case SCI_SETIMEINTERACTION:
|
||||
imeInteraction = static_cast<EditModel::IMEInteraction>(wParam);
|
||||
break;
|
||||
|
||||
case SCI_GETIMEINTERACTION:
|
||||
return imeInteraction;
|
||||
|
||||
#ifdef INCLUDE_DEPRECATED_FEATURES
|
||||
case SCI_SETUSEPALETTE:
|
||||
InvalidateStyleRedraw();
|
||||
|
@ -403,7 +403,6 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
||||
void SelectAll();
|
||||
void Undo();
|
||||
void Redo();
|
||||
void DelChar();
|
||||
void DelCharBack(bool allowLineStartDeletion);
|
||||
virtual void ClaimSelection() = 0;
|
||||
|
||||
|
@ -17,11 +17,14 @@ namespace Scintilla {
|
||||
class Indicator {
|
||||
public:
|
||||
int style;
|
||||
bool under;
|
||||
ColourDesired fore;
|
||||
bool under;
|
||||
int fillAlpha;
|
||||
int outlineAlpha;
|
||||
Indicator() : style(INDIC_PLAIN), under(false), fore(ColourDesired(0,0,0)), fillAlpha(30), outlineAlpha(50) {
|
||||
Indicator() : style(INDIC_PLAIN), fore(ColourDesired(0,0,0)), under(false), fillAlpha(30), outlineAlpha(50) {
|
||||
}
|
||||
Indicator(int style_, ColourDesired fore_=ColourDesired(0,0,0), bool under_=false, int fillAlpha_=30, int outlineAlpha_=50) :
|
||||
style(style_), fore(fore_), under(under_), fillAlpha(fillAlpha_), outlineAlpha(outlineAlpha_) {
|
||||
}
|
||||
void Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine) const;
|
||||
};
|
||||
|
@ -276,10 +276,9 @@ void RESearch::GrabMatches(CharacterIndexer &ci) {
|
||||
for (unsigned int i = 0; i < MAXTAG; i++) {
|
||||
if ((bopat[i] != NOTFOUND) && (eopat[i] != NOTFOUND)) {
|
||||
unsigned int len = eopat[i] - bopat[i];
|
||||
pat[i] = std::string(len+1, '\0');
|
||||
pat[i].resize(len);
|
||||
for (unsigned int j = 0; j < len; j++)
|
||||
pat[i][j] = ci.CharAt(bopat[i] + j);
|
||||
pat[i][len] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -192,15 +192,9 @@ void ViewStyle::Init(size_t stylesSize_) {
|
||||
// There are no image markers by default, so no need for calling CalcLargestMarkerHeight()
|
||||
largestMarkerHeight = 0;
|
||||
|
||||
indicators[0].style = INDIC_SQUIGGLE;
|
||||
indicators[0].under = false;
|
||||
indicators[0].fore = ColourDesired(0, 0x7f, 0);
|
||||
indicators[1].style = INDIC_TT;
|
||||
indicators[1].under = false;
|
||||
indicators[1].fore = ColourDesired(0, 0, 0xff);
|
||||
indicators[2].style = INDIC_PLAIN;
|
||||
indicators[2].under = false;
|
||||
indicators[2].fore = ColourDesired(0xff, 0, 0);
|
||||
indicators[0] = Indicator(INDIC_SQUIGGLE, ColourDesired(0, 0x7f, 0));
|
||||
indicators[1] = Indicator(INDIC_TT, ColourDesired(0, 0, 0xff));
|
||||
indicators[2] = Indicator(INDIC_PLAIN, ColourDesired(0xff, 0, 0));
|
||||
|
||||
technology = SC_TECHNOLOGY_DEFAULT;
|
||||
lineHeight = 1;
|
||||
|
@ -1 +1 @@
|
||||
350
|
||||
351
|
||||
|
@ -1388,7 +1388,8 @@ static const HLStyle highlighting_styles_SQL[] =
|
||||
{ SCE_SQL_SQLPLUS, "sqlplus", FALSE },
|
||||
{ SCE_SQL_SQLPLUS_PROMPT, "sqlplus_prompt", FALSE },
|
||||
{ SCE_SQL_SQLPLUS_COMMENT, "sqlplus_comment", FALSE },
|
||||
{ SCE_SQL_QUOTEDIDENTIFIER, "quotedidentifier", FALSE }
|
||||
{ SCE_SQL_QUOTEDIDENTIFIER, "quotedidentifier", FALSE },
|
||||
{ SCE_SQL_QOPERATOR, "qoperator", FALSE }
|
||||
/* these are for user-defined keywords we don't set yet */
|
||||
/*{ SCE_SQL_USER1, "user1", FALSE },
|
||||
{ SCE_SQL_USER2, "user2", FALSE },
|
||||
@ -1483,6 +1484,7 @@ static const HLStyle highlighting_styles_VHDL[] =
|
||||
{ SCE_VHDL_DEFAULT, "default", FALSE },
|
||||
{ SCE_VHDL_COMMENT, "comment", FALSE },
|
||||
{ SCE_VHDL_COMMENTLINEBANG, "comment_line_bang", FALSE },
|
||||
{ SCE_VHDL_BLOCK_COMMENT, "block_comment", FALSE },
|
||||
{ SCE_VHDL_NUMBER, "number", FALSE },
|
||||
{ SCE_VHDL_STRING, "string", FALSE },
|
||||
{ SCE_VHDL_OPERATOR, "operator", FALSE },
|
||||
|
Loading…
x
Reference in New Issue
Block a user