diff options
Diffstat (limited to 'scintilla/src')
-rw-r--r-- | scintilla/src/Catalogue.cxx | 1 | ||||
-rw-r--r-- | scintilla/src/Document.cxx | 14 | ||||
-rw-r--r-- | scintilla/src/EditModel.cxx | 1 | ||||
-rw-r--r-- | scintilla/src/EditModel.h | 2 | ||||
-rw-r--r-- | scintilla/src/EditView.cxx | 13 | ||||
-rw-r--r-- | scintilla/src/EditView.h | 4 | ||||
-rw-r--r-- | scintilla/src/Editor.cxx | 17 | ||||
-rw-r--r-- | scintilla/src/Editor.h | 1 | ||||
-rw-r--r-- | scintilla/src/Indicator.h | 7 | ||||
-rw-r--r-- | scintilla/src/RESearch.cxx | 3 | ||||
-rw-r--r-- | scintilla/src/ViewStyle.cxx | 12 |
11 files changed, 37 insertions, 38 deletions
diff --git a/scintilla/src/Catalogue.cxx b/scintilla/src/Catalogue.cxx index 9e03ae9..2d556cc 100644 --- a/scintilla/src/Catalogue.cxx +++ b/scintilla/src/Catalogue.cxx @@ -91,6 +91,7 @@ int Scintilla_LinkLexers() { //LINK_LEXER(lmBaan);
LINK_LEXER(lmBash);
LINK_LEXER(lmBatch);
+ //LINK_LEXER(lmBibTeX);
//LINK_LEXER(lmBlitzBasic);
//LINK_LEXER(lmBullant);
//LINK_LEXER(lmCaml);
diff --git a/scintilla/src/Document.cxx b/scintilla/src/Document.cxx index 86bc79f..3ffda0c 100644 --- a/scintilla/src/Document.cxx +++ b/scintilla/src/Document.cxx @@ -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);
diff --git a/scintilla/src/EditModel.cxx b/scintilla/src/EditModel.cxx index 815d227..8f66da4 100644 --- a/scintilla/src/EditModel.cxx +++ b/scintilla/src/EditModel.cxx @@ -61,6 +61,7 @@ EditModel::EditModel() { bracesMatchStyle = STYLE_BRACEBAD; highlightGuideColumn = 0; primarySelection = true; + imeInteraction = imeWindowed; foldFlags = 0; hotspot = Range(invalidPosition); wrapWidth = LineLayout::wrapWidthInfinite; diff --git a/scintilla/src/EditModel.h b/scintilla/src/EditModel.h index f7ca749..d8def32 100644 --- a/scintilla/src/EditModel.h +++ b/scintilla/src/EditModel.h @@ -42,6 +42,8 @@ public: Selection sel; bool primarySelection; + enum IMEInteraction { imeWindowed, imeInline } imeInteraction; + int foldFlags; ContractionState cs; // Hotspot support diff --git a/scintilla/src/EditView.cxx b/scintilla/src/EditView.cxx index c46a0fb..7d5860e 100644 --- a/scintilla/src/EditView.cxx +++ b/scintilla/src/EditView.cxx @@ -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 diff --git a/scintilla/src/EditView.h b/scintilla/src/EditView.h index 1845110..733612e 100644 --- a/scintilla/src/EditView.h +++ b/scintilla/src/EditView.h @@ -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; diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx index 407a5b8..c2631e7 100644 --- a/scintilla/src/Editor.cxx +++ b/scintilla/src/Editor.cxx @@ -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())
@@ -4300,7 +4292,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) {
@@ -6275,6 +6267,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();
diff --git a/scintilla/src/Editor.h b/scintilla/src/Editor.h index e9f6df3..58e67a0 100644 --- a/scintilla/src/Editor.h +++ b/scintilla/src/Editor.h @@ -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;
diff --git a/scintilla/src/Indicator.h b/scintilla/src/Indicator.h index 9deef45..8f2c170 100644 --- a/scintilla/src/Indicator.h +++ b/scintilla/src/Indicator.h @@ -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;
};
diff --git a/scintilla/src/RESearch.cxx b/scintilla/src/RESearch.cxx index 46f09b3..e0fb9ca 100644 --- a/scintilla/src/RESearch.cxx +++ b/scintilla/src/RESearch.cxx @@ -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';
}
}
}
diff --git a/scintilla/src/ViewStyle.cxx b/scintilla/src/ViewStyle.cxx index a06cd0a..8a62a90 100644 --- a/scintilla/src/ViewStyle.cxx +++ b/scintilla/src/ViewStyle.cxx @@ -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;
|