summaryrefslogtreecommitdiffstats
path: root/scintilla
diff options
context:
space:
mode:
Diffstat (limited to 'scintilla')
-rw-r--r--scintilla/doc/Lexer.txt2
-rw-r--r--scintilla/doc/ScintillaDoc.html180
-rw-r--r--scintilla/doc/ScintillaDownload.html10
-rw-r--r--scintilla/doc/ScintillaHistory.html102
-rw-r--r--scintilla/doc/index.html13
-rw-r--r--scintilla/include/SciLexer.h14
-rw-r--r--scintilla/include/Scintilla.h6
-rw-r--r--scintilla/include/Scintilla.iface35
-rw-r--r--scintilla/lexers/LexAU3.cxx4
-rw-r--r--scintilla/lexers/LexAVE.cxx4
-rw-r--r--scintilla/lexers/LexAda.cxx2
-rw-r--r--scintilla/lexers/LexAsm.cxx2
-rw-r--r--scintilla/lexers/LexBash.cxx14
-rw-r--r--scintilla/lexers/LexBullant.cxx2
-rw-r--r--scintilla/lexers/LexCOBOL.cxx8
-rw-r--r--scintilla/lexers/LexConf.cxx14
-rw-r--r--scintilla/lexers/LexCrontab.cxx10
-rw-r--r--scintilla/lexers/LexCsound.cxx2
-rw-r--r--scintilla/lexers/LexD.cxx8
-rw-r--r--scintilla/lexers/LexForth.cxx16
-rw-r--r--scintilla/lexers/LexGAP.cxx2
-rw-r--r--scintilla/lexers/LexGui4Cli.cxx4
-rw-r--r--scintilla/lexers/LexHTML.cxx19
-rw-r--r--scintilla/lexers/LexInno.cxx10
-rw-r--r--scintilla/lexers/LexKVIrc.cxx473
-rw-r--r--scintilla/lexers/LexLaTeX.cxx8
-rw-r--r--scintilla/lexers/LexLisp.cxx6
-rw-r--r--scintilla/lexers/LexLout.cxx2
-rw-r--r--scintilla/lexers/LexMMIXAL.cxx2
-rw-r--r--scintilla/lexers/LexMPT.cxx2
-rw-r--r--scintilla/lexers/LexMSSQL.cxx17
-rw-r--r--scintilla/lexers/LexNsis.cxx2
-rw-r--r--scintilla/lexers/LexOpal.cxx8
-rw-r--r--scintilla/lexers/LexOthers.cxx2
-rw-r--r--scintilla/lexers/LexPerl.cxx2
-rw-r--r--scintilla/lexers/LexPython.cxx2
-rw-r--r--scintilla/lexers/LexR.cxx2
-rw-r--r--scintilla/lexers/LexSTTXT.cxx13
-rw-r--r--scintilla/lexers/LexScriptol.cxx2
-rw-r--r--scintilla/lexers/LexSpice.cxx25
-rw-r--r--scintilla/lexers/LexTCMD.cxx4
-rw-r--r--scintilla/lexers/LexYAML.cxx2
-rw-r--r--scintilla/lexlib/Accessor.cxx2
-rw-r--r--scintilla/lexlib/CharacterSet.cxx2
-rw-r--r--scintilla/lexlib/LexerBase.cxx2
-rw-r--r--scintilla/lexlib/LexerModule.cxx2
-rw-r--r--scintilla/lexlib/LexerNoExceptions.cxx2
-rw-r--r--scintilla/lexlib/LexerNoExceptions.h4
-rw-r--r--scintilla/lexlib/LexerSimple.cxx2
-rw-r--r--scintilla/lexlib/StyleContext.cxx2
-rw-r--r--scintilla/lexlib/WordList.cxx4
-rw-r--r--scintilla/src/AutoComplete.cxx2
-rw-r--r--scintilla/src/CaseConvert.cxx256
-rw-r--r--scintilla/src/Catalogue.cxx13
-rw-r--r--scintilla/src/CellBuffer.cxx4
-rw-r--r--scintilla/src/Decoration.cxx4
-rw-r--r--scintilla/src/Document.cxx23
-rw-r--r--scintilla/src/Document.h3
-rw-r--r--scintilla/src/Editor.cxx737
-rw-r--r--scintilla/src/Editor.h31
-rw-r--r--scintilla/src/ExternalLexer.cxx2
-rw-r--r--scintilla/src/FontQuality.h13
-rw-r--r--scintilla/src/KeyMap.h4
-rw-r--r--scintilla/src/LineMarker.h1
-rw-r--r--scintilla/src/Partitioning.h9
-rw-r--r--scintilla/src/PositionCache.cxx165
-rw-r--r--scintilla/src/PositionCache.h41
-rw-r--r--scintilla/src/RunStyles.cxx5
-rw-r--r--scintilla/src/ScintillaBase.cxx2
-rw-r--r--scintilla/src/SplitVector.h8
-rw-r--r--scintilla/src/UniConversion.cxx17
-rw-r--r--scintilla/src/UniConversion.h17
-rw-r--r--scintilla/src/UnicodeFromUTF8.h13
-rw-r--r--scintilla/src/ViewStyle.cxx139
-rw-r--r--scintilla/src/ViewStyle.h63
-rw-r--r--scintilla/src/XPM.cxx2
-rw-r--r--scintilla/version.txt2
-rw-r--r--scintilla/win32/PlatWin.cxx36
-rw-r--r--scintilla/win32/PlatWin.h13
-rw-r--r--scintilla/win32/ScintillaWin.cxx40
80 files changed, 1876 insertions, 868 deletions
diff --git a/scintilla/doc/Lexer.txt b/scintilla/doc/Lexer.txt
index 5f118e7..a9b75a2 100644
--- a/scintilla/doc/Lexer.txt
+++ b/scintilla/doc/Lexer.txt
@@ -34,7 +34,7 @@ newline terminates the initStyle state the lexer should enter its
default state (or whatever state should follow initStyle).
The keywordlists parameter specifies the keywords that the lexer must
-recognize. A WordList class object contains methods that make simplify
+recognize. A WordList class object contains methods that simplify
the recognition of keywords. Present lexers use a helper function
called classifyWordLLL to recognize keywords. These functions show how
to use the keywordlists parameter to recognize keywords. This
diff --git a/scintilla/doc/ScintillaDoc.html b/scintilla/doc/ScintillaDoc.html
index 8c111b1..cec4dd9 100644
--- a/scintilla/doc/ScintillaDoc.html
+++ b/scintilla/doc/ScintillaDoc.html
@@ -82,7 +82,7 @@
<h1>Scintilla Documentation</h1>
- <p>Last edited 29/June/2013 NH</p>
+ <p>Last edited 22/August/2013 NH</p>
<p>There is <a class="jump" href="Design.html">an overview of the internal design of
Scintilla</a>.<br />
@@ -212,6 +212,7 @@
<td>o <a class="toc" href="#Searching">Searching and replacing</a></td>
<td>o <a class="toc" href="#Overtype">Overtype</a></td>
+
</tr>
<tr>
@@ -220,6 +221,7 @@
<td>o <a class="toc" href="#ErrorHandling">Error handling</a></td>
<td>o <a class="toc" href="#UndoAndRedo">Undo and Redo</a></td>
+
</tr>
<tr>
@@ -229,6 +231,7 @@
<td>o <a class="toc" href="#ScrollingAndAutomaticScrolling">Scrolling and automatic
scrolling</a></td>
+
</tr>
<tr>
@@ -237,6 +240,7 @@
<td>o <a class="toc" href="#Cursor">Cursor</a></td>
<td>o <a class="toc" href="#MouseCapture">Mouse capture</a></td>
+
</tr>
<tr>
@@ -245,91 +249,103 @@
<td>o <a class="toc" href="#Styling">Styling</a></td>
<td>o <a class="toc" href="#StyleDefinition">Style definition</a></td>
+
</tr>
<tr>
<td>o <a class="toc" href="#CaretAndSelectionStyles">Caret, selection, and hotspot styles</a></td>
+
+ <td>o <a class="toc" href="#CharacterRepresentations">Character representations</a></td>
<td>o <a class="toc" href="#Margins">Margins</a></td>
- <td>o <a class="toc" href="#Annotations">Annotations</a></td>
</tr>
<tr>
+ <td>o <a class="toc" href="#Annotations">Annotations</a></td>
+
<td>o <a class="toc" href="#OtherSettings">Other settings</a></td>
<td>o <a class="toc" href="#BraceHighlighting">Brace highlighting</a></td>
- <td>o <a class="toc" href="#TabsAndIndentationGuides">Tabs and Indentation
- Guides</a></td>
</tr>
<tr>
+ <td>o <a class="toc" href="#TabsAndIndentationGuides">Tabs and Indentation
+ Guides</a></td>
+
<td>o <a class="toc" href="#Markers">Markers</a></td>
<td>o <a class="toc" href="#Indicators">Indicators</a></td>
- <td>o <a class="toc" href="#Autocompletion">Autocompletion</a></td>
</tr>
<tr>
+ <td>o <a class="toc" href="#Autocompletion">Autocompletion</a></td>
+
<td>o <a class="toc" href="#UserLists">User lists</a></td>
<td>o <a class="toc" href="#CallTips">Call tips</a></td>
- <td>o <a class="toc" href="#KeyboardCommands">Keyboard commands</a></td>
</tr>
<tr>
+ <td>o <a class="toc" href="#KeyboardCommands">Keyboard commands</a></td>
+
<td>o <a class="toc" href="#KeyBindings">Key bindings</a></td>
<td>o <a class="toc" href="#PopupEditMenu">Popup edit menu</a></td>
- <td>o <a class="toc" href="#MacroRecording">Macro recording</a></td>
</tr>
<tr>
+ <td>o <a class="toc" href="#MacroRecording">Macro recording</a></td>
+
<td>o <a class="toc" href="#Printing">Printing</a></td>
<td>o <a class="toc" href="#DirectAccess">Direct access</a></td>
- <td>o <a class="toc" href="#MultipleViews">Multiple views</a></td>
</tr>
<tr>
+ <td>o <a class="toc" href="#MultipleViews">Multiple views</a></td>
+
<td>o <a class="toc" href="#BackgroundLoadSave">Background loading and saving</a></td>
<td>o <a class="toc" href="#Folding">Folding</a></td>
- <td>o <a class="toc" href="#LineWrapping">Line wrapping</a></td>
</tr>
<tr>
+ <td>o <a class="toc" href="#LineWrapping">Line wrapping</a></td>
+
<td>o <a class="toc" href="#Zooming">Zooming</a></td>
<td>o <a class="toc" href="#LongLines">Long lines</a></td>
- <td>o <a class="toc" href="#Lexer">Lexer</a></td>
</tr>
<tr>
+ <td>o <a class="toc" href="#Lexer">Lexer</a></td>
+
<td>o <a class="toc" href="#LexerObjects">Lexer objects</a></td>
<td>o <a class="toc" href="#Notifications">Notifications</a></td>
- <td>o <a class="toc" href="#Images">Images</a></td>
</tr>
<tr>
+ <td>o <a class="toc" href="#Images">Images</a></td>
+
<td>o <a class="toc" href="#GTK">GTK+</a></td>
<td>o <a class="toc" href="#ProvisionalMessages"><span class="provisional">Provisional messages</span></a></td>
- <td>o <a class="toc" href="#DeprecatedMessages">Deprecated messages</a></td>
-
</tr>
<tr>
+ <td>o <a class="toc" href="#DeprecatedMessages">Deprecated messages</a></td>
+
<td>o <a class="toc" href="#EditMessagesNeverSupportedByScintilla">Edit messages never
supported by Scintilla</a></td>
@@ -1145,12 +1161,16 @@ struct Sci_TextToFind {
onlyWordCharacters)</a><br />
<a class="message" href="#SCI_POSITIONBEFORE">SCI_POSITIONBEFORE(int position)</a><br />
<a class="message" href="#SCI_POSITIONAFTER">SCI_POSITIONAFTER(int position)</a><br />
+ <a class="message" href="#SCI_POSITIONRELATIVE">SCI_POSITIONRELATIVE(int position, int relative)</a><br />
<a class="message" href="#SCI_COUNTCHARACTERS">SCI_COUNTCHARACTERS(int startPos, int endPos)</a><br />
<a class="message" href="#SCI_TEXTWIDTH">SCI_TEXTWIDTH(int styleNumber, const char *text)</a><br />
<a class="message" href="#SCI_TEXTHEIGHT">SCI_TEXTHEIGHT(int line)</a><br />
<a class="message" href="#SCI_CHOOSECARETX">SCI_CHOOSECARETX</a><br />
<a class="message" href="#SCI_MOVESELECTEDLINESUP">SCI_MOVESELECTEDLINESUP</a><br />
<a class="message" href="#SCI_MOVESELECTEDLINESDOWN">SCI_MOVESELECTEDLINESDOWN</a><br />
+ <a class="message" href="#SCI_SETMOUSESELECTIONRECTANGULARSWITCH">SCI_SETMOUSESELECTIONRECTANGULARSWITCH(bool
+ mouseSelectionRectangularSwitch)</a><br />
+ <a class="message" href="#SCI_GETMOUSESELECTIONRECTANGULARSWITCH">SCI_GETMOUSESELECTIONRECTANGULARSWITCH</a><br />
</code>
<p><b id="SCI_GETTEXTLENGTH">SCI_GETTEXTLENGTH</b><br />
@@ -1447,6 +1467,11 @@ struct Sci_TextToFind {
If called with a position within a multi byte character will return the position
of the start/end of that character.</p>
+ <p><b id="SCI_POSITIONRELATIVE">SCI_POSITIONRELATIVE(int position, int relative)</b><br />
+ Count a number of whole characters before or after the argument position and return that position.
+ The minimum position returned is 0 and the maximum is the last position in the document.
+ </p>
+
<p><b id="SCI_COUNTCHARACTERS">SCI_COUNTCHARACTERS(int startPos, int endPos)</b><br />
Returns the number of whole characters between two positions..</p>
@@ -1511,6 +1536,15 @@ struct Sci_TextToFind {
The selection will be automatically extended to the beginning of the selection's first line and the end of the seletion's last line.
If nothing was selected, the line the cursor is currently at will be selected.</p>
+ <p><b id="SCI_SETMOUSESELECTIONRECTANGULARSWITCH">SCI_SETMOUSESELECTIONRECTANGULARSWITCH(bool
+ mouseSelectionRectangularSwitch)</b><br />
+ <b id="SCI_GETMOUSESELECTIONRECTANGULARSWITCH">SCI_GETMOUSESELECTIONRECTANGULARSWITCH</b><br />
+ Enable or disable the ability to switch to rectangular selection mode while making a selection with the mouse.
+ When this option is turned on, mouse selections in stream mode can be switched to rectangular mode by pressing
+ the corresponding modifier key. They then stick to rectangular mode even when the modifier key is released again.
+ When this option is turned off, mouse selections will always stick to the mode the selection was started in. It
+ is off by default.</p>
+
<h2 id="MultipleSelectionAndVirtualSpace">Multiple Selection and Virtual Space</h2>
<code>
@@ -1700,7 +1734,7 @@ struct Sci_TextToFind {
<b id="SCI_GETADDITIONALSELALPHA">SCI_GETADDITIONALSELALPHA</b><br />
<b id="SCI_SETADDITIONALSELFORE">SCI_SETADDITIONALSELFORE(int <a class="jump" href="#colour">colour</a>)</b><br />
<b id="SCI_SETADDITIONALSELBACK">SCI_SETADDITIONALSELBACK(int <a class="jump" href="#colour">colour</a>)</b><br />
- Modify the appearence of additional selections so that they can be differentiated from the main selection which has its appearence set with
+ Modify the appearance of additional selections so that they can be differentiated from the main selection which has its appearance set with
<a class="message" href="#SCI_SETSELALPHA"><code>SCI_SETSELALPHA</code></a>,
<a class="message" href="#SCI_GETSELALPHA"><code>SCI_GETSELALPHA</code></a>,
<a class="message" href="#SCI_SETSELFORE"><code>SCI_SETSELFORE</code></a>, and
@@ -1711,7 +1745,7 @@ struct Sci_TextToFind {
<b id="SCI_GETADDITIONALCARETFORE">SCI_GETADDITIONALCARETFORE</b><br />
<b id="SCI_SETADDITIONALCARETSBLINK">SCI_SETADDITIONALCARETSBLINK(bool additionalCaretsBlink)</b><br />
<b id="SCI_GETADDITIONALCARETSBLINK">SCI_GETADDITIONALCARETSBLINK</b><br />
- Modify the appearence of additional carets so that they can be differentiated from the main caret which has its appearence set with
+ Modify the appearance of additional carets so that they can be differentiated from the main caret which has its appearance set with
<a class="message" href="#SCI_SETCARETFORE"><code>SCI_SETCARETFORE</code></a>,
<a class="message" href="#SCI_GETCARETFORE"><code>SCI_GETCARETFORE</code></a>,
<a class="message" href="#SCI_SETCARETPERIOD"><code>SCI_SETCARETPERIOD</code></a>, and
@@ -2203,7 +2237,7 @@ struct Sci_TextToFind {
<p><b id="SCI_SETMOUSEDOWNCAPTURES">SCI_SETMOUSEDOWNCAPTURES(bool captures)</b><br />
<b id="SCI_GETMOUSEDOWNCAPTURES">SCI_GETMOUSEDOWNCAPTURES</b><br />
When the mouse is pressed inside Scintilla, it is captured so future mouse movement events are
- sent to Scintilla. This behavior may be turned off with
+ sent to Scintilla. This behaviour may be turned off with
<code>SCI_SETMOUSEDOWNCAPTURES(0)</code>.</p>
<h2 id="LineEndings">Line endings</h2>
@@ -2657,7 +2691,7 @@ struct Sci_TextToFind {
<p>The selection is shown by changing the foreground and/or background colours. If one of these
is not set then that attribute is not changed for the selection. The default is to show the
- selection by changing the background to light gray and leaving the foreground the same as when
+ selection by changing the background to light grey and leaving the foreground the same as when
it was not selected. When there is no selection, the current insertion point is marked by the
text caret. This is a vertical line that is normally blinking on and off to attract the users
attention.</p>
@@ -2691,8 +2725,6 @@ struct Sci_TextToFind {
<a class="message" href="#SCI_GETHOTSPOTACTIVEUNDERLINE">SCI_GETHOTSPOTACTIVEUNDERLINE</a><br />
<a class="message" href="#SCI_SETHOTSPOTSINGLELINE">SCI_SETHOTSPOTSINGLELINE(bool singleLine)</a><br />
<a class="message" href="#SCI_GETHOTSPOTSINGLELINE">SCI_GETHOTSPOTSINGLELINE</a><br />
- <a class="message" href="#SCI_SETCONTROLCHARSYMBOL">SCI_SETCONTROLCHARSYMBOL(int symbol)</a><br />
- <a class="message" href="#SCI_GETCONTROLCHARSYMBOL">SCI_GETCONTROLCHARSYMBOL</a><br />
<a class="message" href="#SCI_SETCARETSTICKY">SCI_SETCARETSTICKY(int useCaretStickyBehaviour)</a><br />
<a class="message" href="#SCI_GETCARETSTICKY">SCI_GETCARETSTICKY</a><br />
<a class="message" href="#SCI_TOGGLECARETSTICKY">SCI_TOGGLECARETSTICKY</a><br />
@@ -2771,7 +2803,7 @@ struct Sci_TextToFind {
The width of the line caret can be set with <code>SCI_SETCARETWIDTH</code> to a value of
0, 1, 2 or 3 pixels. The default width is 1 pixel. You can read back the current width with
<code>SCI_GETCARETWIDTH</code>. A width of 0 makes the caret invisible (added at version
- 1.50), similar to setting the caret style to CARETSTYLE_INVISIBLE (though not interchangable).
+ 1.50), similar to setting the caret style to CARETSTYLE_INVISIBLE (though not interchangeable).
This setting only affects the width of the cursor when the cursor style is set to line caret
mode, it does not affect the width for a block caret.</p>
@@ -2789,21 +2821,6 @@ struct Sci_TextToFind {
the default colouring can be modified and an underline drawn with these settings.
Single line mode stops a hotspot from wrapping onto next line.</p>
- <p><b id="SCI_SETCONTROLCHARSYMBOL">SCI_SETCONTROLCHARSYMBOL(int symbol)</b><br />
- <b id="SCI_GETCONTROLCHARSYMBOL">SCI_GETCONTROLCHARSYMBOL</b><br />
- By default, Scintilla displays control characters (characters with codes less than 32) in a
- rounded rectangle as ASCII mnemonics: "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
- "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK",
- "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US". These mnemonics come from the
- early days of signaling, though some are still used (LF = Line Feed, BS = Back Space, CR =
- Carriage Return, for example).</p>
-
- <p>You can choose to replace these mnemonics by a nominated symbol with an ASCII code in the
- range 32 to 255. If you set a symbol value less than 32, all control characters are displayed
- as mnemonics. The symbol you set is rendered in the font of the style set for the character.
- You can read back the current symbol with the <code>SCI_GETCONTROLCHARSYMBOL</code> message.
- The default symbol value is 0.</p>
-
<p><b id="SCI_SETCARETSTICKY">SCI_SETCARETSTICKY(int useCaretStickyBehaviour)</b><br />
<b id="SCI_GETCARETSTICKY">SCI_GETCARETSTICKY</b><br />
<b id="SCI_TOGGLECARETSTICKY">SCI_TOGGLECARETSTICKY</b><br />
@@ -2819,11 +2836,66 @@ struct Sci_TextToFind {
<p>When set to <code>SC_CARETSTICKY_WHITESPACE</code> (2), the caret acts like mode 0 (sticky off) except under one
special case; when space or tab characters are inserted. (Including pasting <b>only space/tabs</b> -- undo, redo,
- etc. do not exhibit this behavior..).</p>
+ etc. do not exhibit this behaviour..).</p>
<p><code>SCI_TOGGLECARETSTICKY</code> switches from <code>SC_CARETSTICKY_ON</code> and <code>SC_CARETSTICKY_WHITESPACE</code>
to <code>SC_CARETSTICKY_OFF</code> and from <code>SC_CARETSTICKY_OFF</code> to <code>SC_CARETSTICKY_ON</code>.</p>
+ <h2 id="CharacterRepresentations">Character representations</h2>
+
+ <p>Some characters, such as control characters and invalid bytes, do not have a visual glyph or use a glyph that is hard to distinguish.</p>
+
+ <p>Control characters (characters with codes less than 32, or between 128 and 159 in some encodings)
+ are displayed by Scintilla using their mnemonics inverted in a rounded rectangle. These mnemonics come from the
+ early days of signalling, though some are still used (LF = Line Feed, BS = Back Space, CR =
+ Carriage Return, for example).</p>
+
+ <p>For the low 'C0' values: "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
+ "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK",
+ "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US".</p>
+
+ <p>For the high 'C1' values:
+ "PAD", "HOP", "BPH", "NBH", "IND", "NEL", "SSA", "ESA",
+ "HTS", "HTJ", "VTS", "PLD", "PLU", "RI", "SS2", "SS3",
+ "DCS", "PU1", "PU2", "STS", "CCH", "MW", "SPA", "EPA",
+ "SOS", "SGCI", "SCI", "CSI", "ST", "OSC", "PM", "APC".</p>
+
+ <p>Invalid bytes are shown in a similar way with an 'x' followed by their value in hexadecimal, like "xFE".</p>
+
+ <code>
+ <a class="message" href="#SCI_SETREPRESENTATION">SCI_SETREPRESENTATION(const char *encodedCharacter, const char *representation)</a><br />
+ <a class="message" href="#SCI_GETREPRESENTATION">SCI_GETREPRESENTATION(const char *encodedCharacter, char *representation)</a><br />
+ <a class="message" href="#SCI_CLEARREPRESENTATION">SCI_CLEARREPRESENTATION(const char *encodedCharacter)</a><br />
+ <a class="message" href="#SCI_SETCONTROLCHARSYMBOL">SCI_SETCONTROLCHARSYMBOL(int symbol)</a><br />
+ <a class="message" href="#SCI_GETCONTROLCHARSYMBOL">SCI_GETCONTROLCHARSYMBOL</a><br />
+ </code>
+
+ <p><b id="SCI_SETREPRESENTATION">SCI_SETREPRESENTATION(const char *encodedCharacter, const char *representation)</b><br />
+ <b id="SCI_GETREPRESENTATION">SCI_GETREPRESENTATION(const char *encodedCharacter, char *representation)</b><br />
+ <b id="SCI_CLEARREPRESENTATION">SCI_CLEARREPRESENTATION(const char *encodedCharacter)</b><br />
+
+ <p>Any character, including those normally displayed as mnemonics may be represented by a
+ string inverted in a rounded rectangle.</p>
+
+ <p>For example, the Ohm sign &#x2126; U+2126 looks very similar to the Greek Omega character &#x3a9; U+03C9 so,
+ for the UTF-8 encoding, to distinguish the Ohm sign as "U+2126 &#x2126;" this call could be made:
+ <code>SCI_SETREPRESENTATION("\xe2\x84\xa6", "U+2126 \xe2\x84\xa6")</code></p>
+
+ <p>The encodedCharacter parameter is a NUL-terminated string of the bytes for one character in the
+ current encoding. This can not be used to set a representation for multiple-character strings. </p>
+
+ <p>The NUL (0) character is a special case since the encodedCharacter parameter is NUL terminated, the NUL
+ character is specified as an empty string.</p>
+
+ <p><b id="SCI_SETCONTROLCHARSYMBOL">SCI_SETCONTROLCHARSYMBOL(int symbol)</b><br />
+ <b id="SCI_GETCONTROLCHARSYMBOL">SCI_GETCONTROLCHARSYMBOL</b><br />
+
+ <p>The mnemonics may be replaced by a nominated symbol with an ASCII code in the
+ range 32 to 255. If you set a symbol value less than 32, all control characters are displayed
+ as mnemonics. The symbol you set is rendered in the font of the style set for the character.
+ You can read back the current symbol with the <code>SCI_GETCONTROLCHARSYMBOL</code> message.
+ The default symbol value is 0.</p>
+
<h2 id="Margins">Margins</h2>
<p>There may be up to five margins, numbered 0 to <code>SC_MAX_MARGIN</code> (4)
@@ -2992,7 +3064,7 @@ struct Sci_TextToFind {
<b id="SCI_MARGINGETSTYLEOFFSET">SCI_MARGINGETSTYLEOFFSET</b><br />
Margin styles may be completely separated from standard text styles by setting a style offset. For example,
<code>SCI_MARGINSETSTYLEOFFSET(256)</code> would allow the margin styles to be numbered from
- 256 upto 511 so they do not overlap styles set by lexers. Each style number set with <code>SCI_MARGINSETSTYLE</code>
+ 256 up to 511 so they do not overlap styles set by lexers. Each style number set with <code>SCI_MARGINSETSTYLE</code>
or <code>SCI_MARGINSETSTYLES</code> has the offset added before looking up the style.
</p>
<p>
@@ -3104,7 +3176,7 @@ struct Sci_TextToFind {
<b id="SCI_ANNOTATIONGETSTYLEOFFSET">SCI_ANNOTATIONGETSTYLEOFFSET</b><br />
Annotation styles may be completely separated from standard text styles by setting a style offset. For example,
<code>SCI_ANNOTATIONSETSTYLEOFFSET(512)</code> would allow the annotation styles to be numbered from
- 512 upto 767 so they do not overlap styles set by lexers (or margins if margins offset is 256).
+ 512 up to 767 so they do not overlap styles set by lexers (or margins if margins offset is 256).
Each style number set with <code>SCI_ANNOTATIONSETSTYLE</code>
or <code>SCI_ANNOTATIONSETSTYLES</code> has the offset added before looking up the style.
</p>
@@ -3654,7 +3726,7 @@ struct Sci_TextToFind {
The width and height must previously been set with the <code>SCI_RGBAIMAGESETWIDTH</code> and
<code>SCI_RGBAIMAGESETHEIGHT</code> messages.</p>
<p>A scale factor in percent may be set with <code>SCI_RGBAIMAGESETSCALE</code>. This is useful on OS X with
- a retina display where each display unit is 2 pixels: use a factor of 200 so that each image pixel is dsplayed using a screen pixel.
+ a retina display where each display unit is 2 pixels: use a factor of 200 so that each image pixel is displayed using a screen pixel.
The default scale, 100, will stretch each image pixel to cover 4 screen pixels on a retina display.</p>
<p>Pixmaps use the <code>SC_MARK_RGBAIMAGE</code> marker symbol. </p>
@@ -3925,7 +3997,7 @@ struct Sci_TextToFind {
<td>A version of <code>INDIC_SQUIGGLE</code> that draws using a pixmap instead of
as a series of line segments for performance.
Measured to be between 3 and 6 times faster than <code>INDIC_SQUIGGLE</code> on GTK+.
- Apperance will not be as good as <code>INDIC_SQUIGGLE</code> on OS X in HiDPI mode.</td>
+ Appearance will not be as good as <code>INDIC_SQUIGGLE</code> on OS X in HiDPI mode.</td>
</tr>
<tr>
@@ -4208,7 +4280,7 @@ struct Sci_TextToFind {
<p><b id="SCI_AUTOCSETCANCELATSTART">SCI_AUTOCSETCANCELATSTART(bool cancel)</b><br />
<b id="SCI_AUTOCGETCANCELATSTART">SCI_AUTOCGETCANCELATSTART</b><br />
- The default behavior is for the list to be cancelled if the caret moves to the location it
+ The default behaviour is for the list to be cancelled if the caret moves to the location it
was at when the list was displayed. By calling this message with a <code>false</code> argument,
the list is not cancelled until the caret moves at least one character before the word being
completed.</p>
@@ -4406,7 +4478,7 @@ struct Sci_TextToFind {
number of characters to highlight. Highlights can extend over line ends if this is
required.</p>
- <p>Unhighlighted text is drawn in a mid gray. Selected text is drawn in a dark blue. The
+ <p>Unhighlighted text is drawn in a mid grey. Selected text is drawn in a dark blue. The
background is white. These can be changed with
<code>SCI_CALLTIPSETBACK</code>,
<code>SCI_CALLTIPSETFORE</code>, and
@@ -4416,11 +4488,11 @@ struct Sci_TextToFind {
<p><b id="SCI_CALLTIPSETBACK">SCI_CALLTIPSETBACK(int colour)</b><br />
The background colour of call tips can be set with this message; the default colour is white.
It is not a good idea to set a dark colour as the background as the default colour for normal
- calltip text is mid gray and the defaultcolour for highlighted text is dark blue. This also
+ calltip text is mid grey and the default colour for highlighted text is dark blue. This also
sets the background colour of <code>STYLE_CALLTIP</code>.</p>
<p><b id="SCI_CALLTIPSETFORE">SCI_CALLTIPSETFORE(int colour)</b><br />
- The colour of call tip text can be set with this message; the default colour is mid gray.
+ The colour of call tip text can be set with this message; the default colour is mid grey.
This also sets the foreground colour of <code>STYLE_CALLTIP</code>.</p>
<p><b id="SCI_CALLTIPSETFOREHLT">SCI_CALLTIPSETFOREHLT(int colour)</b><br />
@@ -5405,7 +5477,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
that is adequate for many applications. The <code>automaticFold</code> argument is a bit set defining
which of the 3 pieces of folding implementation should be enabled. Most applications should be able to use the
<code>SC_AUTOMATICFOLD_SHOW</code> and <code>SC_AUTOMATICFOLD_CHANGE</code>
- flags unless they wish to implement quite different behavious such as defining their own fold structure.
+ flags unless they wish to implement quite different behaviour such as defining their own fold structure.
<code>SC_AUTOMATICFOLD_CLICK</code> is more likely to be set off when an application would
like to add or change click behaviour such as showing method headers only when Shift+Alt is used in
conjunction with a click.
@@ -5502,7 +5574,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
line.</p>
<p>Wrapping is not performed immediately there is a change but is delayed until the display
- is redrawn. This delay improves peformance by allowing a set of changes to be performed
+ is redrawn. This delay improves performance by allowing a set of changes to be performed
and then wrapped and displayed once. Because of this, some operations may not occur as
expected. If a file is read and the scroll position moved to a particular line in the text,
such as occurs when a container tries to restore a previous editing session, then
@@ -5942,7 +6014,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
<p>Applications may discover the set of properties used by searching the source code of lexers for lines that contain
<code>GetProperty</code> and a double quoted string and extract the value of the double quoted string as the property name.
- The <code>scintilla/src/LexGen.py</code> script does this and can be used as an example.
+ The <code>scintilla/scripts/LexGen.py</code> script does this and can be used as an example.
Documentation for the property may be located above the call as a multi-line comment starting with
<br/><code>// property &lt;property-name&gt;</code></p>
@@ -6454,7 +6526,7 @@ struct SCNotification {
When an application creates multiple Scintilla widgets, this allows the source of each notification to be found.
On Windows, this value is initialised in the <code>CreateWindow</code> call and stored as the
<code>GWLP_ID</code> attribute of the window.
- The value should be small, preferrably less than 16 bits,
+ The value should be small, preferably less than 16 bits,
rather than a pointer as some of the functions will only transmit 16 or 32 bits.
</p>
@@ -6884,7 +6956,7 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE</a>(lineNumber);
<p><b id="SCEN_CHANGE">SCEN_CHANGE</b><br />
<code>SCEN_CHANGE</code> (768) is fired when the text (not the style) of the document changes.
This notification is sent using the <code>WM_COMMAND</code> message on Windows and the
- "Command" signal on GTK+ as this is the behavior of the standard Edit control
+ "Command" signal on GTK+ as this is the behaviour of the standard Edit control
(<code>SCEN_CHANGE</code> has the same value as the Windows Edit control
<code>EN_CHANGE</code>). No other information is sent. If you need more detailed information
use <a class="message" href="#SCN_MODIFIED"><code>SCN_MODIFIED</code></a>. You can filter the
@@ -6914,7 +6986,7 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE</a>(lineNumber);
<code>SCEN_SETFOCUS</code> (512) is fired when Scintilla receives focus and
<code>SCEN_KILLFOCUS</code> (256) when it loses focus. These notifications are sent using the
<code>WM_COMMAND</code> message on Windows and the "Command" signal on GTK+ as this is the
- behavior of the standard Edit control. Unfortunately, these codes do not match the Windows Edit
+ behaviour of the standard Edit control. Unfortunately, these codes do not match the Windows Edit
notification codes <code>EN_SETFOCUS</code> (256) and <code>EN_KILLFOCUS</code> (512). It is
now too late to change the Scintilla codes as clients depend on the current values.</p>
@@ -7385,10 +7457,10 @@ EM_SETTARGETDEVICE
<h3>Changing set of lexers</h3>
<p>To change the set of lexers in Scintilla, add and remove lexer source files
- (<code>Lex*.cxx</code>) from the <code>scintilla/src directory</code> and run the
- <code>src/LexGen.py</code> script from the <code>src</code> directory to update the make files
- and <code>KeyWords.cxx</code>. <code>LexGen.py</code> requires Python 2.1 or later. If you do
- not have access to Python, you can hand edit <code>KeyWords.cxx</code> in a simple-minded way,
+ (<code>Lex*.cxx</code>) from the <code>scintilla/lexers directory</code> and run the
+ <code>scripts/LexGen.py</code> script from the <code>scripts</code> directory to update the make files
+ and <code>Catalogue.cxx</code>. <code>LexGen.py</code> requires Python 2.5 or later. If you do
+ not have access to Python, you can hand edit <code>Catalogue.cxx</code> in a simple-minded way,
following the patterns of other lexers. The important thing is to include
<code>LINK_LEXER(lmMyLexer);</code> to correspond with the <code>LexerModule
lmMyLexer(...);</code> in your lexer source code.</p>
diff --git a/scintilla/doc/ScintillaDownload.html b/scintilla/doc/ScintillaDownload.html
index 17e30fb..6e5092d 100644
--- a/scintilla/doc/ScintillaDownload.html
+++ b/scintilla/doc/ScintillaDownload.html
@@ -25,9 +25,9 @@
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
<tr>
<td>
- <font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scintilla334.zip?download">
+ <font size="4"> <a href="http://prdownloads.sourceforge.net/scintilla/scintilla335.zip?download">
Windows</a>&nbsp;&nbsp;
- <a href="http://prdownloads.sourceforge.net/scintilla/scintilla334.tgz?download">
+ <a href="http://prdownloads.sourceforge.net/scintilla/scintilla335.tgz?download">
GTK+/Linux</a>&nbsp;&nbsp;
</font>
</td>
@@ -41,7 +41,7 @@
containing very few restrictions.
</p>
<h3>
- Release 3.3.4
+ Release 3.3.5
</h3>
<h4>
Source Code
@@ -49,8 +49,8 @@
The source code package contains all of the source code for Scintilla but no binary
executable code and is available in
<ul>
- <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla334.zip?download">zip format</a> (1250K) commonly used on Windows</li>
- <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla334.tgz?download">tgz format</a> (1100K) commonly used on Linux and compatible operating systems</li>
+ <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla335.zip?download">zip format</a> (1250K) commonly used on Windows</li>
+ <li><a href="http://prdownloads.sourceforge.net/scintilla/scintilla335.tgz?download">tgz format</a> (1100K) commonly used on Linux and compatible operating systems</li>
</ul>
Instructions for building on both Windows and Linux are included in the readme file.
<h4>
diff --git a/scintilla/doc/ScintillaHistory.html b/scintilla/doc/ScintillaHistory.html
index c7911bf..b78dd43 100644
--- a/scintilla/doc/ScintillaHistory.html
+++ b/scintilla/doc/ScintillaHistory.html
@@ -427,6 +427,9 @@
<td>Yosef Or Boczko</td>
</tr><tr>
<td>Brian Griffin</td>
+ <td>Özgür Emir</td>
+ <td>Neomi</td>
+ <td>OmegaPhil</td>
</tr>
</table>
<p>
@@ -439,6 +442,94 @@
</li>
</ul>
<h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite335.zip?download">Release 3.3.5</a>
+ </h3>
+ <ul>
+ <li>
+ Released 31 August 2013.
+ </li>
+ <li>
+ Characters may be represented by strings.
+ In Unicode mode C1 control characters are represented by their mnemonics.
+ </li>
+ <li>
+ Added SCI_POSITIONRELATIVE to optimize navigation by character.
+ </li>
+ <li>
+ Option to allow mouse selection to switch to rectangular by pressing Alt after start of gesture.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1007/">Feature #1007.</a>
+ </li>
+ <li>
+ Lexer added for KVIrc script.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1008/">Feature #1008.</a>
+ </li>
+ <li>
+ Bash lexer fixed quoted HereDoc delimiters.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1500/">Bug #1500</a>.
+ </li>
+ <li>
+ MS SQL lexer fixed ';' to appear as an operator.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1509/">Bug #1509</a>.
+ </li>
+ <li>
+ Structured Text lexer fixed styling of enumeration members.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1508/">Bug #1508</a>.
+ </li>
+ <li>
+ Fixed bug with horizontal caret position when margin changed.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1512/">Bug #1512</a>.
+ </li>
+ <li>
+ Fixed bug on Cocoa where coordinates were relative to text subview instead of whole view.
+ </li>
+ <li>
+ Ensure selection redrawn correctly in two cases.
+ When switching from stream to rectangular selection with Alt+Shift+Up.
+ When reducing the range of an additional selection by moving mouse up.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1007/">Feature #1007.</a>
+ </li>
+ <li>
+ Copy and paste of rectangular selections compatible with Borland Delphi IDE on Windows.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1002/">Feature #1002.</a>
+ <a href="http://sourceforge.net/p/scintilla/bugs/1513/">Bug #1513</a>.
+ </li>
+ <li>
+ Initialize extended styles to the default style.
+ </li>
+ <li>
+ On Windows, fix painting on an explicit HDC when first paint attempt abandoned.
+ </li>
+ <li>
+ Qt bindings in ScintillaEdit made to work on 64-bit Unix systems.
+ </li>
+ <li>
+ Easier access to printing on Qt with formatRange method.
+ </li>
+ <li>
+ Fixed SciTE failure to save initial buffer in single buffer mode.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1339/">Bug #1339</a>.
+ </li>
+ <li>
+ Fixed compilation problem with Visual C++ in non-English locales.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1506/">Bug #1506</a>.
+ </li>
+ <li>
+ Disable Direct2D when compiling with MinGW gcc on Windows because of changes in the recent MinGW release.
+ </li>
+ <li>
+ SciTE crash fixed for negative line.margin.width.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1504/">Bug #1504</a>.
+ </li>
+ <li>
+ SciTE fix for infinite dialog boxes when failing to automatically save a file.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1503/">Bug #1503</a>.
+ </li>
+ <li>
+ SciTE settings buffered.draw, two.phase.draw, and technology are applied to the
+ output pane as well as the edit pane.
+ </li>
+ </ul>
+ <h3>
<a href="http://prdownloads.sourceforge.net/scintilla/scite334.zip?download">Release 3.3.4</a>
</h3>
<ul>
@@ -475,7 +566,7 @@
</li>
<li>
CoffeeScript lexer fixes a bug with comment blocks.
- <a href="http://sourceforge.net/p/scintilla/feature-requests/1495/">Feature #1495.</a>
+ <a href="http://sourceforge.net/p/scintilla/bugs/1495/">Bug #1495</a>
</li>
<li>
ECL lexer regular expression code fixed.
@@ -980,7 +1071,7 @@
On Cocoa, remove incorrect setting of save point when reading information through 'string' and 'selectedString'.
</li>
<li>
- On Cocoa, fix incorrect memory managment of infoBar.
+ On Cocoa, fix incorrect memory management of infoBar.
</li>
<li>
On GTK+ 3 Ubuntu, fix crash when drawing margin.
@@ -1263,7 +1354,7 @@
UTF-8 validity is checked more stringently and consistently. All 66 non-characters are now treated as invalid.
</li>
<li>
- HTML lexer bug fixed with inconsistant highlighting for PHP when attribute on separate line from tag.
+ HTML lexer bug fixed with inconsistent highlighting for PHP when attribute on separate line from tag.
<a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3520027&group_id=2439">Bug #3520027.</a>
</li>
<li>
@@ -3523,7 +3614,7 @@
SciTE retains selection range when performing a replace selection command. <a href="https://sourceforge.net/tracker/?func=detail&atid=352439&aid=2339160&group_id=2439">Feature #2339160.</a>
</li>
<li>
- SciTE definition of word characters fixed to match documentaiton. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2464531&group_id=2439">Bug #2464531.</a>
+ SciTE definition of word characters fixed to match documentation. <a href="https://sourceforge.net/tracker/?func=detail&atid=102439&aid=2464531&group_id=2439">Bug #2464531.</a>
</li>
<li>
SciTE on GTK+ performing Search or Replace when dialog already shown now brings dialog to foreground.
@@ -7276,7 +7367,7 @@
</li>
<li>
Experimental line wrapping.
- Currently has performance and appearence problems.
+ Currently has performance and appearance problems.
</li>
</ul>
<h3>
@@ -9260,4 +9351,3 @@
</h3>
</body>
</html>
-
diff --git a/scintilla/doc/index.html b/scintilla/doc/index.html
index 357fc48..c0fd0d3 100644
--- a/scintilla/doc/index.html
+++ b/scintilla/doc/index.html
@@ -9,7 +9,7 @@
<meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
<meta name="Description"
content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
- <meta name="Date.Modified" content="20130719" />
+ <meta name="Date.Modified" content="20130831" />
<style type="text/css">
#versionlist {
margin: 0;
@@ -55,8 +55,8 @@
GTK+, and OS X</font>
</td>
<td width="40%" align="right">
- <font color="#FFCC99" size="3"> Release version 3.3.4<br />
- Site last modified July 19 2013</font>
+ <font color="#FFCC99" size="3"> Release version 3.3.5<br />
+ Site last modified August 31 2013</font>
</td>
<td width="20%">
&nbsp;
@@ -71,14 +71,11 @@
</tr>
</table>
<ul id="versionlist">
+ <li>Version 3.3.5 can represent characters with strings. This may be used for modes
+ which show invisible characters or differentiate characters that appear similar.</li>
<li>Version 3.3.4 better supports Unicode use in lexers.</li>
<li>Version 3.3.3 fixes bugs on GTK+.</li>
<li>Version 3.3.2 simplifies implementing folding.</li>
- <li>Version 3.3.1 fixes bugs on Cocoa.</li>
- <li>Version 3.3.0 should not be used on Cocoa since it contains bugs fixed in 3.3.1.
- It implements overlay scrollers and kinetic scrolling on Cocoa.
- Performance improved on GTK+ and Cocoa by performing more work in
- high-priority idle tasks.</li>
</ul>
<ul id="menu">
<li id="remote1"><a href="http://www.scintilla.org/SciTEImage.html">Screenshot</a></li>
diff --git a/scintilla/include/SciLexer.h b/scintilla/include/SciLexer.h
index f94f213..4028200 100644
--- a/scintilla/include/SciLexer.h
+++ b/scintilla/include/SciLexer.h
@@ -122,6 +122,7 @@
#define SCLEX_VISUALPROLOG 107
#define SCLEX_LITERATEHASKELL 108
#define SCLEX_STTXT 109
+#define SCLEX_KVIRC 110
#define SCLEX_AHK 200
#define SCLEX_AUTOMATIC 1000
#define SCE_P_DEFAULT 0
@@ -1669,6 +1670,19 @@
#define SCE_STTXT_DATETIME 16
#define SCE_STTXT_VARS 17
#define SCE_STTXT_PRAGMAS 18
+#define SCE_KVIRC_DEFAULT 0
+#define SCE_KVIRC_COMMENT 1
+#define SCE_KVIRC_COMMENTBLOCK 2
+#define SCE_KVIRC_STRING 3
+#define SCE_KVIRC_WORD 4
+#define SCE_KVIRC_KEYWORD 5
+#define SCE_KVIRC_FUNCTION_KEYWORD 6
+#define SCE_KVIRC_FUNCTION 7
+#define SCE_KVIRC_VARIABLE 8
+#define SCE_KVIRC_NUMBER 9
+#define SCE_KVIRC_OPERATOR 10
+#define SCE_KVIRC_STRING_FUNCTION 11
+#define SCE_KVIRC_STRING_VARIABLE 12
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
#endif
diff --git a/scintilla/include/Scintilla.h b/scintilla/include/Scintilla.h
index 15092bb..2d81d71 100644
--- a/scintilla/include/Scintilla.h
+++ b/scintilla/include/Scintilla.h
@@ -673,6 +673,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_PARAUPEXTEND 2416
#define SCI_POSITIONBEFORE 2417
#define SCI_POSITIONAFTER 2418
+#define SCI_POSITIONRELATIVE 2670
#define SCI_COPYRANGE 2419
#define SCI_COPYTEXT 2420
#define SC_SEL_STREAM 0
@@ -801,6 +802,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_ADDUNDOACTION 2560
#define SCI_CHARPOSITIONFROMPOINT 2561
#define SCI_CHARPOSITIONFROMPOINTCLOSE 2562
+#define SCI_SETMOUSESELECTIONRECTANGULARSWITCH 2668
+#define SCI_GETMOUSESELECTIONRECTANGULARSWITCH 2669
#define SCI_SETMULTIPLESELECTION 2563
#define SCI_GETMULTIPLESELECTION 2564
#define SCI_SETADDITIONALSELECTIONTYPING 2565
@@ -877,6 +880,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_VCHOMEDISPLAYEXTEND 2653
#define SCI_GETCARETLINEVISIBLEALWAYS 2654
#define SCI_SETCARETLINEVISIBLEALWAYS 2655
+#define SCI_SETREPRESENTATION 2665
+#define SCI_GETREPRESENTATION 2666
+#define SCI_CLEARREPRESENTATION 2667
#define SCI_STARTRECORD 3001
#define SCI_STOPRECORD 3002
#define SCI_SETLEXER 4001
diff --git a/scintilla/include/Scintilla.iface b/scintilla/include/Scintilla.iface
index 01f9a7b..12d3384 100644
--- a/scintilla/include/Scintilla.iface
+++ b/scintilla/include/Scintilla.iface
@@ -1756,6 +1756,10 @@ fun position PositionBefore=2417(position pos,)
# page into account. Maximum value returned is the last position in the document.
fun position PositionAfter=2418(position pos,)
+# Given a valid document position, return a position that differs in a number
+# of characters. Returned value is always between 0 and last position in document.
+fun position PositionRelative=2670(position pos, int relative)
+
# Copy a range of text to the clipboard. Positions are clipped into the document.
fun void CopyRange=2419(position start, position end)
@@ -2127,6 +2131,12 @@ fun position CharPositionFromPoint=2561(int x, int y)
# Return INVALID_POSITION if not close to text.
fun position CharPositionFromPointClose=2562(int x, int y)
+# Set whether switching to rectangular mode while selecting with the mouse is allowed.
+set void SetMouseSelectionRectangularSwitch=2668(bool mouseSelectionRectangularSwitch,)
+
+# Whether switching to rectangular mode while selecting with the mouse is allowed.
+get bool GetMouseSelectionRectangularSwitch=2669(,)
+
# Set whether multiple selections can be made
set void SetMultipleSelection=2563(bool multipleSelection,)
@@ -2326,6 +2336,15 @@ get bool GetCaretLineVisibleAlways=2654(,)
# Sets the caret line to always visible.
set void SetCaretLineVisibleAlways=2655(bool alwaysVisible,)
+# Set the way a character is drawn.
+set void SetRepresentation=2665(string encodedCharacter, string representation)
+
+# Set the way a character is drawn.
+get int GetRepresentation=2666(string encodedCharacter, stringresult representation)
+
+# Remove a character representation.
+fun void ClearRepresentation=2667(string encodedCharacter,)
+
# Start notifying the container of all key presses and commands.
fun void StartRecord=3001(,)
@@ -2580,6 +2599,7 @@ val SCLEX_OSCRIPT=106
val SCLEX_VISUALPROLOG=107
val SCLEX_LITERATEHASKELL=108
val SCLEX_STTXT=109
+val SCLEX_KVIRC=110
## notepad2 custom code for the AHK lexer - start
val SCLEX_AHK=200
## notepad2 custom code for the AHK lexer - end
@@ -4333,6 +4353,21 @@ val SCE_STTXT_IDENTIFIER=15
val SCE_STTXT_DATETIME=16
val SCE_STTXT_VARS=17
val SCE_STTXT_PRAGMAS=18
+# Lexical states for SCLEX_KVIRC
+lex KVIrc=SCLEX_KVIRC SCLEX_KVIRC_
+val SCE_KVIRC_DEFAULT=0
+val SCE_KVIRC_COMMENT=1
+val SCE_KVIRC_COMMENTBLOCK=2
+val SCE_KVIRC_STRING=3
+val SCE_KVIRC_WORD=4
+val SCE_KVIRC_KEYWORD=5
+val SCE_KVIRC_FUNCTION_KEYWORD=6
+val SCE_KVIRC_FUNCTION=7
+val SCE_KVIRC_VARIABLE=8
+val SCE_KVIRC_NUMBER=9
+val SCE_KVIRC_OPERATOR=10
+val SCE_KVIRC_STRING_FUNCTION=11
+val SCE_KVIRC_STRING_VARIABLE=12
# Events
diff --git a/scintilla/lexers/LexAU3.cxx b/scintilla/lexers/LexAU3.cxx
index d09c52f..456eab2 100644
--- a/scintilla/lexers/LexAU3.cxx
+++ b/scintilla/lexers/LexAU3.cxx
@@ -87,7 +87,7 @@ static inline bool IsAWordStart(const int ch)
}
static inline bool IsAOperator(char ch) {
- if (isascii(ch) && isalnum(ch))
+ if (IsASCII(ch) && isalnum(ch))
return false;
if (ch == '+' || ch == '-' || ch == '*' || ch == '/' ||
ch == '&' || ch == '^' || ch == '=' || ch == '<' || ch == '>' ||
@@ -228,7 +228,7 @@ static void ColouriseAU3Doc(unsigned int startPos,
char si; // string indicator "=1 '=2
char ni; // Numeric indicator error=9 normal=0 normal+dec=1 hex=2 Enot=3
char ci; // comment indicator 0=not linecomment(;)
- char s_save[100];
+ char s_save[100] = "";
si=0;
ni=0;
ci=0;
diff --git a/scintilla/lexers/LexAVE.cxx b/scintilla/lexers/LexAVE.cxx
index e7d2605..774c19a 100644
--- a/scintilla/lexers/LexAVE.cxx
+++ b/scintilla/lexers/LexAVE.cxx
@@ -45,7 +45,7 @@ inline bool IsAWordStart(const int ch) {
}
inline bool isAveOperator(char ch) {
- if (isascii(ch) && isalnum(ch))
+ if (IsASCII(ch) && isalnum(ch))
return false;
// '.' left out as it is used to make up numbers
if (ch == '*' || ch == '/' || ch == '-' || ch == '+' ||
@@ -167,7 +167,7 @@ static void FoldAveDoc(unsigned int startPos, int length, int /* initStyle */, W
char chNext = static_cast<char>(tolower(styler[startPos]));
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
int styleNext = styler.StyleAt(startPos);
- char s[10];
+ char s[10] = "";
for (unsigned int i = startPos; i < lengthDoc; i++) {
char ch = static_cast<char>(tolower(chNext));
diff --git a/scintilla/lexers/LexAda.cxx b/scintilla/lexers/LexAda.cxx
index 67e89af..13aba46 100644
--- a/scintilla/lexers/LexAda.cxx
+++ b/scintilla/lexers/LexAda.cxx
@@ -511,5 +511,5 @@ static inline bool IsWordCharacter(int ch) {
}
static inline bool IsWordStartCharacter(int ch) {
- return (isascii(ch) && isalpha(ch)) || ch == '_';
+ return (IsASCII(ch) && isalpha(ch)) || ch == '_';
}
diff --git a/scintilla/lexers/LexAsm.cxx b/scintilla/lexers/LexAsm.cxx
index 2446297..7745e11 100644
--- a/scintilla/lexers/LexAsm.cxx
+++ b/scintilla/lexers/LexAsm.cxx
@@ -344,7 +344,7 @@ void SCI_METHOD LexerAsm::Lex(unsigned int startPos, int length, int initStyle,
if (sc.state == SCE_ASM_DEFAULT) {
if (sc.ch == ';'){
sc.SetState(SCE_ASM_COMMENT);
- } else if (isascii(sc.ch) && (isdigit(sc.ch) || (sc.ch == '.' && isascii(sc.chNext) && isdigit(sc.chNext)))) {
+ } else if (IsASCII(sc.ch) && (isdigit(sc.ch) || (sc.ch == '.' && IsASCII(sc.chNext) && isdigit(sc.chNext)))) {
sc.SetState(SCE_ASM_NUMBER);
} else if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_ASM_IDENTIFIER);
diff --git a/scintilla/lexers/LexBash.cxx b/scintilla/lexers/LexBash.cxx
index 573d38e..60e5736 100644
--- a/scintilla/lexers/LexBash.cxx
+++ b/scintilla/lexers/LexBash.cxx
@@ -437,12 +437,22 @@ static void ColouriseBashDoc(unsigned int startPos, int length, int initStyle,
HereDoc.State = 1;
}
} else if (HereDoc.State == 1) { // collect the delimiter
- if (setHereDoc2.Contains(sc.ch) || sc.chPrev == '\\') {
+ // * if single quoted, there's no escape
+ // * if double quoted, there are \\ and \" escapes
+ if ((HereDoc.Quote == '\'' && sc.ch != HereDoc.Quote) ||
+ (HereDoc.Quoted && sc.ch != HereDoc.Quote && sc.ch != '\\') ||
+ (HereDoc.Quote != '\'' && sc.chPrev == '\\') ||
+ (setHereDoc2.Contains(sc.ch))) {
HereDoc.Append(sc.ch);
} else if (HereDoc.Quoted && sc.ch == HereDoc.Quote) { // closing quote => end of delimiter
sc.ForwardSetState(SCE_SH_DEFAULT);
} else if (sc.ch == '\\') {
- // skip escape prefix
+ if (HereDoc.Quoted && sc.chNext != HereDoc.Quote && sc.chNext != '\\') {
+ // in quoted prefixes only \ and the quote eat the escape
+ HereDoc.Append(sc.ch);
+ } else {
+ // skip escape prefix
+ }
} else if (!HereDoc.Quoted) {
sc.SetState(SCE_SH_DEFAULT);
}
diff --git a/scintilla/lexers/LexBullant.cxx b/scintilla/lexers/LexBullant.cxx
index fabfd8c..47894b8 100644
--- a/scintilla/lexers/LexBullant.cxx
+++ b/scintilla/lexers/LexBullant.cxx
@@ -116,7 +116,7 @@ static void ColouriseBullantDoc(unsigned int startPos, int length, int initStyle
}
blockChange=0;
*/ }
- if (!(isascii(ch) && isspace(ch)))
+ if (!(IsASCII(ch) && isspace(ch)))
visibleChars++;
if (styler.IsLeadByte(ch)) {
diff --git a/scintilla/lexers/LexCOBOL.cxx b/scintilla/lexers/LexCOBOL.cxx
index 4fe0974..61a5dae 100644
--- a/scintilla/lexers/LexCOBOL.cxx
+++ b/scintilla/lexers/LexCOBOL.cxx
@@ -44,13 +44,13 @@ inline bool isCOBOLoperator(char ch)
inline bool isCOBOLwordchar(char ch)
{
- return isascii(ch) && (isalnum(ch) || ch == '-');
+ return IsASCII(ch) && (isalnum(ch) || ch == '-');
}
inline bool isCOBOLwordstart(char ch)
{
- return isascii(ch) && isalnum(ch);
+ return IsASCII(ch) && isalnum(ch);
}
static int CountBits(int nBits)
@@ -90,6 +90,8 @@ static int classifyWordCOBOL(unsigned int start, unsigned int end, /*WordList &k
WordList& c_keywords = *keywordlists[2];
char s[100];
+ s[0] = '\0';
+ s[1] = '\0';
getRange(start, end, styler, s, sizeof(s));
char chAttr = SCE_C_IDENTIFIER;
@@ -205,7 +207,7 @@ static void ColouriseCOBOLDoc(unsigned int startPos, int length, int initStyle,
}
if (state == SCE_C_DEFAULT) {
- if (isCOBOLwordstart(ch) || (ch == '$' && isascii(chNext) && isalpha(chNext))) {
+ if (isCOBOLwordstart(ch) || (ch == '$' && IsASCII(chNext) && isalpha(chNext))) {
ColourTo(styler, i-1, state);
state = SCE_C_IDENTIFIER;
} else if (column == 6 && ch == '*') {
diff --git a/scintilla/lexers/LexConf.cxx b/scintilla/lexers/LexConf.cxx
index f26458b..769557b 100644
--- a/scintilla/lexers/LexConf.cxx
+++ b/scintilla/lexers/LexConf.cxx
@@ -37,7 +37,7 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k
char chNext = styler[startPos];
int lengthDoc = startPos + length;
// create a buffer large enough to take the largest chunk...
- char *buffer = new char[length];
+ char *buffer = new char[length+1];
int bufferCount = 0;
// this assumes that we have 2 keyword list in conf.properties
@@ -74,17 +74,17 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k
} else if( ch == '"') {
state = SCE_CONF_STRING;
styler.ColourTo(i,SCE_CONF_STRING);
- } else if( isascii(ch) && ispunct(ch) ) {
+ } else if( IsASCII(ch) && ispunct(ch) ) {
// signals an operator...
// no state jump necessary for this
// simple case...
styler.ColourTo(i,SCE_CONF_OPERATOR);
- } else if( isascii(ch) && isalpha(ch) ) {
+ } else if( IsASCII(ch) && isalpha(ch) ) {
// signals the start of an identifier
bufferCount = 0;
buffer[bufferCount++] = static_cast<char>(tolower(ch));
state = SCE_CONF_IDENTIFIER;
- } else if( isascii(ch) && isdigit(ch) ) {
+ } else if( IsASCII(ch) && isdigit(ch) ) {
// signals the start of a number
bufferCount = 0;
buffer[bufferCount++] = ch;
@@ -111,7 +111,7 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k
// if we find a non-alphanumeric char,
// we simply go to default state
// else we're still dealing with an extension...
- if( (isascii(ch) && isalnum(ch)) || (ch == '_') ||
+ if( (IsASCII(ch) && isalnum(ch)) || (ch == '_') ||
(ch == '-') || (ch == '$') ||
(ch == '/') || (ch == '.') || (ch == '*') )
{
@@ -133,7 +133,7 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k
case SCE_CONF_IDENTIFIER:
// stay in CONF_IDENTIFIER state until we find a non-alphanumeric
- if( (isascii(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '/') || (ch == '$') || (ch == '.') || (ch == '*')) {
+ if( (IsASCII(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '/') || (ch == '$') || (ch == '.') || (ch == '*')) {
buffer[bufferCount++] = static_cast<char>(tolower(ch));
} else {
state = SCE_CONF_DEFAULT;
@@ -158,7 +158,7 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k
case SCE_CONF_NUMBER:
// stay in CONF_NUMBER state until we find a non-numeric
- if( (isascii(ch) && isdigit(ch)) || ch == '.') {
+ if( (IsASCII(ch) && isdigit(ch)) || ch == '.') {
buffer[bufferCount++] = ch;
} else {
state = SCE_CONF_DEFAULT;
diff --git a/scintilla/lexers/LexCrontab.cxx b/scintilla/lexers/LexCrontab.cxx
index ea74835..3c3db6c 100644
--- a/scintilla/lexers/LexCrontab.cxx
+++ b/scintilla/lexers/LexCrontab.cxx
@@ -36,7 +36,7 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
char chNext = styler[startPos];
int lengthDoc = startPos + length;
// create a buffer large enough to take the largest chunk...
- char *buffer = new char[length];
+ char *buffer = new char[length+1];
int bufferCount = 0;
// used when highliting environment variables inside quoted string:
bool insideString = false;
@@ -98,12 +98,12 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
// signals an asterisk
// no state jump necessary for this simple case...
styler.ColourTo(i,SCE_NNCRONTAB_ASTERISK);
- } else if( (isascii(ch) && isalpha(ch)) || ch == '<' ) {
+ } else if( (IsASCII(ch) && isalpha(ch)) || ch == '<' ) {
// signals the start of an identifier
bufferCount = 0;
buffer[bufferCount++] = ch;
state = SCE_NNCRONTAB_IDENTIFIER;
- } else if( isascii(ch) && isdigit(ch) ) {
+ } else if( IsASCII(ch) && isdigit(ch) ) {
// signals the start of a number
bufferCount = 0;
buffer[bufferCount++] = ch;
@@ -171,7 +171,7 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
case SCE_NNCRONTAB_IDENTIFIER:
// stay in CONF_IDENTIFIER state until we find a non-alphanumeric
- if( (isascii(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '/') ||
+ if( (IsASCII(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '/') ||
(ch == '$') || (ch == '.') || (ch == '<') || (ch == '>') ||
(ch == '@') ) {
buffer[bufferCount++] = ch;
@@ -200,7 +200,7 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
case SCE_NNCRONTAB_NUMBER:
// stay in CONF_NUMBER state until we find a non-numeric
- if( isascii(ch) && isdigit(ch) /* || ch == '.' */ ) {
+ if( IsASCII(ch) && isdigit(ch) /* || ch == '.' */ ) {
buffer[bufferCount++] = ch;
} else {
state = SCE_NNCRONTAB_DEFAULT;
diff --git a/scintilla/lexers/LexCsound.cxx b/scintilla/lexers/LexCsound.cxx
index c31ad93..a3fdf42 100644
--- a/scintilla/lexers/LexCsound.cxx
+++ b/scintilla/lexers/LexCsound.cxx
@@ -39,7 +39,7 @@ static inline bool IsAWordStart(const int ch) {
}
static inline bool IsCsoundOperator(char ch) {
- if (isascii(ch) && isalnum(ch))
+ if (IsASCII(ch) && isalnum(ch))
return false;
// '.' left out as it is used to make up numbers
if (ch == '*' || ch == '/' || ch == '-' || ch == '+' ||
diff --git a/scintilla/lexers/LexD.cxx b/scintilla/lexers/LexD.cxx
index ccb94a6..8113447 100644
--- a/scintilla/lexers/LexD.cxx
+++ b/scintilla/lexers/LexD.cxx
@@ -41,15 +41,15 @@ using namespace Scintilla;
// Underscore, letter, digit and universal alphas from C99 Appendix D.
static bool IsWordStart(int ch) {
- return (isascii(ch) && (isalpha(ch) || ch == '_')) || !isascii(ch);
+ return (IsASCII(ch) && (isalpha(ch) || ch == '_')) || !IsASCII(ch);
}
static bool IsWord(int ch) {
- return (isascii(ch) && (isalnum(ch) || ch == '_')) || !isascii(ch);
+ return (IsASCII(ch) && (isalnum(ch) || ch == '_')) || !IsASCII(ch);
}
static bool IsDoxygen(int ch) {
- if (isascii(ch) && islower(ch))
+ if (IsASCII(ch) && islower(ch))
return true;
if (ch == '$' || ch == '@' || ch == '\\' ||
ch == '&' || ch == '#' || ch == '<' || ch == '>' ||
@@ -267,7 +267,7 @@ void SCI_METHOD LexerD::Lex(unsigned int startPos, int length, int initStyle, ID
break;
case SCE_D_NUMBER:
// We accept almost anything because of hex. and number suffixes
- if (isascii(sc.ch) && (isalnum(sc.ch) || sc.ch == '_')) {
+ if (IsASCII(sc.ch) && (isalnum(sc.ch) || sc.ch == '_')) {
continue;
} else if (sc.ch == '.' && sc.chNext != '.' && !numFloat) {
// Don't parse 0..2 as number.
diff --git a/scintilla/lexers/LexForth.cxx b/scintilla/lexers/LexForth.cxx
index ee95e31..a8349a8 100644
--- a/scintilla/lexers/LexForth.cxx
+++ b/scintilla/lexers/LexForth.cxx
@@ -123,29 +123,29 @@ static void ColouriseForthDoc(unsigned int startPos, int length, int initStyle,
(sc.atLineStart || IsASpaceChar(sc.chPrev)) &&
(sc.atLineEnd || IsASpaceChar(sc.chNext))) {
sc.SetState(SCE_FORTH_COMMENT_ML);
- } else if ( (sc.ch == '$' && (isascii(sc.chNext) && isxdigit(sc.chNext))) ) {
+ } else if ( (sc.ch == '$' && (IsASCII(sc.chNext) && isxdigit(sc.chNext))) ) {
// number starting with $ is a hex number
sc.SetState(SCE_FORTH_NUMBER);
- while(sc.More() && isascii(sc.chNext) && isxdigit(sc.chNext))
+ while(sc.More() && IsASCII(sc.chNext) && isxdigit(sc.chNext))
sc.Forward();
- } else if ( (sc.ch == '%' && (isascii(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))) ) {
+ } else if ( (sc.ch == '%' && (IsASCII(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))) ) {
// number starting with % is binary
sc.SetState(SCE_FORTH_NUMBER);
- while(sc.More() && isascii(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))
+ while(sc.More() && IsASCII(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))
sc.Forward();
- } else if ( isascii(sc.ch) &&
- (isxdigit(sc.ch) || ((sc.ch == '.' || sc.ch == '-') && isascii(sc.chNext) && isxdigit(sc.chNext)) )
+ } else if ( IsASCII(sc.ch) &&
+ (isxdigit(sc.ch) || ((sc.ch == '.' || sc.ch == '-') && IsASCII(sc.chNext) && isxdigit(sc.chNext)) )
){
sc.SetState(SCE_FORTH_NUMBER);
} else if (IsAWordStart(sc.ch)) {
sc.SetState(SCE_FORTH_IDENTIFIER);
} else if (sc.ch == '{') {
sc.SetState(SCE_FORTH_LOCALE);
- } else if (sc.ch == ':' && isascii(sc.chNext) && isspace(sc.chNext)) {
+ } else if (sc.ch == ':' && IsASCII(sc.chNext) && isspace(sc.chNext)) {
// highlight word definitions e.g. : GCD ( n n -- n ) ..... ;
// ^ ^^^
sc.SetState(SCE_FORTH_DEFWORD);
- while(sc.More() && isascii(sc.chNext) && isspace(sc.chNext))
+ while(sc.More() && IsASCII(sc.chNext) && isspace(sc.chNext))
sc.Forward();
} else if (sc.ch == ';' &&
(sc.atLineStart || IsASpaceChar(sc.chPrev)) &&
diff --git a/scintilla/lexers/LexGAP.cxx b/scintilla/lexers/LexGAP.cxx
index f37884e..e63006e 100644
--- a/scintilla/lexers/LexGAP.cxx
+++ b/scintilla/lexers/LexGAP.cxx
@@ -29,7 +29,7 @@ using namespace Scintilla;
#endif
static inline bool IsGAPOperator(char ch) {
- if (isascii(ch) && isalnum(ch)) return false;
+ if (IsASCII(ch) && isalnum(ch)) return false;
if (ch == '+' || ch == '-' || ch == '*' || ch == '/' ||
ch == '^' || ch == ',' || ch == '!' || ch == '.' ||
ch == '=' || ch == '<' || ch == '>' || ch == '(' ||
diff --git a/scintilla/lexers/LexGui4Cli.cxx b/scintilla/lexers/LexGui4Cli.cxx
index 8136425..ab34c57 100644
--- a/scintilla/lexers/LexGui4Cli.cxx
+++ b/scintilla/lexers/LexGui4Cli.cxx
@@ -6,8 +6,8 @@ This is the Lexer for Gui4Cli, included in SciLexer.dll
To add to SciLexer.dll:
1. Add the values below to INCLUDE\Scintilla.iface
-2. Run the include/HFacer.py script
-3. Run the src/lexGen.py script
+2. Run the scripts/HFacer.py script
+3. Run the scripts/LexGen.py script
val SCE_GC_DEFAULT=0
val SCE_GC_COMMENTLINE=1
diff --git a/scintilla/lexers/LexHTML.cxx b/scintilla/lexers/LexHTML.cxx
index 3acb896..1b855e4 100644
--- a/scintilla/lexers/LexHTML.cxx
+++ b/scintilla/lexers/LexHTML.cxx
@@ -43,7 +43,7 @@ static inline bool IsAWordStart(const int ch) {
}
inline bool IsOperator(int ch) {
- if (isascii(ch) && isalnum(ch))
+ if (IsASCII(ch) && isalnum(ch))
return false;
// '.' left out as it is used to make up numbers
if (ch == '%' || ch == '^' || ch == '&' || ch == '*' ||
@@ -446,12 +446,12 @@ static int StateForScript(script_type scriptLanguage) {
}
static inline bool issgmlwordchar(int ch) {
- return !isascii(ch) ||
+ return !IsASCII(ch) ||
(isalnum(ch) || ch == '.' || ch == '_' || ch == ':' || ch == '!' || ch == '#' || ch == '[');
}
static inline bool IsPhpWordStart(int ch) {
- return (isascii(ch) && (isalpha(ch) || (ch == '_'))) || (ch >= 0x7f);
+ return (IsASCII(ch) && (isalpha(ch) || (ch == '_'))) || (ch >= 0x7f);
}
static inline bool IsPhpWordChar(int ch) {
@@ -1233,7 +1233,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
styler.ColourTo(i - 2, StateToPrint);
}
state = SCE_H_SGML_COMMENT;
- } else if (isascii(ch) && isalpha(ch) && (chPrev == '%')) {
+ } else if (IsASCII(ch) && isalpha(ch) && (chPrev == '%')) {
styler.ColourTo(i - 2, StateToPrint);
state = SCE_H_SGML_ENTITY;
} else if (ch == '#') {
@@ -1312,6 +1312,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
styler.ColourTo(i - 2, StateToPrint);
state = SCE_H_SGML_COMMENT;
}
+ break;
case SCE_H_SGML_DOUBLESTRING:
if (ch == '\"') {
styler.ColourTo(i, StateToPrint);
@@ -1351,7 +1352,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
}
break;
case SCE_H_SGML_SPECIAL:
- if (!(isascii(ch) && isupper(ch))) {
+ if (!(IsASCII(ch) && isupper(ch))) {
styler.ColourTo(i - 1, StateToPrint);
if (isalnum(ch)) {
state = SCE_H_SGML_ERROR;
@@ -1364,7 +1365,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
if (ch == ';') {
styler.ColourTo(i, StateToPrint);
state = SCE_H_SGML_DEFAULT;
- } else if (!(isascii(ch) && isalnum(ch)) && ch != '-' && ch != '.') {
+ } else if (!(IsASCII(ch) && isalnum(ch)) && ch != '-' && ch != '.') {
styler.ColourTo(i, SCE_H_SGML_ERROR);
state = SCE_H_SGML_DEFAULT;
}
@@ -1374,9 +1375,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
styler.ColourTo(i, StateToPrint);
state = SCE_H_DEFAULT;
}
- if (ch != '#' && !(isascii(ch) && isalnum(ch)) // Should check that '#' follows '&', but it is unlikely anyway...
+ if (ch != '#' && !(IsASCII(ch) && isalnum(ch)) // Should check that '#' follows '&', but it is unlikely anyway...
&& ch != '.' && ch != '-' && ch != '_' && ch != ':') { // valid in XML
- if (!isascii(ch)) // Possibly start of a multibyte character so don't allow this byte to be in entity style
+ if (!IsASCII(ch)) // Possibly start of a multibyte character so don't allow this byte to be in entity style
styler.ColourTo(i-1, SCE_H_TAGUNKNOWN);
else
styler.ColourTo(i, SCE_H_TAGUNKNOWN);
@@ -1702,7 +1703,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
case SCE_HJ_REGEX:
if (ch == '\r' || ch == '\n' || ch == '/') {
if (ch == '/') {
- while (isascii(chNext) && islower(chNext)) { // gobble regex flags
+ while (IsASCII(chNext) && islower(chNext)) { // gobble regex flags
i++;
ch = chNext;
chNext = static_cast<unsigned char>(styler.SafeGetCharAt(i + 1));
diff --git a/scintilla/lexers/LexInno.cxx b/scintilla/lexers/LexInno.cxx
index 117160d..5a81f2a 100644
--- a/scintilla/lexers/LexInno.cxx
+++ b/scintilla/lexers/LexInno.cxx
@@ -104,7 +104,7 @@ static void ColouriseInnoDoc(unsigned int startPos, int length, int, WordList *k
} else if (ch == '\'') {
// Start of a single-quote string
state = SCE_INNO_STRING_SINGLE;
- } else if (isascii(ch) && (isalpha(ch) || (ch == '_'))) {
+ } else if (IsASCII(ch) && (isalpha(ch) || (ch == '_'))) {
// Start of an identifier
bufferCount = 0;
buffer[bufferCount++] = static_cast<char>(tolower(ch));
@@ -123,7 +123,7 @@ static void ColouriseInnoDoc(unsigned int startPos, int length, int, WordList *k
break;
case SCE_INNO_IDENTIFIER:
- if (isascii(ch) && (isalnum(ch) || (ch == '_'))) {
+ if (IsASCII(ch) && (isalnum(ch) || (ch == '_'))) {
buffer[bufferCount++] = static_cast<char>(tolower(ch));
} else {
state = SCE_INNO_DEFAULT;
@@ -160,7 +160,7 @@ static void ColouriseInnoDoc(unsigned int startPos, int length, int, WordList *k
} else {
styler.ColourTo(i,SCE_INNO_DEFAULT);
}
- } else if (isascii(ch) && (isalnum(ch) || (ch == '_'))) {
+ } else if (IsASCII(ch) && (isalnum(ch) || (ch == '_'))) {
buffer[bufferCount++] = static_cast<char>(tolower(ch));
} else {
state = SCE_INNO_DEFAULT;
@@ -170,7 +170,7 @@ static void ColouriseInnoDoc(unsigned int startPos, int length, int, WordList *k
case SCE_INNO_PREPROC:
if (isWS || isEOL) {
- if (isascii(chPrev) && isalpha(chPrev)) {
+ if (IsASCII(chPrev) && isalpha(chPrev)) {
state = SCE_INNO_DEFAULT;
buffer[bufferCount] = '\0';
@@ -185,7 +185,7 @@ static void ColouriseInnoDoc(unsigned int startPos, int length, int, WordList *k
chNext = styler[i--];
ch = chPrev;
}
- } else if (isascii(ch) && isalpha(ch)) {
+ } else if (IsASCII(ch) && isalpha(ch)) {
if (chPrev == '#' || chPrev == ' ' || chPrev == '\t')
bufferCount = 0;
buffer[bufferCount++] = static_cast<char>(tolower(ch));
diff --git a/scintilla/lexers/LexKVIrc.cxx b/scintilla/lexers/LexKVIrc.cxx
new file mode 100644
index 0000000..958a2cf
--- /dev/null
+++ b/scintilla/lexers/LexKVIrc.cxx
@@ -0,0 +1,473 @@
+// Scintilla source code edit control
+/** @file LexKVIrc.cxx
+ ** Lexer for KVIrc script.
+ **/
+// Copyright 2013 by OmegaPhil <OmegaPhil+scintilla@gmail.com>, based in
+// part from LexPython Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// and LexCmake Copyright 2007 by Cristian Adam <cristian [dot] adam [at] gmx [dot] net>
+
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "ILexer.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+#include "WordList.h"
+#include "LexAccessor.h"
+#include "Accessor.h"
+#include "StyleContext.h"
+#include "CharacterSet.h"
+#include "LexerModule.h"
+
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+
+/* KVIrc Script syntactic rules: http://www.kvirc.net/doc/doc_syntactic_rules.html */
+
+/* Utility functions */
+static inline bool IsAWordChar(int ch) {
+
+ /* Keyword list includes modules, i.e. words including '.', and
+ * alias namespaces include ':' */
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.'
+ || ch == ':');
+}
+static inline bool IsAWordStart(int ch) {
+
+ /* Functions (start with '$') are treated separately to keywords */
+ return (ch < 0x80) && (isalnum(ch) || ch == '_' );
+}
+
+/* Interface function called by Scintilla to request some text to be
+ syntax highlighted */
+static void ColouriseKVIrcDoc(unsigned int startPos, int length,
+ int initStyle, WordList *keywordlists[],
+ Accessor &styler)
+{
+ /* Fetching style context */
+ StyleContext sc(startPos, length, initStyle, styler);
+
+ /* Accessing keywords and function-marking keywords */
+ WordList &keywords = *keywordlists[0];
+ WordList &functionKeywords = *keywordlists[1];
+
+ /* Looping for all characters - only automatically moving forward
+ * when asked for (transitions leaving strings and keywords do this
+ * already) */
+ bool next = true;
+ for( ; sc.More(); next ? sc.Forward() : (void)0 )
+ {
+ /* Resetting next */
+ next = true;
+
+ /* Dealing with different states */
+ switch (sc.state)
+ {
+ case SCE_KVIRC_DEFAULT:
+
+ /* Detecting single-line comments
+ * Unfortunately KVIrc script allows raw '#<channel
+ * name>' to be used, and appending # to an array returns
+ * its length...
+ * Going for a compromise where single line comments not
+ * starting on a newline are allowed in all cases except
+ * when they are preceeded with an opening bracket or comma
+ * (this will probably be the most common style a valid
+ * string-less channel name will be used with), with the
+ * array length case included
+ */
+ if (
+ (sc.ch == '#' && sc.atLineStart) ||
+ (sc.ch == '#' && (
+ sc.chPrev != '(' && sc.chPrev != ',' &&
+ sc.chPrev != ']')
+ )
+ )
+ {
+ sc.SetState(SCE_KVIRC_COMMENT);
+ break;
+ }
+
+ /* Detecting multi-line comments */
+ if (sc.Match('/', '*'))
+ {
+ sc.SetState(SCE_KVIRC_COMMENTBLOCK);
+ break;
+ }
+
+ /* Detecting strings */
+ if (sc.ch == '"')
+ {
+ sc.SetState(SCE_KVIRC_STRING);
+ break;
+ }
+
+ /* Detecting functions */
+ if (sc.ch == '$')
+ {
+ sc.SetState(SCE_KVIRC_FUNCTION);
+ break;
+ }
+
+ /* Detecting variables */
+ if (sc.ch == '%')
+ {
+ sc.SetState(SCE_KVIRC_VARIABLE);
+ break;
+ }
+
+ /* Detecting numbers - isdigit is unsafe as it does not
+ * validate, use CharacterSet.h functions */
+ if (IsADigit(sc.ch))
+ {
+ sc.SetState(SCE_KVIRC_NUMBER);
+ break;
+ }
+
+ /* Detecting words */
+ if (IsAWordStart(sc.ch) && IsAWordChar(sc.chNext))
+ {
+ sc.SetState(SCE_KVIRC_WORD);
+ sc.Forward();
+ break;
+ }
+
+ /* Detecting operators */
+ if (isoperator(sc.ch))
+ {
+ sc.SetState(SCE_KVIRC_OPERATOR);
+ break;
+ }
+
+ break;
+
+ case SCE_KVIRC_COMMENT:
+
+ /* Breaking out of single line comment when a newline
+ * is introduced */
+ if (sc.ch == '\r' || sc.ch == '\n')
+ {
+ sc.SetState(SCE_KVIRC_DEFAULT);
+ break;
+ }
+
+ break;
+
+ case SCE_KVIRC_COMMENTBLOCK:
+
+ /* Detecting end of multi-line comment */
+ if (sc.Match('*', '/'))
+ {
+ // Moving the current position forward two characters
+ // so that '*/' is included in the comment
+ sc.Forward(2);
+ sc.SetState(SCE_KVIRC_DEFAULT);
+
+ /* Comment has been exited and the current position
+ * moved forward, yet the new current character
+ * has yet to be defined - loop without moving
+ * forward again */
+ next = false;
+ break;
+ }
+
+ break;
+
+ case SCE_KVIRC_STRING:
+
+ /* Detecting end of string - closing speechmarks */
+ if (sc.ch == '"')
+ {
+ /* Allowing escaped speechmarks to pass */
+ if (sc.chPrev == '\\')
+ break;
+
+ /* Moving the current position forward to capture the
+ * terminating speechmarks, and ending string */
+ sc.ForwardSetState(SCE_KVIRC_DEFAULT);
+
+ /* String has been exited and the current position
+ * moved forward, yet the new current character
+ * has yet to be defined - loop without moving
+ * forward again */
+ next = false;
+ break;
+ }
+
+ /* Functions and variables are now highlighted in strings
+ * Detecting functions */
+ if (sc.ch == '$')
+ {
+ /* Allowing escaped functions to pass */
+ if (sc.chPrev == '\\')
+ break;
+
+ sc.SetState(SCE_KVIRC_STRING_FUNCTION);
+ break;
+ }
+
+ /* Detecting variables */
+ if (sc.ch == '%')
+ {
+ /* Allowing escaped variables to pass */
+ if (sc.chPrev == '\\')
+ break;
+
+ sc.SetState(SCE_KVIRC_STRING_VARIABLE);
+ break;
+ }
+
+ /* Breaking out of a string when a newline is introduced */
+ if (sc.ch == '\r' || sc.ch == '\n')
+ {
+ /* Allowing escaped newlines */
+ if (sc.chPrev == '\\')
+ break;
+
+ sc.SetState(SCE_KVIRC_DEFAULT);
+ break;
+ }
+
+ break;
+
+ case SCE_KVIRC_FUNCTION:
+ case SCE_KVIRC_VARIABLE:
+
+ /* Detecting the end of a function/variable (word) */
+ if (!IsAWordChar(sc.ch))
+ {
+ sc.SetState(SCE_KVIRC_DEFAULT);
+
+ /* Word has been exited yet the current character
+ * has yet to be defined - loop without moving
+ * forward again */
+ next = false;
+ break;
+ }
+
+ break;
+
+ case SCE_KVIRC_STRING_FUNCTION:
+ case SCE_KVIRC_STRING_VARIABLE:
+
+ /* A function or variable in a string
+ * Detecting the end of a function/variable (word) */
+ if (!IsAWordChar(sc.ch))
+ {
+ sc.SetState(SCE_KVIRC_STRING);
+
+ /* Word has been exited yet the current character
+ * has yet to be defined - loop without moving
+ * forward again */
+ next = false;
+ break;
+ }
+
+ break;
+
+ case SCE_KVIRC_NUMBER:
+
+ /* Detecting the end of a number */
+ if (!IsADigit(sc.ch))
+ {
+ sc.SetState(SCE_KVIRC_DEFAULT);
+
+ /* Number has been exited yet the current character
+ * has yet to be defined - loop without moving
+ * forward */
+ next = false;
+ break;
+ }
+
+ break;
+
+ case SCE_KVIRC_OPERATOR:
+
+ /* Because '%' is an operator but is also the marker for
+ * a variable, I need to always treat operators as single
+ * character strings and therefore redo their detection
+ * after every character */
+ sc.SetState(SCE_KVIRC_DEFAULT);
+
+ /* Operator has been exited yet the current character
+ * has yet to be defined - loop without moving
+ * forward */
+ next = false;
+ break;
+
+ case SCE_KVIRC_WORD:
+
+ /* Detecting the end of a word */
+ if (!IsAWordChar(sc.ch))
+ {
+ /* Checking if the word was actually a keyword -
+ * fetching the current word, NULL-terminated like
+ * the keyword list */
+ char s[100];
+ int wordLen = sc.currentPos - styler.GetStartSegment();
+ if (wordLen > 99)
+ wordLen = 99; /* Include '\0' in buffer */
+ int i;
+ for( i = 0; i < wordLen; ++i )
+ {
+ s[i] = styler.SafeGetCharAt( styler.GetStartSegment() + i );
+ }
+ s[wordLen] = '\0';
+
+ /* Actually detecting keywords and fixing the state */
+ if (keywords.InList(s))
+ {
+ /* The SetState call actually commits the
+ * previous keyword state */
+ sc.ChangeState(SCE_KVIRC_KEYWORD);
+ }
+ else if (functionKeywords.InList(s))
+ {
+ // Detecting function keywords and fixing the state
+ sc.ChangeState(SCE_KVIRC_FUNCTION_KEYWORD);
+ }
+
+ /* Transitioning to default and committing the previous
+ * word state */
+ sc.SetState(SCE_KVIRC_DEFAULT);
+
+ /* Word has been exited yet the current character
+ * has yet to be defined - loop without moving
+ * forward again */
+ next = false;
+ break;
+ }
+
+ break;
+ }
+ }
+
+ /* Indicating processing is complete */
+ sc.Complete();
+}
+
+static void FoldKVIrcDoc(unsigned int startPos, int length, int /*initStyle - unused*/,
+ WordList *[], Accessor &styler)
+{
+ /* Based on CMake's folder */
+
+ /* Exiting if folding isnt enabled */
+ if ( styler.GetPropertyInt("fold") == 0 )
+ return;
+
+ /* Obtaining current line number*/
+ int currentLine = styler.GetLine(startPos);
+
+ /* Obtaining starting character - indentation is done on a line basis,
+ * not character */
+ unsigned int safeStartPos = styler.LineStart( currentLine );
+
+ /* Initialising current level - this is defined as indentation level
+ * in the low 12 bits, with flag bits in the upper four bits.
+ * It looks like two indentation states are maintained in the returned
+ * 32bit value - 'nextLevel' in the most-significant bits, 'currentLevel'
+ * in the least-significant bits. Since the next level is the most
+ * up to date, this must refer to the current state of indentation.
+ * So the code bitshifts the old current level out of existence to
+ * get at the actual current state of indentation
+ * Based on the LexerCPP.cxx line 958 comment */
+ int currentLevel = SC_FOLDLEVELBASE;
+ if (currentLine > 0)
+ currentLevel = styler.LevelAt(currentLine - 1) >> 16;
+ int nextLevel = currentLevel;
+
+ // Looping for characters in range
+ for (unsigned int i = safeStartPos; i < startPos + length; ++i)
+ {
+ /* Folding occurs after syntax highlighting, meaning Scintilla
+ * already knows where the comments are
+ * Fetching the current state */
+ int state = styler.StyleAt(i) & 31;
+
+ switch( styler.SafeGetCharAt(i) )
+ {
+ case '{':
+
+ /* Indenting only when the braces are not contained in
+ * a comment */
+ if (state != SCE_KVIRC_COMMENT &&
+ state != SCE_KVIRC_COMMENTBLOCK)
+ ++nextLevel;
+ break;
+
+ case '}':
+
+ /* Outdenting only when the braces are not contained in
+ * a comment */
+ if (state != SCE_KVIRC_COMMENT &&
+ state != SCE_KVIRC_COMMENTBLOCK)
+ --nextLevel;
+ break;
+
+ case '\n':
+ case '\r':
+
+ /* Preparing indentation information to return - combining
+ * current and next level data */
+ int lev = currentLevel | nextLevel << 16;
+
+ /* If the next level increases the indent level, mark the
+ * current line as a fold point - current level data is
+ * in the least significant bits */
+ if (nextLevel > currentLevel )
+ lev |= SC_FOLDLEVELHEADERFLAG;
+
+ /* Updating indentation level if needed */
+ if (lev != styler.LevelAt(currentLine))
+ styler.SetLevel(currentLine, lev);
+
+ /* Updating variables */
+ ++currentLine;
+ currentLevel = nextLevel;
+
+ /* Dealing with problematic Windows newlines -
+ * incrementing to avoid the extra newline breaking the
+ * fold point */
+ if (styler.SafeGetCharAt(i) == '\r' &&
+ styler.SafeGetCharAt(i + 1) == '\n')
+ ++i;
+ break;
+ }
+ }
+
+ /* At this point the data has ended, so presumably the end of the line?
+ * Preparing indentation information to return - combining current
+ * and next level data */
+ int lev = currentLevel | nextLevel << 16;
+
+ /* If the next level increases the indent level, mark the current
+ * line as a fold point - current level data is in the least
+ * significant bits */
+ if (nextLevel > currentLevel )
+ lev |= SC_FOLDLEVELHEADERFLAG;
+
+ /* Updating indentation level if needed */
+ if (lev != styler.LevelAt(currentLine))
+ styler.SetLevel(currentLine, lev);
+}
+
+/* Registering wordlists */
+static const char *const kvircWordListDesc[] = {
+ "primary",
+ "function_keywords",
+ 0
+};
+
+
+/* Registering functions and wordlists */
+LexerModule lmKVIrc(SCLEX_KVIRC, ColouriseKVIrcDoc, "kvirc", FoldKVIrcDoc,
+ kvircWordListDesc);
diff --git a/scintilla/lexers/LexLaTeX.cxx b/scintilla/lexers/LexLaTeX.cxx
index f3b1405..f8af1e7 100644
--- a/scintilla/lexers/LexLaTeX.cxx
+++ b/scintilla/lexers/LexLaTeX.cxx
@@ -99,7 +99,7 @@ static bool latexIsBlankAndNL(int ch) {
}
static bool latexIsLetter(int ch) {
- return isascii(ch) && isalpha(ch);
+ return IsASCII(ch) && isalpha(ch);
}
static bool latexIsTagValid(int &i, int l, Accessor &styler) {
@@ -224,7 +224,7 @@ void SCI_METHOD LexerLaTeX::Lex(unsigned int startPos, int length, int initStyle
chNext = styler.SafeGetCharAt(i + 1);
} else if (chNext == '\r' || chNext == '\n') {
styler.ColourTo(i, SCE_L_ERROR);
- } else if (isascii(chNext)) {
+ } else if (IsASCII(chNext)) {
styler.ColourTo(i + 1, SCE_L_SHORTCMD);
if (chNext == '(') {
mode = 1;
@@ -340,7 +340,7 @@ void SCI_METHOD LexerLaTeX::Lex(unsigned int startPos, int length, int initStyle
chNext = styler.SafeGetCharAt(i + 1);
} else if (chNext == '\r' || chNext == '\n') {
styler.ColourTo(i, SCE_L_ERROR);
- } else if (isascii(chNext)) {
+ } else if (IsASCII(chNext)) {
if (chNext == ')') {
mode = 0;
state = SCE_L_DEFAULT;
@@ -382,7 +382,7 @@ void SCI_METHOD LexerLaTeX::Lex(unsigned int startPos, int length, int initStyle
chNext = styler.SafeGetCharAt(i + 1);
} else if (chNext == '\r' || chNext == '\n') {
styler.ColourTo(i, SCE_L_ERROR);
- } else if (isascii(chNext)) {
+ } else if (IsASCII(chNext)) {
if (chNext == ']') {
mode = 0;
state = SCE_L_DEFAULT;
diff --git a/scintilla/lexers/LexLisp.cxx b/scintilla/lexers/LexLisp.cxx
index 884abfa..8177d83 100644
--- a/scintilla/lexers/LexLisp.cxx
+++ b/scintilla/lexers/LexLisp.cxx
@@ -33,7 +33,7 @@ using namespace Scintilla;
#define SCE_LISP_MACRO_DISPATCH 31
static inline bool isLispoperator(char ch) {
- if (isascii(ch) && isalnum(ch))
+ if (IsASCII(ch) && isalnum(ch))
return false;
if (ch == '\'' || ch == '`' || ch == '(' || ch == ')' || ch == '[' || ch == ']' || ch == '{' || ch == '}')
return true;
@@ -41,7 +41,7 @@ static inline bool isLispoperator(char ch) {
}
static inline bool isLispwordstart(char ch) {
- return isascii(ch) && ch != ';' && !isspacechar(ch) && !isLispoperator(ch) &&
+ return IsASCII(ch) && ch != ';' && !isspacechar(ch) && !isLispoperator(ch) &&
ch != '\n' && ch != '\r' && ch != '\"';
}
@@ -142,7 +142,7 @@ static void ColouriseLispDoc(unsigned int startPos, int length, int initStyle, W
}
}
} else if (state == SCE_LISP_MACRO_DISPATCH) {
- if (!(isascii(ch) && isdigit(ch))) {
+ if (!(IsASCII(ch) && isdigit(ch))) {
if (ch != 'r' && ch != 'R' && (i - styler.GetStartSegment()) > 1) {
state = SCE_LISP_DEFAULT;
} else {
diff --git a/scintilla/lexers/LexLout.cxx b/scintilla/lexers/LexLout.cxx
index d81c728..cdbceb0 100644
--- a/scintilla/lexers/LexLout.cxx
+++ b/scintilla/lexers/LexLout.cxx
@@ -151,7 +151,7 @@ static void FoldLoutDoc(unsigned int startPos, int length, int, WordList *[],
char chNext = styler[startPos];
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
int styleNext = styler.StyleAt(startPos);
- char s[10];
+ char s[10] = "";
for (unsigned int i = startPos; i < endPos; i++) {
char ch = chNext;
diff --git a/scintilla/lexers/LexMMIXAL.cxx b/scintilla/lexers/LexMMIXAL.cxx
index 8e0b1b6..ee94f98 100644
--- a/scintilla/lexers/LexMMIXAL.cxx
+++ b/scintilla/lexers/LexMMIXAL.cxx
@@ -35,7 +35,7 @@ static inline bool IsAWordChar(const int ch) {
}
inline bool isMMIXALOperator(char ch) {
- if (isascii(ch) && isalnum(ch))
+ if (IsASCII(ch) && isalnum(ch))
return false;
if (ch == '+' || ch == '-' || ch == '|' || ch == '^' ||
ch == '*' || ch == '/' ||
diff --git a/scintilla/lexers/LexMPT.cxx b/scintilla/lexers/LexMPT.cxx
index 73fa5c9..18e8200 100644
--- a/scintilla/lexers/LexMPT.cxx
+++ b/scintilla/lexers/LexMPT.cxx
@@ -37,7 +37,7 @@ static int GetLotLineState(std::string &line) {
// Now finds the first non-blank character
unsigned i; // Declares counter here to make it persistent after the for loop
for (i = 0; i < line.length(); ++i) {
- if (!(isascii(line[i]) && isspace(line[i])))
+ if (!(IsASCII(line[i]) && isspace(line[i])))
break;
}
diff --git a/scintilla/lexers/LexMSSQL.cxx b/scintilla/lexers/LexMSSQL.cxx
index f2cf6ed..2d551c8 100644
--- a/scintilla/lexers/LexMSSQL.cxx
+++ b/scintilla/lexers/LexMSSQL.cxx
@@ -35,19 +35,6 @@ using namespace Scintilla;
#define KW_MSSQL_STORED_PROCEDURES 5
#define KW_MSSQL_OPERATORS 6
-static bool isMSSQLOperator(char ch) {
- if (isascii(ch) && isalnum(ch))
- return false;
- // '.' left out as it is used to make up numbers
- if (ch == '%' || ch == '^' || ch == '&' || ch == '*' ||
- ch == '-' || ch == '+' || ch == '=' || ch == '|' ||
- ch == '<' || ch == '>' || ch == '/' ||
- ch == '!' || ch == '~' || ch == '(' || ch == ')' ||
- ch == ',')
- return true;
- return false;
-}
-
static char classifyWordSQL(unsigned int start,
unsigned int end,
WordList *keywordlists[],
@@ -220,7 +207,7 @@ static void ColouriseMSSQLDoc(unsigned int startPos, int length,
styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT);
prevState = state;
state = SCE_MSSQL_COLUMN_NAME_2;
- } else if (isMSSQLOperator(ch)) {
+ } else if (isoperator(ch)) {
styler.ColourTo(i - 1, SCE_MSSQL_DEFAULT);
styler.ColourTo(i, SCE_MSSQL_OPERATOR);
//~ style = SCE_MSSQL_DEFAULT;
@@ -300,7 +287,7 @@ static void FoldMSSQLDoc(unsigned int startPos, int length, int, WordList *[], A
int levelCurrent = levelPrev;
char chNext = styler[startPos];
bool inComment = (styler.StyleAt(startPos-1) == SCE_MSSQL_COMMENT);
- char s[10];
+ char s[10] = "";
for (unsigned int i = startPos; i < endPos; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
diff --git a/scintilla/lexers/LexNsis.cxx b/scintilla/lexers/LexNsis.cxx
index b448830..3e99395 100644
--- a/scintilla/lexers/LexNsis.cxx
+++ b/scintilla/lexers/LexNsis.cxx
@@ -180,6 +180,8 @@ static int classifyWordNsis(unsigned int start, unsigned int end, WordList *keyw
bUserVars = true;
char s[100];
+ s[0] = '\0';
+ s[1] = '\0';
WordList &Functions = *keywordLists[0];
WordList &Variables = *keywordLists[1];
diff --git a/scintilla/lexers/LexOpal.cxx b/scintilla/lexers/LexOpal.cxx
index a06e2f9..259417f 100644
--- a/scintilla/lexers/LexOpal.cxx
+++ b/scintilla/lexers/LexOpal.cxx
@@ -295,7 +295,7 @@ inline bool HandleInteger( unsigned int & cur, unsigned int one_too_much, Access
}
ch = styler.SafeGetCharAt( cur );
- if( !( isascii( ch ) && isdigit( ch ) ) )
+ if( !( IsASCII( ch ) && isdigit( ch ) ) )
{
styler.ColourTo( cur - 1, SCE_OPAL_INTEGER );
styler.StartSegment( cur );
@@ -314,7 +314,7 @@ inline bool HandleWord( unsigned int & cur, unsigned int one_too_much, Accessor
{
ch = styler.SafeGetCharAt( cur );
if( ( ch != '_' ) && ( ch != '-' ) &&
- !( isascii( ch ) && ( islower( ch ) || isupper( ch ) || isdigit( ch ) ) ) ) break;
+ !( IsASCII( ch ) && ( islower( ch ) || isupper( ch ) || isdigit( ch ) ) ) ) break;
cur++;
if( cur >= one_too_much )
@@ -490,13 +490,13 @@ static void ColouriseOpalDoc( unsigned int startPos, int length, int initStyle,
default:
{
// Integer
- if( isascii( ch ) && isdigit( ch ) )
+ if( IsASCII( ch ) && isdigit( ch ) )
{
if( !HandleInteger( cur, one_too_much, styler ) ) return;
}
// Keyword
- else if( isascii( ch ) && ( islower( ch ) || isupper( ch ) ) )
+ else if( IsASCII( ch ) && ( islower( ch ) || isupper( ch ) ) )
{
if( !HandleWord( cur, one_too_much, styler, keywordlists ) ) return;
diff --git a/scintilla/lexers/LexOthers.cxx b/scintilla/lexers/LexOthers.cxx
index bf37b16..0e08b18 100644
--- a/scintilla/lexers/LexOthers.cxx
+++ b/scintilla/lexers/LexOthers.cxx
@@ -40,7 +40,7 @@ static bool Is1To9(char ch) {
}
static bool IsAlphabetic(int ch) {
- return isascii(ch) && isalpha(ch);
+ return IsASCII(ch) && isalpha(ch);
}
static inline bool AtEOL(Accessor &styler, unsigned int i) {
diff --git a/scintilla/lexers/LexPerl.cxx b/scintilla/lexers/LexPerl.cxx
index fddb24e..a4aa71c 100644
--- a/scintilla/lexers/LexPerl.cxx
+++ b/scintilla/lexers/LexPerl.cxx
@@ -1626,7 +1626,7 @@ void SCI_METHOD LexerPerl::Fold(unsigned int startPos, int length, int /* initSt
else if (styler.Match(i, "=head"))
podHeading = PodHeadingLevel(i, styler);
} else if (style == SCE_PL_DATASECTION) {
- if (ch == '=' && isascii(chNext) && isalpha(chNext) && levelCurrent == SC_FOLDLEVELBASE)
+ if (ch == '=' && IsASCII(chNext) && isalpha(chNext) && levelCurrent == SC_FOLDLEVELBASE)
levelCurrent++;
else if (styler.Match(i, "=cut") && levelCurrent > SC_FOLDLEVELBASE)
levelCurrent = (levelCurrent & ~PERL_HEADFOLD_MASK) - 1;
diff --git a/scintilla/lexers/LexPython.cxx b/scintilla/lexers/LexPython.cxx
index ecd00f9..2e304f1 100644
--- a/scintilla/lexers/LexPython.cxx
+++ b/scintilla/lexers/LexPython.cxx
@@ -385,7 +385,7 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
base_n_number = false;
sc.SetState(SCE_P_NUMBER);
}
- } else if ((isascii(sc.ch) && isoperator(static_cast<char>(sc.ch))) || sc.ch == '`') {
+ } else if ((IsASCII(sc.ch) && isoperator(static_cast<char>(sc.ch))) || sc.ch == '`') {
sc.SetState(SCE_P_OPERATOR);
} else if (sc.ch == '#') {
sc.SetState(sc.chNext == '#' ? SCE_P_COMMENTBLOCK : SCE_P_COMMENTLINE);
diff --git a/scintilla/lexers/LexR.cxx b/scintilla/lexers/LexR.cxx
index 78d1a49..409bb4c 100644
--- a/scintilla/lexers/LexR.cxx
+++ b/scintilla/lexers/LexR.cxx
@@ -37,7 +37,7 @@ static inline bool IsAWordStart(const int ch) {
}
static inline bool IsAnOperator(const int ch) {
- if (isascii(ch) && isalnum(ch))
+ if (IsASCII(ch) && isalnum(ch))
return false;
// '.' left out as it is used to make up numbers
if (ch == '-' || ch == '+' || ch == '!' || ch == '~' ||
diff --git a/scintilla/lexers/LexSTTXT.cxx b/scintilla/lexers/LexSTTXT.cxx
index c58d054..e1d2d37 100644
--- a/scintilla/lexers/LexSTTXT.cxx
+++ b/scintilla/lexers/LexSTTXT.cxx
@@ -85,17 +85,22 @@ static void ColouriseSTTXTDoc (unsigned int startPos, int length, int initStyle,
break;
}
case SCE_STTXT_HEXNUMBER: {
- if(setHexNumber.Contains(sc.ch))
+ if (setHexNumber.Contains(sc.ch))
continue;
else if(setDataTime.Contains(sc.ch))
- sc.SetState(SCE_STTXT_DATETIME);
+ sc.ChangeState(SCE_STTXT_DATETIME);
+ else if(setWord.Contains(sc.ch))
+ sc.ChangeState(SCE_STTXT_DEFAULT);
else
sc.SetState(SCE_STTXT_DEFAULT);
-
break;
}
case SCE_STTXT_DATETIME: {
- if(!setDataTime.Contains(sc.ch))
+ if (setDataTime.Contains(sc.ch))
+ continue;
+ else if(setWord.Contains(sc.ch))
+ sc.ChangeState(SCE_STTXT_DEFAULT);
+ else
sc.SetState(SCE_STTXT_DEFAULT);
break;
}
diff --git a/scintilla/lexers/LexScriptol.cxx b/scintilla/lexers/LexScriptol.cxx
index c497ca1..a0ace5a 100644
--- a/scintilla/lexers/LexScriptol.cxx
+++ b/scintilla/lexers/LexScriptol.cxx
@@ -27,7 +27,7 @@ using namespace Scintilla;
static void ClassifyWordSol(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord)
{
- char s[100];
+ char s[100] = "";
bool wordIsNumber = isdigit(styler[start]) != 0;
for (unsigned int i = 0; i < end - start + 1 && i < 30; i++)
{
diff --git a/scintilla/lexers/LexSpice.cxx b/scintilla/lexers/LexSpice.cxx
index 1f7d342..6986ca9 100644
--- a/scintilla/lexers/LexSpice.cxx
+++ b/scintilla/lexers/LexSpice.cxx
@@ -60,11 +60,7 @@ static void ColouriseWhiteSpace(StyleContext& sc, bool& apostropheStartsAttribut
static void ColouriseWord(StyleContext& sc, WordList& keywords, WordList& keywords2, WordList& keywords3, bool& apostropheStartsAttribute);
static inline bool IsDelimiterCharacter(int ch);
-static inline bool IsNumberStartCharacter(int ch);
-static inline bool IsNumberCharacter(int ch);
static inline bool IsSeparatorOrDelimiterCharacter(int ch);
-static inline bool IsWordStartCharacter(int ch);
-static inline bool IsWordCharacter(int ch);
static void ColouriseComment(StyleContext& sc, bool&) {
sc.SetState(SCE_SPICE_COMMENTLINE);
@@ -205,27 +201,6 @@ static inline bool IsDelimiterCharacter(int ch) {
}
}
-static inline bool IsNumberCharacter(int ch) {
- return IsNumberStartCharacter(ch) ||
- ch == '_' ||
- ch == '.' ||
- ch == '#' ||
- (ch >= 'a' && ch <= 'f') ||
- (ch >= 'A' && ch <= 'F');
-}
-
-static inline bool IsNumberStartCharacter(int ch) {
- return IsADigit(ch);
-}
-
static inline bool IsSeparatorOrDelimiterCharacter(int ch) {
return IsASpace(ch) || IsDelimiterCharacter(ch);
}
-
-static inline bool IsWordCharacter(int ch) {
- return IsWordStartCharacter(ch) || IsADigit(ch);
-}
-
-static inline bool IsWordStartCharacter(int ch) {
- return (isascii(ch) && isalpha(ch)) || ch == '_';
-}
diff --git a/scintilla/lexers/LexTCMD.cxx b/scintilla/lexers/LexTCMD.cxx
index 6f65409..8941604 100644
--- a/scintilla/lexers/LexTCMD.cxx
+++ b/scintilla/lexers/LexTCMD.cxx
@@ -30,7 +30,7 @@ using namespace Scintilla;
static bool IsAlphabetic(int ch) {
- return isascii(ch) && isalpha(ch);
+ return IsASCII(ch) && isalpha(ch);
}
static inline bool AtEOL(Accessor &styler, unsigned int i) {
@@ -445,7 +445,7 @@ static void FoldTCMDDoc(unsigned int startPos, int length, int, WordList *[], Ac
int level = styler.LevelAt(line);
int levelIndent = 0;
unsigned int endPos = startPos + length;
- char s[16];
+ char s[16] = "";
char chPrev = styler.SafeGetCharAt(startPos - 1);
diff --git a/scintilla/lexers/LexYAML.cxx b/scintilla/lexers/LexYAML.cxx
index 32f1cc7..2118a10 100644
--- a/scintilla/lexers/LexYAML.cxx
+++ b/scintilla/lexers/LexYAML.cxx
@@ -150,7 +150,7 @@ static void ColouriseYAMLLine(
} else {
unsigned int i2 = i;
while ((i < lengthLine) && lineBuffer[i]) {
- if (!(isascii(lineBuffer[i]) && isdigit(lineBuffer[i])) && lineBuffer[i] != '-' && lineBuffer[i] != '.' && lineBuffer[i] != ',') {
+ if (!(IsASCII(lineBuffer[i]) && isdigit(lineBuffer[i])) && lineBuffer[i] != '-' && lineBuffer[i] != '.' && lineBuffer[i] != ',') {
styler.ColourTo(endPos, SCE_YAML_DEFAULT);
return;
}
diff --git a/scintilla/lexlib/Accessor.cxx b/scintilla/lexlib/Accessor.cxx
index 7c8ffe4..1f9e709 100644
--- a/scintilla/lexlib/Accessor.cxx
+++ b/scintilla/lexlib/Accessor.cxx
@@ -8,9 +8,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <ctype.h>
#include <stdarg.h>
#include <assert.h>
-#include <ctype.h>
#include "ILexer.h"
#include "Scintilla.h"
diff --git a/scintilla/lexlib/CharacterSet.cxx b/scintilla/lexlib/CharacterSet.cxx
index 86e08a1..7629b98 100644
--- a/scintilla/lexlib/CharacterSet.cxx
+++ b/scintilla/lexlib/CharacterSet.cxx
@@ -8,8 +8,8 @@
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <stdio.h>
+#include <ctype.h>
#include <assert.h>
#include "CharacterSet.h"
diff --git a/scintilla/lexlib/LexerBase.cxx b/scintilla/lexlib/LexerBase.cxx
index 0f75851..0ee3d02 100644
--- a/scintilla/lexlib/LexerBase.cxx
+++ b/scintilla/lexlib/LexerBase.cxx
@@ -8,9 +8,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <ctype.h>
#include <stdarg.h>
#include <assert.h>
-#include <ctype.h>
#include "ILexer.h"
#include "Scintilla.h"
diff --git a/scintilla/lexlib/LexerModule.cxx b/scintilla/lexlib/LexerModule.cxx
index 349a925..f71cb8e 100644
--- a/scintilla/lexlib/LexerModule.cxx
+++ b/scintilla/lexlib/LexerModule.cxx
@@ -8,9 +8,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <ctype.h>
#include <stdarg.h>
#include <assert.h>
-#include <ctype.h>
#include <string>
diff --git a/scintilla/lexlib/LexerNoExceptions.cxx b/scintilla/lexlib/LexerNoExceptions.cxx
index e179a74..964975c 100644
--- a/scintilla/lexlib/LexerNoExceptions.cxx
+++ b/scintilla/lexlib/LexerNoExceptions.cxx
@@ -8,9 +8,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <ctype.h>
#include <stdarg.h>
#include <assert.h>
-#include <ctype.h>
#include "ILexer.h"
#include "Scintilla.h"
diff --git a/scintilla/lexlib/LexerNoExceptions.h b/scintilla/lexlib/LexerNoExceptions.h
index 90219c8..6d1315d 100644
--- a/scintilla/lexlib/LexerNoExceptions.h
+++ b/scintilla/lexlib/LexerNoExceptions.h
@@ -5,8 +5,8 @@
// Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
-#ifndef LexerNoExceptions_H
-#define LexerNoExceptions_H
+#ifndef LEXERNOEXCEPTIONS_H
+#define LEXERNOEXCEPTIONS_H
#ifdef SCI_NAMESPACE
namespace Scintilla {
diff --git a/scintilla/lexlib/LexerSimple.cxx b/scintilla/lexlib/LexerSimple.cxx
index f1b5362..43f52bb 100644
--- a/scintilla/lexlib/LexerSimple.cxx
+++ b/scintilla/lexlib/LexerSimple.cxx
@@ -8,9 +8,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <ctype.h>
#include <stdarg.h>
#include <assert.h>
-#include <ctype.h>
#include <string>
diff --git a/scintilla/lexlib/StyleContext.cxx b/scintilla/lexlib/StyleContext.cxx
index 3db04e3..1dadcd3 100644
--- a/scintilla/lexlib/StyleContext.cxx
+++ b/scintilla/lexlib/StyleContext.cxx
@@ -7,8 +7,8 @@
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <stdio.h>
+#include <ctype.h>
#include <assert.h>
#include "ILexer.h"
diff --git a/scintilla/lexlib/WordList.cxx b/scintilla/lexlib/WordList.cxx
index 62b0a14..6dbc710 100644
--- a/scintilla/lexlib/WordList.cxx
+++ b/scintilla/lexlib/WordList.cxx
@@ -7,8 +7,8 @@
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <stdio.h>
+#include <ctype.h>
#include <stdarg.h>
#include <algorithm>
@@ -103,7 +103,7 @@ void WordList::Clear() {
#ifdef _MSC_VER
static bool cmpWords(const char *a, const char *b) {
- return strcmp(a, b) == -1;
+ return strcmp(a, b) < 0;
}
#else
diff --git a/scintilla/src/AutoComplete.cxx b/scintilla/src/AutoComplete.cxx
index 9530808..e20982b 100644
--- a/scintilla/src/AutoComplete.cxx
+++ b/scintilla/src/AutoComplete.cxx
@@ -10,9 +10,9 @@
#include <stdio.h>
#include <assert.h>
-#include <algorithm>
#include <string>
#include <vector>
+#include <algorithm>
#include "Platform.h"
diff --git a/scintilla/src/CaseConvert.cxx b/scintilla/src/CaseConvert.cxx
index 647bf72..7d33078 100644
--- a/scintilla/src/CaseConvert.cxx
+++ b/scintilla/src/CaseConvert.cxx
@@ -2,7 +2,7 @@
// Encoding: UTF-8
/** @file CaseConvert.cxx
** Case fold characters and convert them to upper or lower case.
- ** Tables automatically regenerated by scripts/GenerateCharacterCategory.py
+ ** Tables automatically regenerated by scripts/GenerateCaseConvert.py
** Should only be rarely regenerated for new versions of Unicode.
**/
// Copyright 2013 by Neil Hodgson <neilh@scintilla.org>
@@ -232,132 +232,132 @@ const char *complexCaseConversions =
// Original | Folded | Upper | Lower |
//++Autogenerated -- start of section automatically generated
//**2 \(\*\n\)
-"µ|μ|Μ||"
-"ß|ss|SS||"
-"İ|i̇||i̇|"
-"ı||I||"
-"ʼn|ʼn|ʼN||"
-"ſ|s|S||"
-"Dž|dž|DŽ|dž|"
-"Lj|lj|LJ|lj|"
-"Nj|nj|NJ|nj|"
-"ǰ|ǰ|J̌||"
-"Dz|dz|DZ|dz|"
-"ͅ|ι|Ι||"
-"ΐ|ΐ|Ϊ́||"
-"ΰ|ΰ|Ϋ́||"
-"ς|σ|Σ||"
-"ϐ|β|Β||"
-"ϑ|θ|Θ||"
-"ϕ|φ|Φ||"
-"ϖ|π|Π||"
-"ϰ|κ|Κ||"
-"ϱ|ρ|Ρ||"
-"ϴ|θ||θ|"
-"ϵ|ε|Ε||"
-"և|եւ|ԵՒ||"
-"ẖ|ẖ|H̱||"
-"ẗ|ẗ|T̈||"
-"ẘ|ẘ|W̊||"
-"ẙ|ẙ|Y̊||"
-"ẚ|aʾ|Aʾ||"
-"ẛ|ṡ|Ṡ||"
-"ẞ|ss||ß|"
-"ὐ|ὐ|Υ̓||"
-"ὒ|ὒ|Υ̓̀||"
-"ὔ|ὔ|Υ̓́||"
-"ὖ|ὖ|Υ̓͂||"
-"ᾀ|ἀι|ἈΙ||"
-"ᾁ|ἁι|ἉΙ||"
-"ᾂ|ἂι|ἊΙ||"
-"ᾃ|ἃι|ἋΙ||"
-"ᾄ|ἄι|ἌΙ||"
-"ᾅ|ἅι|ἍΙ||"
-"ᾆ|ἆι|ἎΙ||"
-"ᾇ|ἇι|ἏΙ||"
-"ᾈ|ἀι|ἈΙ|ᾀ|"
-"ᾉ|ἁι|ἉΙ|ᾁ|"
-"ᾊ|ἂι|ἊΙ|ᾂ|"
-"ᾋ|ἃι|ἋΙ|ᾃ|"
-"ᾌ|ἄι|ἌΙ|ᾄ|"
-"ᾍ|ἅι|ἍΙ|ᾅ|"
-"ᾎ|ἆι|ἎΙ|ᾆ|"
-"ᾏ|ἇι|ἏΙ|ᾇ|"
-"ᾐ|ἠι|ἨΙ||"
-"ᾑ|ἡι|ἩΙ||"
-"ᾒ|ἢι|ἪΙ||"
-"ᾓ|ἣι|ἫΙ||"
-"ᾔ|ἤι|ἬΙ||"
-"ᾕ|ἥι|ἭΙ||"
-"ᾖ|ἦι|ἮΙ||"
-"ᾗ|ἧι|ἯΙ||"
-"ᾘ|ἠι|ἨΙ|ᾐ|"
-"ᾙ|ἡι|ἩΙ|ᾑ|"
-"ᾚ|ἢι|ἪΙ|ᾒ|"
-"ᾛ|ἣι|ἫΙ|ᾓ|"
-"ᾜ|ἤι|ἬΙ|ᾔ|"
-"ᾝ|ἥι|ἭΙ|ᾕ|"
-"ᾞ|ἦι|ἮΙ|ᾖ|"
-"ᾟ|ἧι|ἯΙ|ᾗ|"
-"ᾠ|ὠι|ὨΙ||"
-"ᾡ|ὡι|ὩΙ||"
-"ᾢ|ὢι|ὪΙ||"
-"ᾣ|ὣι|ὫΙ||"
-"ᾤ|ὤι|ὬΙ||"
-"ᾥ|ὥι|ὭΙ||"
-"ᾦ|ὦι|ὮΙ||"
-"ᾧ|ὧι|ὯΙ||"
-"ᾨ|ὠι|ὨΙ|ᾠ|"
-"ᾩ|ὡι|ὩΙ|ᾡ|"
-"ᾪ|ὢι|ὪΙ|ᾢ|"
-"ᾫ|ὣι|ὫΙ|ᾣ|"
-"ᾬ|ὤι|ὬΙ|ᾤ|"
-"ᾭ|ὥι|ὭΙ|ᾥ|"
-"ᾮ|ὦι|ὮΙ|ᾦ|"
-"ᾯ|ὧι|ὯΙ|ᾧ|"
-"ᾲ|ὰι|ᾺΙ||"
-"ᾳ|αι|ΑΙ||"
-"ᾴ|άι|ΆΙ||"
-"ᾶ|ᾶ|Α͂||"
-"ᾷ|ᾶι|Α͂Ι||"
-"ᾼ|αι|ΑΙ|ᾳ|"
-"ι|ι|Ι||"
-"ῂ|ὴι|ῊΙ||"
-"ῃ|ηι|ΗΙ||"
-"ῄ|ήι|ΉΙ||"
-"ῆ|ῆ|Η͂||"
-"ῇ|ῆι|Η͂Ι||"
-"ῌ|ηι|ΗΙ|ῃ|"
-"ῒ|ῒ|Ϊ̀||"
-"ΐ|ΐ|Ϊ́||"
-"ῖ|ῖ|Ι͂||"
-"ῗ|ῗ|Ϊ͂||"
-"ῢ|ῢ|Ϋ̀||"
-"ΰ|ΰ|Ϋ́||"
-"ῤ|ῤ|Ρ̓||"
-"ῦ|ῦ|Υ͂||"
-"ῧ|ῧ|Ϋ͂||"
-"ῲ|ὼι|ῺΙ||"
-"ῳ|ωι|ΩΙ||"
-"ῴ|ώι|ΏΙ||"
-"ῶ|ῶ|Ω͂||"
-"ῷ|ῶι|Ω͂Ι||"
-"ῼ|ωι|ΩΙ|ῳ|"
-"Ω|ω||ω|"
-"K|k||k|"
-"Å|å||å|"
-"ff|ff|FF||"
-"fi|fi|FI||"
-"fl|fl|FL||"
-"ffi|ffi|FFI||"
-"ffl|ffl|FFL||"
-"ſt|st|ST||"
-"st|st|ST||"
-"ﬓ|մն|ՄՆ||"
-"ﬔ|մե|ՄԵ||"
-"ﬕ|մի|ՄԻ||"
-"ﬖ|վն|ՎՆ||"
-"ﬗ|մխ|ՄԽ||"
+"\xc2\xb5|\xce\xbc|\xce\x9c||"
+"\xc3\x9f|ss|SS||"
+"\xc4\xb0|i\xcc\x87||i\xcc\x87|"
+"\xc4\xb1||I||"
+"\xc5\x89|\xca\xbcn|\xca\xbcN||"
+"\xc5\xbf|s|S||"
+"\xc7\x85|\xc7\x86|\xc7\x84|\xc7\x86|"
+"\xc7\x88|\xc7\x89|\xc7\x87|\xc7\x89|"
+"\xc7\x8b|\xc7\x8c|\xc7\x8a|\xc7\x8c|"
+"\xc7\xb0|j\xcc\x8c|J\xcc\x8c||"
+"\xc7\xb2|\xc7\xb3|\xc7\xb1|\xc7\xb3|"
+"\xcd\x85|\xce\xb9|\xce\x99||"
+"\xce\x90|\xce\xb9\xcc\x88\xcc\x81|\xce\x99\xcc\x88\xcc\x81||"
+"\xce\xb0|\xcf\x85\xcc\x88\xcc\x81|\xce\xa5\xcc\x88\xcc\x81||"
+"\xcf\x82|\xcf\x83|\xce\xa3||"
+"\xcf\x90|\xce\xb2|\xce\x92||"
+"\xcf\x91|\xce\xb8|\xce\x98||"
+"\xcf\x95|\xcf\x86|\xce\xa6||"
+"\xcf\x96|\xcf\x80|\xce\xa0||"
+"\xcf\xb0|\xce\xba|\xce\x9a||"
+"\xcf\xb1|\xcf\x81|\xce\xa1||"
+"\xcf\xb4|\xce\xb8||\xce\xb8|"
+"\xcf\xb5|\xce\xb5|\xce\x95||"
+"\xd6\x87|\xd5\xa5\xd6\x82|\xd4\xb5\xd5\x92||"
+"\xe1\xba\x96|h\xcc\xb1|H\xcc\xb1||"
+"\xe1\xba\x97|t\xcc\x88|T\xcc\x88||"
+"\xe1\xba\x98|w\xcc\x8a|W\xcc\x8a||"
+"\xe1\xba\x99|y\xcc\x8a|Y\xcc\x8a||"
+"\xe1\xba\x9a|a\xca\xbe|A\xca\xbe||"
+"\xe1\xba\x9b|\xe1\xb9\xa1|\xe1\xb9\xa0||"
+"\xe1\xba\x9e|ss||\xc3\x9f|"
+"\xe1\xbd\x90|\xcf\x85\xcc\x93|\xce\xa5\xcc\x93||"
+"\xe1\xbd\x92|\xcf\x85\xcc\x93\xcc\x80|\xce\xa5\xcc\x93\xcc\x80||"
+"\xe1\xbd\x94|\xcf\x85\xcc\x93\xcc\x81|\xce\xa5\xcc\x93\xcc\x81||"
+"\xe1\xbd\x96|\xcf\x85\xcc\x93\xcd\x82|\xce\xa5\xcc\x93\xcd\x82||"
+"\xe1\xbe\x80|\xe1\xbc\x80\xce\xb9|\xe1\xbc\x88\xce\x99||"
+"\xe1\xbe\x81|\xe1\xbc\x81\xce\xb9|\xe1\xbc\x89\xce\x99||"
+"\xe1\xbe\x82|\xe1\xbc\x82\xce\xb9|\xe1\xbc\x8a\xce\x99||"
+"\xe1\xbe\x83|\xe1\xbc\x83\xce\xb9|\xe1\xbc\x8b\xce\x99||"
+"\xe1\xbe\x84|\xe1\xbc\x84\xce\xb9|\xe1\xbc\x8c\xce\x99||"
+"\xe1\xbe\x85|\xe1\xbc\x85\xce\xb9|\xe1\xbc\x8d\xce\x99||"
+"\xe1\xbe\x86|\xe1\xbc\x86\xce\xb9|\xe1\xbc\x8e\xce\x99||"
+"\xe1\xbe\x87|\xe1\xbc\x87\xce\xb9|\xe1\xbc\x8f\xce\x99||"
+"\xe1\xbe\x88|\xe1\xbc\x80\xce\xb9|\xe1\xbc\x88\xce\x99|\xe1\xbe\x80|"
+"\xe1\xbe\x89|\xe1\xbc\x81\xce\xb9|\xe1\xbc\x89\xce\x99|\xe1\xbe\x81|"
+"\xe1\xbe\x8a|\xe1\xbc\x82\xce\xb9|\xe1\xbc\x8a\xce\x99|\xe1\xbe\x82|"
+"\xe1\xbe\x8b|\xe1\xbc\x83\xce\xb9|\xe1\xbc\x8b\xce\x99|\xe1\xbe\x83|"
+"\xe1\xbe\x8c|\xe1\xbc\x84\xce\xb9|\xe1\xbc\x8c\xce\x99|\xe1\xbe\x84|"
+"\xe1\xbe\x8d|\xe1\xbc\x85\xce\xb9|\xe1\xbc\x8d\xce\x99|\xe1\xbe\x85|"
+"\xe1\xbe\x8e|\xe1\xbc\x86\xce\xb9|\xe1\xbc\x8e\xce\x99|\xe1\xbe\x86|"
+"\xe1\xbe\x8f|\xe1\xbc\x87\xce\xb9|\xe1\xbc\x8f\xce\x99|\xe1\xbe\x87|"
+"\xe1\xbe\x90|\xe1\xbc\xa0\xce\xb9|\xe1\xbc\xa8\xce\x99||"
+"\xe1\xbe\x91|\xe1\xbc\xa1\xce\xb9|\xe1\xbc\xa9\xce\x99||"
+"\xe1\xbe\x92|\xe1\xbc\xa2\xce\xb9|\xe1\xbc\xaa\xce\x99||"
+"\xe1\xbe\x93|\xe1\xbc\xa3\xce\xb9|\xe1\xbc\xab\xce\x99||"
+"\xe1\xbe\x94|\xe1\xbc\xa4\xce\xb9|\xe1\xbc\xac\xce\x99||"
+"\xe1\xbe\x95|\xe1\xbc\xa5\xce\xb9|\xe1\xbc\xad\xce\x99||"
+"\xe1\xbe\x96|\xe1\xbc\xa6\xce\xb9|\xe1\xbc\xae\xce\x99||"
+"\xe1\xbe\x97|\xe1\xbc\xa7\xce\xb9|\xe1\xbc\xaf\xce\x99||"
+"\xe1\xbe\x98|\xe1\xbc\xa0\xce\xb9|\xe1\xbc\xa8\xce\x99|\xe1\xbe\x90|"
+"\xe1\xbe\x99|\xe1\xbc\xa1\xce\xb9|\xe1\xbc\xa9\xce\x99|\xe1\xbe\x91|"
+"\xe1\xbe\x9a|\xe1\xbc\xa2\xce\xb9|\xe1\xbc\xaa\xce\x99|\xe1\xbe\x92|"
+"\xe1\xbe\x9b|\xe1\xbc\xa3\xce\xb9|\xe1\xbc\xab\xce\x99|\xe1\xbe\x93|"
+"\xe1\xbe\x9c|\xe1\xbc\xa4\xce\xb9|\xe1\xbc\xac\xce\x99|\xe1\xbe\x94|"
+"\xe1\xbe\x9d|\xe1\xbc\xa5\xce\xb9|\xe1\xbc\xad\xce\x99|\xe1\xbe\x95|"
+"\xe1\xbe\x9e|\xe1\xbc\xa6\xce\xb9|\xe1\xbc\xae\xce\x99|\xe1\xbe\x96|"
+"\xe1\xbe\x9f|\xe1\xbc\xa7\xce\xb9|\xe1\xbc\xaf\xce\x99|\xe1\xbe\x97|"
+"\xe1\xbe\xa0|\xe1\xbd\xa0\xce\xb9|\xe1\xbd\xa8\xce\x99||"
+"\xe1\xbe\xa1|\xe1\xbd\xa1\xce\xb9|\xe1\xbd\xa9\xce\x99||"
+"\xe1\xbe\xa2|\xe1\xbd\xa2\xce\xb9|\xe1\xbd\xaa\xce\x99||"
+"\xe1\xbe\xa3|\xe1\xbd\xa3\xce\xb9|\xe1\xbd\xab\xce\x99||"
+"\xe1\xbe\xa4|\xe1\xbd\xa4\xce\xb9|\xe1\xbd\xac\xce\x99||"
+"\xe1\xbe\xa5|\xe1\xbd\xa5\xce\xb9|\xe1\xbd\xad\xce\x99||"
+"\xe1\xbe\xa6|\xe1\xbd\xa6\xce\xb9|\xe1\xbd\xae\xce\x99||"
+"\xe1\xbe\xa7|\xe1\xbd\xa7\xce\xb9|\xe1\xbd\xaf\xce\x99||"
+"\xe1\xbe\xa8|\xe1\xbd\xa0\xce\xb9|\xe1\xbd\xa8\xce\x99|\xe1\xbe\xa0|"
+"\xe1\xbe\xa9|\xe1\xbd\xa1\xce\xb9|\xe1\xbd\xa9\xce\x99|\xe1\xbe\xa1|"
+"\xe1\xbe\xaa|\xe1\xbd\xa2\xce\xb9|\xe1\xbd\xaa\xce\x99|\xe1\xbe\xa2|"
+"\xe1\xbe\xab|\xe1\xbd\xa3\xce\xb9|\xe1\xbd\xab\xce\x99|\xe1\xbe\xa3|"
+"\xe1\xbe\xac|\xe1\xbd\xa4\xce\xb9|\xe1\xbd\xac\xce\x99|\xe1\xbe\xa4|"
+"\xe1\xbe\xad|\xe1\xbd\xa5\xce\xb9|\xe1\xbd\xad\xce\x99|\xe1\xbe\xa5|"
+"\xe1\xbe\xae|\xe1\xbd\xa6\xce\xb9|\xe1\xbd\xae\xce\x99|\xe1\xbe\xa6|"
+"\xe1\xbe\xaf|\xe1\xbd\xa7\xce\xb9|\xe1\xbd\xaf\xce\x99|\xe1\xbe\xa7|"
+"\xe1\xbe\xb2|\xe1\xbd\xb0\xce\xb9|\xe1\xbe\xba\xce\x99||"
+"\xe1\xbe\xb3|\xce\xb1\xce\xb9|\xce\x91\xce\x99||"
+"\xe1\xbe\xb4|\xce\xac\xce\xb9|\xce\x86\xce\x99||"
+"\xe1\xbe\xb6|\xce\xb1\xcd\x82|\xce\x91\xcd\x82||"
+"\xe1\xbe\xb7|\xce\xb1\xcd\x82\xce\xb9|\xce\x91\xcd\x82\xce\x99||"
+"\xe1\xbe\xbc|\xce\xb1\xce\xb9|\xce\x91\xce\x99|\xe1\xbe\xb3|"
+"\xe1\xbe\xbe|\xce\xb9|\xce\x99||"
+"\xe1\xbf\x82|\xe1\xbd\xb4\xce\xb9|\xe1\xbf\x8a\xce\x99||"
+"\xe1\xbf\x83|\xce\xb7\xce\xb9|\xce\x97\xce\x99||"
+"\xe1\xbf\x84|\xce\xae\xce\xb9|\xce\x89\xce\x99||"
+"\xe1\xbf\x86|\xce\xb7\xcd\x82|\xce\x97\xcd\x82||"
+"\xe1\xbf\x87|\xce\xb7\xcd\x82\xce\xb9|\xce\x97\xcd\x82\xce\x99||"
+"\xe1\xbf\x8c|\xce\xb7\xce\xb9|\xce\x97\xce\x99|\xe1\xbf\x83|"
+"\xe1\xbf\x92|\xce\xb9\xcc\x88\xcc\x80|\xce\x99\xcc\x88\xcc\x80||"
+"\xe1\xbf\x93|\xce\xb9\xcc\x88\xcc\x81|\xce\x99\xcc\x88\xcc\x81||"
+"\xe1\xbf\x96|\xce\xb9\xcd\x82|\xce\x99\xcd\x82||"
+"\xe1\xbf\x97|\xce\xb9\xcc\x88\xcd\x82|\xce\x99\xcc\x88\xcd\x82||"
+"\xe1\xbf\xa2|\xcf\x85\xcc\x88\xcc\x80|\xce\xa5\xcc\x88\xcc\x80||"
+"\xe1\xbf\xa3|\xcf\x85\xcc\x88\xcc\x81|\xce\xa5\xcc\x88\xcc\x81||"
+"\xe1\xbf\xa4|\xcf\x81\xcc\x93|\xce\xa1\xcc\x93||"
+"\xe1\xbf\xa6|\xcf\x85\xcd\x82|\xce\xa5\xcd\x82||"
+"\xe1\xbf\xa7|\xcf\x85\xcc\x88\xcd\x82|\xce\xa5\xcc\x88\xcd\x82||"
+"\xe1\xbf\xb2|\xe1\xbd\xbc\xce\xb9|\xe1\xbf\xba\xce\x99||"
+"\xe1\xbf\xb3|\xcf\x89\xce\xb9|\xce\xa9\xce\x99||"
+"\xe1\xbf\xb4|\xcf\x8e\xce\xb9|\xce\x8f\xce\x99||"
+"\xe1\xbf\xb6|\xcf\x89\xcd\x82|\xce\xa9\xcd\x82||"
+"\xe1\xbf\xb7|\xcf\x89\xcd\x82\xce\xb9|\xce\xa9\xcd\x82\xce\x99||"
+"\xe1\xbf\xbc|\xcf\x89\xce\xb9|\xce\xa9\xce\x99|\xe1\xbf\xb3|"
+"\xe2\x84\xa6|\xcf\x89||\xcf\x89|"
+"\xe2\x84\xaa|k||k|"
+"\xe2\x84\xab|\xc3\xa5||\xc3\xa5|"
+"\xef\xac\x80|ff|FF||"
+"\xef\xac\x81|fi|FI||"
+"\xef\xac\x82|fl|FL||"
+"\xef\xac\x83|ffi|FFI||"
+"\xef\xac\x84|ffl|FFL||"
+"\xef\xac\x85|st|ST||"
+"\xef\xac\x86|st|ST||"
+"\xef\xac\x93|\xd5\xb4\xd5\xb6|\xd5\x84\xd5\x86||"
+"\xef\xac\x94|\xd5\xb4\xd5\xa5|\xd5\x84\xd4\xb5||"
+"\xef\xac\x95|\xd5\xb4\xd5\xab|\xd5\x84\xd4\xbb||"
+"\xef\xac\x96|\xd5\xbe\xd5\xb6|\xd5\x8e\xd5\x86||"
+"\xef\xac\x97|\xd5\xb4\xd5\xad|\xd5\x84\xd4\xbd||"
//--Autogenerated -- end of section automatically generated
;
@@ -382,7 +382,7 @@ class CaseConverter : public ICaseConverter {
};
typedef std::vector<CharacterConversion> CharacterToConversion;
CharacterToConversion characterToConversion;
- // The parallel arrays
+ // The parallel arrays
std::vector<int> characters;
std::vector<ConversionString> conversions;
diff --git a/scintilla/src/Catalogue.cxx b/scintilla/src/Catalogue.cxx
index fc06738..c9e3114 100644
--- a/scintilla/src/Catalogue.cxx
+++ b/scintilla/src/Catalogue.cxx
@@ -1,5 +1,5 @@
// Scintilla source code edit control
-/** @file KeyWords.cxx
+/** @file Catalogue.cxx
** Colourise for particular languages.
**/
// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
@@ -7,8 +7,8 @@
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <stdio.h>
+#include <ctype.h>
#include <stdarg.h>
#include <assert.h>
@@ -60,11 +60,6 @@ void Catalogue::AddLexerModule(LexerModule *plm) {
lexerCatalogue.push_back(plm);
}
-// Alternative historical name for Scintilla_LinkLexers
-int wxForceScintillaLexers(void) {
- return Scintilla_LinkLexers();
-}
-
// To add or remove a lexer, add or remove its file and run LexGen.py.
// Force a reference to all of the Scintilla lexers so that the linker will
@@ -79,12 +74,11 @@ int Scintilla_LinkLexers() {
// Shorten the code that declares a lexer and ensures it is linked in by calling a method.
#define LINK_LEXER(lexer) extern LexerModule lexer; Catalogue::AddLexerModule(&lexer);
-//++Autogenerated -- run src/LexGen.py to regenerate
+//++Autogenerated -- run scripts/LexGen.py to regenerate
//**\(\tLINK_LEXER(\*);\n\)
//LINK_LEXER(lmA68k);
//LINK_LEXER(lmAbaqus);
//LINK_LEXER(lmAda);
- LINK_LEXER(lmAHK);
//LINK_LEXER(lmAPDL);
LINK_LEXER(lmAsm);
//LINK_LEXER(lmAsn1);
@@ -127,6 +121,7 @@ int Scintilla_LinkLexers() {
LINK_LEXER(lmHTML);
LINK_LEXER(lmInno);
//LINK_LEXER(lmKix);
+ //LINK_LEXER(lmKVIrc);
LINK_LEXER(lmLatex);
//LINK_LEXER(lmLISP);
//LINK_LEXER(lmLiterateHaskell);
diff --git a/scintilla/src/CellBuffer.cxx b/scintilla/src/CellBuffer.cxx
index 7d322a9..e80e4f5 100644
--- a/scintilla/src/CellBuffer.cxx
+++ b/scintilla/src/CellBuffer.cxx
@@ -5,9 +5,9 @@
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
-#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
#include <stdarg.h>
#include <algorithm>
diff --git a/scintilla/src/Decoration.cxx b/scintilla/src/Decoration.cxx
index 955ff4f..dde4223 100644
--- a/scintilla/src/Decoration.cxx
+++ b/scintilla/src/Decoration.cxx
@@ -4,9 +4,9 @@
// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
-#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
#include <stdarg.h>
#include <algorithm>
diff --git a/scintilla/src/Document.cxx b/scintilla/src/Document.cxx
index 64f6b46..9ee5e32 100644
--- a/scintilla/src/Document.cxx
+++ b/scintilla/src/Document.cxx
@@ -38,7 +38,7 @@ using namespace Scintilla;
#endif
static inline bool IsPunctuation(char ch) {
- return isascii(ch) && ispunct(ch);
+ return IsASCII(ch) && ispunct(ch);
}
void LexInterface::Colourise(int start, int end) {
@@ -825,7 +825,7 @@ int Document::SafeSegment(const char *text, int length, int lengthSegment) const
return length;
int lastSpaceBreak = -1;
int lastPunctuationBreak = -1;
- int lastEncodingAllowedBreak = -1;
+ int lastEncodingAllowedBreak = 0;
for (int j=0; j < lengthSegment;) {
unsigned char ch = static_cast<unsigned char>(text[j]);
if (j > 0) {
@@ -854,6 +854,15 @@ int Document::SafeSegment(const char *text, int length, int lengthSegment) const
return lastEncodingAllowedBreak;
}
+EncodingFamily Document::CodePageFamily() const {
+ if (SC_CP_UTF8 == dbcsCodePage)
+ return efUnicode;
+ else if (dbcsCodePage)
+ return efDBCS;
+ else
+ return efEightBit;
+}
+
void Document::ModifiedAt(int pos) {
if (endStyled > pos)
endStyled = pos;
@@ -1965,10 +1974,10 @@ int Document::WordPartLeft(int pos) {
--pos;
if (!isspacechar(cb.CharAt(pos)))
++pos;
- } else if (!isascii(startChar)) {
- while (pos > 0 && !isascii(cb.CharAt(pos)))
+ } else if (!IsASCII(startChar)) {
+ while (pos > 0 && !IsASCII(cb.CharAt(pos)))
--pos;
- if (isascii(cb.CharAt(pos)))
+ if (IsASCII(cb.CharAt(pos)))
++pos;
} else {
++pos;
@@ -1986,8 +1995,8 @@ int Document::WordPartRight(int pos) {
++pos;
startChar = cb.CharAt(pos);
}
- if (!isascii(startChar)) {
- while (pos < length && !isascii(cb.CharAt(pos)))
+ if (!IsASCII(startChar)) {
+ while (pos < length && !IsASCII(cb.CharAt(pos)))
++pos;
} else if (IsLowerCase(startChar)) {
while (pos < length && IsLowerCase(cb.CharAt(pos)))
diff --git a/scintilla/src/Document.h b/scintilla/src/Document.h
index 94e288e..3a8f01f 100644
--- a/scintilla/src/Document.h
+++ b/scintilla/src/Document.h
@@ -19,6 +19,8 @@ namespace Scintilla {
typedef int Position;
const Position invalidPosition = -1;
+enum EncodingFamily { efEightBit, efUnicode, efDBCS };
+
/**
* The range class represents a range of text in a document.
* The two values are not sorted as one end may be more significant than the other
@@ -266,6 +268,7 @@ public:
int SCI_METHOD CodePage() const;
bool SCI_METHOD IsDBCSLeadByte(char ch) const;
int SafeSegment(const char *text, int length, int lengthSegment) const;
+ EncodingFamily CodePageFamily() const;
// Gateways to modifying document
void ModifiedAt(int pos);
diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx
index 6bf8c5d..a8dcfaf 100644
--- a/scintilla/src/Editor.cxx
+++ b/scintilla/src/Editor.cxx
@@ -101,6 +101,12 @@ static inline bool IsAllSpacesOrTabs(char *s, unsigned int len) {
return true;
}
+PrintParameters::PrintParameters() {
+ magnification = 0;
+ colourMode = SC_PRINT_NORMAL;
+ wrapState = eWrapWord;
+}
+
Editor::Editor() {
ctrlID = 0;
@@ -108,11 +114,7 @@ Editor::Editor() {
technology = SC_TECHNOLOGY_DEFAULT;
scaleRGBAImage = 100;
- printMagnification = 0;
- printColourMode = SC_PRINT_NORMAL;
- printWrapState = eWrapWord;
cursorMode = SC_CURSORNORMAL;
- controlCharSymbol = 0; /* Draw the control characters */
hasFocus = false;
hideSelection = false;
@@ -167,6 +169,7 @@ Editor::Editor() {
endAtLastLine = true;
caretSticky = SC_CARETSTICKY_OFF;
marginOptions = SC_MARGINOPTION_NONE;
+ mouseSelectionRectangularSwitch = false;
multipleSelection = false;
additionalSelectionTyping = false;
multiPasteMode = SC_MULTIPASTE_ONCE;
@@ -197,9 +200,9 @@ Editor::Editor() {
bracesMatchStyle = STYLE_BRACEBAD;
highlightGuideColumn = 0;
- theEdge = 0;
-
paintState = notPainting;
+ paintAbandonedByStyling = false;
+ paintingAllText = false;
willRedrawAll = false;
modEventMask = SC_MODEVENTMASKALL;
@@ -212,24 +215,17 @@ Editor::Editor() {
foldFlags = 0;
foldAutomatic = 0;
- wrapState = eWrapNone;
wrapWidth = LineLayout::wrapWidthInfinite;
- wrapVisualFlags = 0;
- wrapVisualFlagsLocation = 0;
- wrapVisualStartIndent = 0;
- wrapIndentMode = SC_WRAPINDENT_FIXED;
convertPastes = true;
- marginNumberPadding = 3;
- ctrlCharPadding = 3; // +3 For a blank on front and rounded edge each side
- lastSegItalicsOffset = 2;
-
hsStart = -1;
hsEnd = -1;
llc.SetLevel(LineLayoutCache::llcCaret);
posCache.SetSize(0x400);
+
+ SetRepresentations();
}
Editor::~Editor() {
@@ -244,6 +240,47 @@ void Editor::Finalise() {
CancelModes();
}
+void Editor::SetRepresentations() {
+ reprs.Clear();
+
+ // C0 control set
+ const char *reps[] = {
+ "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
+ "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI",
+ "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
+ "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US"
+ };
+ for (size_t j=0; j < (sizeof(reps) / sizeof(reps[0])); j++) {
+ char c[2] = { static_cast<char>(j), 0 };
+ reprs.SetRepresentation(c, reps[j]);
+ }
+
+ // C1 control set
+ // As well as Unicode mode, ISO-8859-1 should use these
+ if (IsUnicodeMode()) {
+ const char *repsC1[] = {
+ "PAD", "HOP", "BPH", "NBH", "IND", "NEL", "SSA", "ESA",
+ "HTS", "HTJ", "VTS", "PLD", "PLU", "RI", "SS2", "SS3",
+ "DCS", "PU1", "PU2", "STS", "CCH", "MW", "SPA", "EPA",
+ "SOS", "SGCI", "SCI", "CSI", "ST", "OSC", "PM", "APC"
+ };
+ for (size_t j=0; j < (sizeof(repsC1) / sizeof(repsC1[0])); j++) {
+ char c1[3] = { '\xc2', static_cast<char>(0x80+j), 0 };
+ reprs.SetRepresentation(c1, repsC1[j]);
+ }
+ }
+
+ // UTF-8 invalid bytes
+ if (IsUnicodeMode()) {
+ for (int k=0x80; k < 0x100; k++) {
+ char hiByte[2] = { static_cast<char>(k), 0 };
+ char hexits[4];
+ sprintf(hexits, "x%2X", k);
+ reprs.SetRepresentation(hiByte, hexits);
+ }
+ }
+}
+
void Editor::DropGraphics(bool freeObjects) {
if (freeObjects) {
delete pixmapLine;
@@ -309,7 +346,7 @@ void Editor::RefreshStyleData() {
stylesValid = true;
AutoSurface surface(this);
if (surface) {
- vs.Refresh(*surface);
+ vs.Refresh(*surface, pdoc->tabInChars);
}
SetScrollBars();
SetRectangularRange();
@@ -944,6 +981,7 @@ int Editor::MovePositionTo(SelectionPosition newPos, Selection::selTypes selt, b
}
if (!sel.IsRectangular() && (selt == Selection::selRectangle)) {
// Switching to rectangular
+ InvalidateSelection(sel.RangeMain(), false);
SelectionRange rangeMain = sel.RangeMain();
sel.Clear();
sel.Rectangular() = rangeMain;
@@ -1059,7 +1097,7 @@ void Editor::HorizontalScrollTo(int xPos) {
//Platform::DebugPrintf("HorizontalScroll %d\n", xPos);
if (xPos < 0)
xPos = 0;
- if ((wrapState == eWrapNone) && (xOffset != xPos)) {
+ if (!Wrapping() && (xOffset != xPos)) {
xOffset = xPos;
ContainerNeedsUpdate(SC_UPDATE_H_SCROLL);
SetHorizontalScrollPos();
@@ -1353,7 +1391,7 @@ Editor::XYScrollPosition Editor::XYScrollToMakeVisible(const SelectionRange rang
}
// Horizontal positioning
- if ((options & xysHorizontal) && (wrapState == eWrapNone)) {
+ if ((options & xysHorizontal) && !Wrapping()) {
const int halfScreen = Platform::Maximum(rcClient.Width() - 4, 4) / 2;
const bool bSlop = (caretXPolicy & CARET_SLOP) != 0;
const bool bStrict = (caretXPolicy & CARET_STRICT) != 0;
@@ -1540,13 +1578,17 @@ void Editor::InvalidateCaret() {
void Editor::UpdateSystemCaret() {
}
+bool Editor::Wrapping() const {
+ return vs.wrapState != eWrapNone;
+}
+
void Editor::NeedWrapping(int docLineStart, int docLineEnd) {
//Platform::DebugPrintf("\nNeedWrapping: %0d..%0d\n", docLineStart, docLineEnd);
if (wrapPending.AddRange(docLineStart, docLineEnd)) {
llc.Invalidate(LineLayout::llPositions);
}
// Wrap lines during idle.
- if ((wrapState != eWrapNone) && wrapPending.NeedsWrap()) {
+ if (Wrapping() && wrapPending.NeedsWrap()) {
SetIdle(true);
}
}
@@ -1570,7 +1612,7 @@ bool Editor::WrapOneLine(Surface *surface, int lineToWrap) {
bool Editor::WrapLines(enum wrapScope ws) {
int goodTopLine = topLine;
bool wrapOccurred = false;
- if (wrapState == eWrapNone) {
+ if (!Wrapping()) {
if (wrapWidth != LineLayout::wrapWidthInfinite) {
wrapWidth = LineLayout::wrapWidthInfinite;
for (int lineDoc = 0; lineDoc < pdoc->LinesTotal(); lineDoc++) {
@@ -2030,13 +2072,13 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
PRectangle rcNumber = rcMarker;
// Right justify
XYPOSITION width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, istrlen(number));
- XYPOSITION xpos = rcNumber.right - width - marginNumberPadding;
+ XYPOSITION xpos = rcNumber.right - width - vs.marginNumberPadding;
rcNumber.left = xpos;
surface->DrawTextNoClip(rcNumber, vs.styles[STYLE_LINENUMBER].font,
rcNumber.top + vs.maxAscent, number, istrlen(number),
vs.styles[STYLE_LINENUMBER].fore,
vs.styles[STYLE_LINENUMBER].back);
- } else if (wrapVisualFlags & SC_WRAPVISUALFLAG_MARGIN) {
+ } else if (vs.wrapVisualFlags & SC_WRAPVISUALFLAG_MARGIN) {
PRectangle rcWrapMarker = rcMarker;
rcWrapMarker.right -= 3;
rcWrapMarker.left = rcWrapMarker.right - vs.styles[STYLE_LINENUMBER].aveCharWidth;
@@ -2127,27 +2169,13 @@ LineLayout *Editor::RetrieveLineLayout(int lineNumber) {
LinesOnScreen() + 1, pdoc->LinesTotal());
}
-bool BadUTF(const char *s, int len, int &trailBytes) {
- // For the rules: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- if (trailBytes) {
- trailBytes--;
- return false;
- }
- int utf8status = UTF8Classify(reinterpret_cast<const unsigned char *>(s), len);
- if (utf8status & UTF8MaskInvalid) {
- return true;
- } else {
- trailBytes = (utf8status & UTF8MaskWidth) - 1;
- return false;
- }
-}
-
/**
* Fill in the LineLayout data for the given line.
* Copy the given @a line and its styles from the document into local arrays.
* Also determine the x position at which each character starts.
*/
void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll, int width) {
+//void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll, int width, Document *pdoc, PositionCache &posCache, SpecialRepresentations &reprs) {
if (!ll)
return;
@@ -2204,7 +2232,7 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
ll->widthLine = LineLayout::wrapWidthInfinite;
ll->lines = 1;
if (vstyle.edgeState == EDGE_BACKGROUND) {
- ll->edgeColumn = pdoc->FindColumn(line, theEdge);
+ ll->edgeColumn = pdoc->FindColumn(line, vstyle.theEdge);
if (ll->edgeColumn >= posLineStart) {
ll->edgeColumn -= posLineStart;
}
@@ -2245,75 +2273,52 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
// Layout the line, determining the position of each character,
// with an extra element at the end for the end of the line.
- int startseg = 0; // Start of the current segment, in char. number
- XYACCUMULATOR startsegx = 0; // Start of the current segment, in pixels
ll->positions[0] = 0;
- XYPOSITION tabWidth = vstyle.spaceWidth * pdoc->tabInChars;
bool lastSegItalics = false;
- Font &ctrlCharsFont = vstyle.styles[STYLE_CONTROLCHAR].font;
-
- XYPOSITION ctrlCharWidth[32] = {0};
- bool isControlNext = IsControlCharacter(ll->chars[0]);
- int trailBytes = 0;
- bool isBadUTFNext = IsUnicodeMode() && BadUTF(ll->chars, numCharsInLine, trailBytes);
- for (int charInLine = 0; charInLine < numCharsInLine; charInLine++) {
- bool isControl = isControlNext;
- isControlNext = IsControlCharacter(ll->chars[charInLine + 1]);
- bool isBadUTF = isBadUTFNext;
- isBadUTFNext = IsUnicodeMode() && BadUTF(ll->chars + charInLine + 1, numCharsInLine - charInLine - 1, trailBytes);
- if ((ll->styles[charInLine] != ll->styles[charInLine + 1]) ||
- isControl || isControlNext || isBadUTF || isBadUTFNext || ((charInLine+1) >= numCharsBeforeEOL)) {
- ll->positions[startseg] = 0;
- if (vstyle.styles[ll->styles[charInLine]].visible) {
- if (isControl) {
- if (ll->chars[charInLine] == '\t') {
- ll->positions[charInLine + 1] =
- ((static_cast<int>((startsegx + 2) / tabWidth) + 1) * tabWidth) - startsegx;
- } else if (controlCharSymbol < 32) {
- if (ctrlCharWidth[ll->chars[charInLine]] == 0) {
- const char *ctrlChar = ControlCharacterString(ll->chars[charInLine]);
- ctrlCharWidth[ll->chars[charInLine]] =
- surface->WidthText(ctrlCharsFont, ctrlChar, istrlen(ctrlChar)) + ctrlCharPadding;
- }
- ll->positions[charInLine + 1] = ctrlCharWidth[ll->chars[charInLine]];
- } else {
- char cc[2] = { static_cast<char>(controlCharSymbol), '\0' };
- surface->MeasureWidths(ctrlCharsFont, cc, 1,
- ll->positions + startseg + 1);
- }
- lastSegItalics = false;
- } else if ((isBadUTF) || (charInLine >= numCharsBeforeEOL)) {
- char hexits[4];
- sprintf(hexits, "x%2X", ll->chars[charInLine] & 0xff);
- ll->positions[charInLine + 1] =
- surface->WidthText(ctrlCharsFont, hexits, istrlen(hexits)) + 3;
- } else { // Regular character
- int lenSeg = charInLine - startseg + 1;
- if ((lenSeg == 1) && (' ' == ll->chars[startseg])) {
- lastSegItalics = false;
- // Over half the segments are single characters and of these about half are space characters.
- ll->positions[charInLine + 1] = vstyle.styles[ll->styles[charInLine]].spaceWidth;
- } else {
- lastSegItalics = vstyle.styles[ll->styles[charInLine]].italic;
- posCache.MeasureWidths(surface, vstyle, ll->styles[charInLine], ll->chars + startseg,
- lenSeg, ll->positions + startseg + 1, pdoc);
- }
+
+ BreakFinder bfLayout(ll, 0, numCharsInLine, posLineStart, 0, false, pdoc, &reprs);
+ while (bfLayout.More()) {
+
+ const TextSegment ts = bfLayout.Next();
+
+ std::fill(&ll->positions[ts.start+1], &ll->positions[ts.end()+1], 0.0f);
+ if (vstyle.styles[ll->styles[ts.start]].visible) {
+ if (ts.representation) {
+ XYPOSITION representationWidth = vstyle.controlCharWidth;
+ if (ll->chars[ts.start] == '\t') {
+ // Tab is a special case of representation, taking a variable amount of space
+ representationWidth =
+ ((static_cast<int>((ll->positions[ts.start] + 2) / vstyle.tabWidth) + 1) * vstyle.tabWidth) - ll->positions[ts.start];
+ } else {
+ if (representationWidth <= 0.0) {
+ XYPOSITION positionsRepr[256]; // Should expand when needed
+ posCache.MeasureWidths(surface, vstyle, STYLE_CONTROLCHAR, ts.representation->stringRep.c_str(),
+ static_cast<unsigned int>(ts.representation->stringRep.length()), positionsRepr, pdoc);
+ representationWidth = positionsRepr[ts.representation->stringRep.length()-1] + vstyle.ctrlCharPadding;
+ }
}
- } else { // invisible
- for (int posToZero = startseg; posToZero <= (charInLine + 1); posToZero++) {
- ll->positions[posToZero] = 0;
+ for (int ii=0; ii < ts.length; ii++)
+ ll->positions[ts.start + 1 + ii] = representationWidth;
+ } else {
+ if ((ts.length == 1) && (' ' == ll->chars[ts.start])) {
+ // Over half the segments are single characters and of these about half are space characters.
+ ll->positions[ts.start + 1] = vstyle.styles[ll->styles[ts.start]].spaceWidth;
+ } else {
+ posCache.MeasureWidths(surface, vstyle, ll->styles[ts.start], ll->chars + ts.start,
+ ts.length, ll->positions + ts.start + 1, pdoc);
}
}
- for (int posToIncrease = startseg; posToIncrease <= (charInLine + 1); posToIncrease++) {
- ll->positions[posToIncrease] += startsegx;
- }
- startsegx = ll->positions[charInLine + 1];
- startseg = charInLine + 1;
+ lastSegItalics = (!ts.representation) && ((ll->chars[ts.end()-1] != ' ') && vstyle.styles[ll->styles[ts.start]].italic);
+ }
+
+ for (int posToIncrease = ts.start+1; posToIncrease <= ts.end(); posToIncrease++) {
+ ll->positions[posToIncrease] += ll->positions[ts.start];
}
}
+
// Small hack to make lines that end with italics not cut off the edge of the last character
- if ((startseg > 0) && lastSegItalics) {
- ll->positions[startseg] += lastSegItalicsOffset;
+ if (lastSegItalics) {
+ ll->positions[numCharsInLine] += vstyle.lastSegItalicsOffset;
}
ll->numCharsInLine = numCharsInLine;
ll->numCharsBeforeEOL = numCharsBeforeEOL;
@@ -2331,17 +2336,17 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
// Simple common case where line does not need wrapping.
ll->lines = 1;
} else {
- if (wrapVisualFlags & SC_WRAPVISUALFLAG_END) {
+ if (vstyle.wrapVisualFlags & SC_WRAPVISUALFLAG_END) {
width -= static_cast<int>(vstyle.aveCharWidth); // take into account the space for end wrap mark
}
XYPOSITION wrapAddIndent = 0; // This will be added to initial indent of line
- if (wrapIndentMode == SC_WRAPINDENT_INDENT) {
+ if (vstyle.wrapIndentMode == SC_WRAPINDENT_INDENT) {
wrapAddIndent = pdoc->IndentSize() * vstyle.spaceWidth;
- } else if (wrapIndentMode == SC_WRAPINDENT_FIXED) {
- wrapAddIndent = wrapVisualStartIndent * vstyle.aveCharWidth;
+ } else if (vstyle.wrapIndentMode == SC_WRAPINDENT_FIXED) {
+ wrapAddIndent = vstyle.wrapVisualStartIndent * vstyle.aveCharWidth;
}
ll->wrapIndent = wrapAddIndent;
- if (wrapIndentMode != SC_WRAPINDENT_FIXED)
+ if (vstyle.wrapIndentMode != SC_WRAPINDENT_FIXED)
for (int i = 0; i < ll->numCharsInLine; i++) {
if (!IsSpaceOrTab(ll->chars[i])) {
ll->wrapIndent += ll->positions[i]; // Add line indent
@@ -2352,7 +2357,7 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
if (ll->wrapIndent > width - static_cast<int>(vstyle.aveCharWidth) * 15)
ll->wrapIndent = wrapAddIndent;
// Check for wrapIndent minimum
- if ((wrapVisualFlags & SC_WRAPVISUALFLAG_START) && (ll->wrapIndent < vstyle.aveCharWidth))
+ if ((vstyle.wrapVisualFlags & SC_WRAPVISUALFLAG_START) && (ll->wrapIndent < vstyle.aveCharWidth))
ll->wrapIndent = vstyle.aveCharWidth; // Indent to show start visual
ll->lines = 0;
// Calculate line start positions based upon width.
@@ -2384,7 +2389,7 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
continue;
}
if (p > 0) {
- if (wrapState == eWrapChar) {
+ if (vstyle.wrapState == eWrapChar) {
lastGoodBreak = pdoc->MovePositionOutsideChar(p + posLineStart, -1)
- posLineStart;
p = pdoc->MovePositionOutsideChar(p + 1 + posLineStart, 1) - posLineStart;
@@ -2405,18 +2410,18 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
ColourDesired Editor::SelectionBackground(ViewStyle &vsDraw, bool main) const {
return main ?
- (primarySelection ? vsDraw.selbackground : vsDraw.selbackground2) :
+ (primarySelection ? vsDraw.selColours.back : vsDraw.selBackground2) :
vsDraw.selAdditionalBackground;
}
ColourDesired Editor::TextBackground(ViewStyle &vsDraw, bool overrideBackground,
ColourDesired background, int inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll) const {
if (inSelection == 1) {
- if (vsDraw.selbackset && (vsDraw.selAlpha == SC_ALPHA_NOALPHA)) {
+ if (vsDraw.selColours.back.isSet && (vsDraw.selAlpha == SC_ALPHA_NOALPHA)) {
return SelectionBackground(vsDraw, true);
}
} else if (inSelection == 2) {
- if (vsDraw.selbackset && (vsDraw.selAdditionalAlpha == SC_ALPHA_NOALPHA)) {
+ if (vsDraw.selColours.back.isSet && (vsDraw.selAdditionalAlpha == SC_ALPHA_NOALPHA)) {
return SelectionBackground(vsDraw, false);
}
} else {
@@ -2424,8 +2429,8 @@ ColourDesired Editor::TextBackground(ViewStyle &vsDraw, bool overrideBackground,
(i >= ll->edgeColumn) &&
(i < ll->numCharsBeforeEOL))
return vsDraw.edgecolour;
- if (inHotspot && vsDraw.hotspotBackgroundSet)
- return vsDraw.hotspotBackground;
+ if (inHotspot && vsDraw.hotspotColours.back.isSet)
+ return vsDraw.hotspotColours.back;
}
if (overrideBackground && (styleMain != STYLE_BRACELIGHT) && (styleMain != STYLE_BRACEBAD)) {
return background;
@@ -2449,11 +2454,9 @@ void Editor::DrawWrapMarker(Surface *surface, PRectangle rcPlace,
int w = rcPlace.right - rcPlace.left - xa - 1;
bool xStraight = isEndMarker; // x-mirrored symbol for start marker
- bool yStraight = true;
- //bool yStraight= isEndMarker; // comment in for start marker y-mirrowed
int x0 = xStraight ? rcPlace.left : rcPlace.right - 1;
- int y0 = yStraight ? rcPlace.top : rcPlace.bottom - 1;
+ int y0 = rcPlace.top;
int dy = (rcPlace.bottom - rcPlace.top) / 5;
int y = (rcPlace.bottom - rcPlace.top) / 2 + dy;
@@ -2471,7 +2474,7 @@ void Editor::DrawWrapMarker(Surface *surface, PRectangle rcPlace,
surface->LineTo(xBase + xDir * xRelative, yBase + yDir * yRelative);
}
};
- Relative rel = {surface, x0, xStraight ? 1 : -1, y0, yStraight ? 1 : -1};
+ Relative rel = {surface, x0, xStraight ? 1 : -1, y0, 1};
// arrow head
rel.MoveTo(xa, y);
@@ -2585,10 +2588,10 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin
int styleMain = ll->styles[eolPos];
ColourDesired textBack = TextBackground(vsDraw, overrideBackground, background, eolInSelection, false, styleMain, eolPos, ll);
ColourDesired textFore = vsDraw.styles[styleMain].fore;
- if (eolInSelection && vsDraw.selforeset) {
- textFore = (eolInSelection == 1) ? vsDraw.selforeground : vsDraw.selAdditionalForeground;
+ if (eolInSelection && vsDraw.selColours.fore.isSet) {
+ textFore = (eolInSelection == 1) ? vsDraw.selColours.fore : vsDraw.selAdditionalForeground;
}
- if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1)) {
+ if (eolInSelection && vsDraw.selColours.back.isSet && (line < pdoc->LinesTotal() - 1)) {
if (alpha == SC_ALPHA_NOALPHA) {
surface->FillRectangle(rcSegment, SelectionBackground(vsDraw, eolInSelection == 1));
} else {
@@ -2598,7 +2601,7 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin
surface->FillRectangle(rcSegment, textBack);
}
DrawTextBlob(surface, vsDraw, rcSegment, ctrlChar, textBack, textFore, twoPhaseDraw);
- if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1) && (alpha != SC_ALPHA_NOALPHA)) {
+ if (eolInSelection && vsDraw.selColours.back.isSet && (line < pdoc->LinesTotal() - 1) && (alpha != SC_ALPHA_NOALPHA)) {
SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw, eolInSelection == 1), alpha);
}
}
@@ -2608,7 +2611,7 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin
rcSegment.left = xEol + xStart + virtualSpace + blobsWidth;
rcSegment.right = rcSegment.left + vsDraw.aveCharWidth;
- if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1) && (alpha == SC_ALPHA_NOALPHA)) {
+ if (eolInSelection && vsDraw.selColours.back.isSet && (line < pdoc->LinesTotal() - 1) && (alpha == SC_ALPHA_NOALPHA)) {
surface->FillRectangle(rcSegment, SelectionBackground(vsDraw, eolInSelection == 1));
} else {
if (overrideBackground) {
@@ -2620,7 +2623,7 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin
} else {
surface->FillRectangle(rcSegment, vsDraw.styles[STYLE_DEFAULT].back);
}
- if (eolInSelection && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1) && (alpha != SC_ALPHA_NOALPHA)) {
+ if (eolInSelection && vsDraw.selColours.back.isSet && (line < pdoc->LinesTotal() - 1) && (alpha != SC_ALPHA_NOALPHA)) {
SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw, eolInSelection == 1), alpha);
}
}
@@ -2631,7 +2634,7 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin
rcSegment.left = rcLine.left;
rcSegment.right = rcLine.right;
- if (eolInSelection && vsDraw.selEOLFilled && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1) && (alpha == SC_ALPHA_NOALPHA)) {
+ if (eolInSelection && vsDraw.selEOLFilled && vsDraw.selColours.back.isSet && (line < pdoc->LinesTotal() - 1) && (alpha == SC_ALPHA_NOALPHA)) {
surface->FillRectangle(rcSegment, SelectionBackground(vsDraw, eolInSelection == 1));
} else {
if (overrideBackground) {
@@ -2641,7 +2644,7 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin
} else {
surface->FillRectangle(rcSegment, vsDraw.styles[STYLE_DEFAULT].back);
}
- if (eolInSelection && vsDraw.selEOLFilled && vsDraw.selbackset && (line < pdoc->LinesTotal() - 1) && (alpha != SC_ALPHA_NOALPHA)) {
+ if (eolInSelection && vsDraw.selEOLFilled && vsDraw.selColours.back.isSet && (line < pdoc->LinesTotal() - 1) && (alpha != SC_ALPHA_NOALPHA)) {
SimpleAlphaRectangle(surface, rcSegment, SelectionBackground(vsDraw, eolInSelection == 1), alpha);
}
}
@@ -2649,7 +2652,7 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin
if (drawWrapMarkEnd) {
PRectangle rcPlace = rcSegment;
- if (wrapVisualFlagsLocation & SC_WRAPVISUALFLAGLOC_END_BY_TEXT) {
+ if (vsDraw.wrapVisualFlagsLocation & SC_WRAPVISUALFLAGLOC_END_BY_TEXT) {
rcPlace.left = xEol + xStart + virtualSpace;
rcPlace.right = rcPlace.left + vsDraw.aveCharWidth;
} else {
@@ -2805,6 +2808,11 @@ void Editor::DrawAnnotation(Surface *surface, ViewStyle &vsDraw, int line, int x
void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVisible, int xStart,
PRectangle rcLine, LineLayout *ll, int subLine) {
+ if (subLine >= ll->lines) {
+ DrawAnnotation(surface, vsDraw, line, xStart, rcLine, ll, subLine);
+ return; // No further drawing
+ }
+
PRectangle rcSegment = rcLine;
// Using one font for all control characters so it can be controlled independently to ensure
@@ -2851,21 +2859,17 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
}
}
- bool drawWhitespaceBackground = (vsDraw.viewWhitespace != wsInvisible) &&
- (!overrideBackground) && (vsDraw.whitespaceBackgroundSet);
+ const bool drawWhitespaceBackground = (vsDraw.viewWhitespace != wsInvisible) &&
+ (!overrideBackground) && (vsDraw.whitespaceColours.back.isSet);
bool inIndentation = subLine == 0; // Do not handle indentation except on first subline.
const XYPOSITION indentWidth = pdoc->IndentSize() * vsDraw.spaceWidth;
const XYPOSITION epsilon = 0.0001f; // A small nudge to avoid floating point precision issues
- int posLineStart = pdoc->LineStart(line);
+ const int posLineStart = pdoc->LineStart(line);
- int startseg = ll->LineStart(subLine);
- XYACCUMULATOR subLineStart = ll->positions[startseg];
- if (subLine >= ll->lines) {
- DrawAnnotation(surface, vsDraw, line, xStart, rcLine, ll, subLine);
- return; // No further drawing
- }
+ const int startseg = ll->LineStart(subLine);
+ const XYACCUMULATOR subLineStart = ll->positions[startseg];
int lineStart = 0;
int lineEnd = 0;
if (subLine < ll->lines) {
@@ -2876,13 +2880,11 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
}
}
- ColourDesired wrapColour = vsDraw.styles[STYLE_DEFAULT].fore;
- if (vsDraw.whitespaceForegroundSet)
- wrapColour = vsDraw.whitespaceForeground;
+ const ColourDesired wrapColour = vsDraw.WrapColour();
bool drawWrapMarkEnd = false;
- if (wrapVisualFlags & SC_WRAPVISUALFLAG_END) {
+ if (vsDraw.wrapVisualFlags & SC_WRAPVISUALFLAG_END) {
if (subLine + 1 < ll->lines) {
drawWrapMarkEnd = ll->LineStart(subLine + 1) != 0;
}
@@ -2911,9 +2913,9 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
//int styleMain = ll->styles[lineStart];
//surface->FillRectangle(rcPlace, vsDraw.styles[styleMain].back);
- if (wrapVisualFlags & SC_WRAPVISUALFLAG_START) {
+ if (vsDraw.wrapVisualFlags & SC_WRAPVISUALFLAG_START) {
- if (wrapVisualFlagsLocation & SC_WRAPVISUALFLAGLOC_START_BY_TEXT)
+ if (vsDraw.wrapVisualFlagsLocation & SC_WRAPVISUALFLAGLOC_START_BY_TEXT)
rcPlace.left = rcPlace.right - vsDraw.aveCharWidth;
else
rcPlace.right = rcPlace.left + vsDraw.aveCharWidth;
@@ -2925,77 +2927,76 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
}
}
- bool selBackDrawn = vsDraw.selbackset &&
+ const bool selBackDrawn = vsDraw.selColours.back.isSet &&
((vsDraw.selAlpha == SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha == SC_ALPHA_NOALPHA));
// Does not take margin into account but not significant
- int xStartVisible = static_cast<int>(subLineStart) - xStart;
+ const int xStartVisible = static_cast<int>(subLineStart) - xStart;
ll->psel = &sel;
- BreakFinder bfBack(ll, lineStart, lineEnd, posLineStart, xStartVisible, selBackDrawn, pdoc);
- int next = bfBack.First();
-
- // Background drawing loop
- while (twoPhaseDraw && (next < lineEnd)) {
-
- startseg = next;
- next = bfBack.Next();
- int i = next - 1;
- int iDoc = i + posLineStart;
-
- rcSegment.left = ll->positions[startseg] + xStart - subLineStart;
- rcSegment.right = ll->positions[i + 1] + xStart - subLineStart;
- // Only try to draw if really visible - enhances performance by not calling environment to
- // draw strings that are completely past the right side of the window.
- if ((rcSegment.left <= rcLine.right) && (rcSegment.right >= rcLine.left)) {
- // Clip to line rectangle, since may have a huge position which will not work with some platforms
- if (rcSegment.left < rcLine.left)
- rcSegment.left = rcLine.left;
- if (rcSegment.right > rcLine.right)
- rcSegment.right = rcLine.right;
-
- int styleMain = ll->styles[i];
- const int inSelection = hideSelection ? 0 : sel.CharacterInSelection(iDoc);
- bool inHotspot = (ll->hsStart != -1) && (iDoc >= ll->hsStart) && (iDoc < ll->hsEnd);
- ColourDesired textBack = TextBackground(vsDraw, overrideBackground, background, inSelection, inHotspot, styleMain, i, ll);
- if (ll->chars[i] == '\t') {
- // Tab display
- if (drawWhitespaceBackground &&
- (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways))
- textBack = vsDraw.whitespaceBackground;
- surface->FillRectangle(rcSegment, textBack);
- } else if (IsControlCharacter(ll->chars[i])) {
- // Control character display
- inIndentation = false;
- surface->FillRectangle(rcSegment, textBack);
- } else {
- // Normal text display
- surface->FillRectangle(rcSegment, textBack);
- if (vsDraw.viewWhitespace != wsInvisible ||
- (inIndentation && vsDraw.viewIndentationGuides == ivReal)) {
- for (int cpos = 0; cpos <= i - startseg; cpos++) {
- if (ll->chars[cpos + startseg] == ' ') {
- if (drawWhitespaceBackground &&
- (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) {
- PRectangle rcSpace(ll->positions[cpos + startseg] + xStart - subLineStart,
- rcSegment.top,
- ll->positions[cpos + startseg + 1] + xStart - subLineStart,
- rcSegment.bottom);
- surface->FillRectangle(rcSpace, vsDraw.whitespaceBackground);
+ if (twoPhaseDraw) {
+ BreakFinder bfBack(ll, lineStart, lineEnd, posLineStart, xStartVisible, selBackDrawn, pdoc, &reprs);
+
+ // Background drawing loop
+ while (bfBack.More()) {
+
+ const TextSegment ts = bfBack.Next();
+ const int i = ts.end() - 1;
+ const int iDoc = i + posLineStart;
+
+ rcSegment.left = ll->positions[ts.start] + xStart - subLineStart;
+ rcSegment.right = ll->positions[ts.end()] + xStart - subLineStart;
+ // Only try to draw if really visible - enhances performance by not calling environment to
+ // draw strings that are completely past the right side of the window.
+ if (rcSegment.Intersects(rcLine)) {
+ // Clip to line rectangle, since may have a huge position which will not work with some platforms
+ if (rcSegment.left < rcLine.left)
+ rcSegment.left = rcLine.left;
+ if (rcSegment.right > rcLine.right)
+ rcSegment.right = rcLine.right;
+
+ const int inSelection = hideSelection ? 0 : sel.CharacterInSelection(iDoc);
+ const bool inHotspot = (ll->hsStart != -1) && (iDoc >= ll->hsStart) && (iDoc < ll->hsEnd);
+ ColourDesired textBack = TextBackground(vsDraw, overrideBackground, background, inSelection,
+ inHotspot, ll->styles[i], i, ll);
+ if (ts.representation) {
+ if (ll->chars[i] == '\t') {
+ // Tab display
+ if (drawWhitespaceBackground &&
+ (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways))
+ textBack = vsDraw.whitespaceColours.back;
+ } else {
+ // Blob display
+ inIndentation = false;
+ }
+ surface->FillRectangle(rcSegment, textBack);
+ } else {
+ // Normal text display
+ surface->FillRectangle(rcSegment, textBack);
+ if (vsDraw.viewWhitespace != wsInvisible ||
+ (inIndentation && vsDraw.viewIndentationGuides == ivReal)) {
+ for (int cpos = 0; cpos <= i - ts.start; cpos++) {
+ if (ll->chars[cpos + ts.start] == ' ') {
+ if (drawWhitespaceBackground &&
+ (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) {
+ PRectangle rcSpace(ll->positions[cpos + ts.start] + xStart - subLineStart,
+ rcSegment.top,
+ ll->positions[cpos + ts.start + 1] + xStart - subLineStart,
+ rcSegment.bottom);
+ surface->FillRectangle(rcSpace, vsDraw.whitespaceColours.back);
+ }
+ } else {
+ inIndentation = false;
}
- } else {
- inIndentation = false;
}
}
}
+ } else if (rcSegment.left > rcLine.right) {
+ break;
}
- } else if (rcSegment.left > rcLine.right) {
- break;
}
- }
- if (twoPhaseDraw) {
DrawEOL(surface, vsDraw, rcLine, ll, line, lineEnd,
xStart, subLine, subLineStart, overrideBackground, background,
drawWrapMarkEnd, wrapColour);
@@ -3004,7 +3005,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
DrawIndicators(surface, vsDraw, line, xStart, rcLine, ll, subLine, lineEnd, true);
if (vsDraw.edgeState == EDGE_LINE) {
- int edgeX = theEdge * vsDraw.spaceWidth;
+ int edgeX = vsDraw.theEdge * vsDraw.spaceWidth;
rcSegment.left = edgeX + xStart;
if ((ll->wrapIndent != 0) && (lineStart != 0))
rcSegment.left -= ll->wrapIndent;
@@ -3028,111 +3029,102 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
inIndentation = subLine == 0; // Do not handle indentation except on first subline.
// Foreground drawing loop
BreakFinder bfFore(ll, lineStart, lineEnd, posLineStart, xStartVisible,
- ((!twoPhaseDraw && selBackDrawn) || vsDraw.selforeset), pdoc);
- next = bfFore.First();
-
- while (next < lineEnd) {
+ ((!twoPhaseDraw && selBackDrawn) || vsDraw.selColours.fore.isSet), pdoc, &reprs);
- startseg = next;
- next = bfFore.Next();
- int i = next - 1;
+ while (bfFore.More()) {
- int iDoc = i + posLineStart;
+ const TextSegment ts = bfFore.Next();
+ const int i = ts.end() - 1;
+ const int iDoc = i + posLineStart;
- rcSegment.left = ll->positions[startseg] + xStart - subLineStart;
- rcSegment.right = ll->positions[i + 1] + xStart - subLineStart;
+ rcSegment.left = ll->positions[ts.start] + xStart - subLineStart;
+ rcSegment.right = ll->positions[ts.end()] + xStart - subLineStart;
// Only try to draw if really visible - enhances performance by not calling environment to
// draw strings that are completely past the right side of the window.
- if ((rcSegment.left <= rcLine.right) && (rcSegment.right >= rcLine.left)) {
+ if (rcSegment.Intersects(rcLine)) {
int styleMain = ll->styles[i];
ColourDesired textFore = vsDraw.styles[styleMain].fore;
Font &textFont = vsDraw.styles[styleMain].font;
//hotspot foreground
if (ll->hsStart != -1 && iDoc >= ll->hsStart && iDoc < hsEnd) {
- if (vsDraw.hotspotForegroundSet)
- textFore = vsDraw.hotspotForeground;
+ if (vsDraw.hotspotColours.fore.isSet)
+ textFore = vsDraw.hotspotColours.fore;
}
const int inSelection = hideSelection ? 0 : sel.CharacterInSelection(iDoc);
- if (inSelection && (vsDraw.selforeset)) {
- textFore = (inSelection == 1) ? vsDraw.selforeground : vsDraw.selAdditionalForeground;
+ if (inSelection && (vsDraw.selColours.fore.isSet)) {
+ textFore = (inSelection == 1) ? vsDraw.selColours.fore : vsDraw.selAdditionalForeground;
}
- bool inHotspot = (ll->hsStart != -1) && (iDoc >= ll->hsStart) && (iDoc < ll->hsEnd);
+ const bool inHotspot = (ll->hsStart != -1) && (iDoc >= ll->hsStart) && (iDoc < ll->hsEnd);
ColourDesired textBack = TextBackground(vsDraw, overrideBackground, background, inSelection, inHotspot, styleMain, i, ll);
- if (ll->chars[i] == '\t') {
- // Tab display
- if (!twoPhaseDraw) {
- if (drawWhitespaceBackground &&
- (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways))
- textBack = vsDraw.whitespaceBackground;
- surface->FillRectangle(rcSegment, textBack);
- }
- if (inIndentation && vsDraw.viewIndentationGuides == ivReal) {
- for (int indentCount = (ll->positions[i] + epsilon) / indentWidth;
- indentCount <= (ll->positions[i + 1] - epsilon) / indentWidth;
- indentCount++) {
- if (indentCount > 0) {
- int xIndent = indentCount * indentWidth;
- DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, xIndent + xStart, rcSegment,
- (ll->xHighlightGuide == xIndent));
+ if (ts.representation) {
+ if (ll->chars[i] == '\t') {
+ // Tab display
+ if (!twoPhaseDraw) {
+ if (drawWhitespaceBackground &&
+ (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways))
+ textBack = vsDraw.whitespaceColours.back;
+ surface->FillRectangle(rcSegment, textBack);
+ }
+ if (inIndentation && vsDraw.viewIndentationGuides == ivReal) {
+ for (int indentCount = (ll->positions[i] + epsilon) / indentWidth;
+ indentCount <= (ll->positions[i + 1] - epsilon) / indentWidth;
+ indentCount++) {
+ if (indentCount > 0) {
+ int xIndent = indentCount * indentWidth;
+ DrawIndentGuide(surface, lineVisible, vsDraw.lineHeight, xIndent + xStart, rcSegment,
+ (ll->xHighlightGuide == xIndent));
+ }
}
}
- }
- if (vsDraw.viewWhitespace != wsInvisible) {
- if (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways) {
- if (vsDraw.whitespaceForegroundSet)
- textFore = vsDraw.whitespaceForeground;
- surface->PenColour(textFore);
- PRectangle rcTab(rcSegment.left + 1, rcSegment.top + 4,
- rcSegment.right - 1, rcSegment.bottom - vsDraw.maxDescent);
- DrawTabArrow(surface, rcTab, rcSegment.top + vsDraw.lineHeight / 2);
+ if (vsDraw.viewWhitespace != wsInvisible) {
+ if (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways) {
+ if (vsDraw.whitespaceColours.fore.isSet)
+ textFore = vsDraw.whitespaceColours.fore;
+ surface->PenColour(textFore);
+ PRectangle rcTab(rcSegment.left + 1, rcSegment.top + 4,
+ rcSegment.right - 1, rcSegment.bottom - vsDraw.maxDescent);
+ DrawTabArrow(surface, rcTab, rcSegment.top + vsDraw.lineHeight / 2);
+ }
}
- }
- } else if (IsControlCharacter(ll->chars[i])) {
- // Control character display
- inIndentation = false;
- if (controlCharSymbol < 32) {
- // Draw the character
- const char *ctrlChar = ControlCharacterString(ll->chars[i]);
- DrawTextBlob(surface, vsDraw, rcSegment, ctrlChar, textBack, textFore, twoPhaseDraw);
} else {
- char cc[2] = { static_cast<char>(controlCharSymbol), '\0' };
- surface->DrawTextNoClip(rcSegment, ctrlCharsFont,
- rcSegment.top + vsDraw.maxAscent,
- cc, 1, textBack, textFore);
+ inIndentation = false;
+ if (vsDraw.controlCharSymbol >= 32) {
+ char cc[2] = { static_cast<char>(vsDraw.controlCharSymbol), '\0' };
+ surface->DrawTextNoClip(rcSegment, ctrlCharsFont,
+ rcSegment.top + vsDraw.maxAscent,
+ cc, 1, textBack, textFore);
+ } else {
+ DrawTextBlob(surface, vsDraw, rcSegment, ts.representation->stringRep.c_str(), textBack, textFore, twoPhaseDraw);
+ }
}
- } else if ((i == startseg) && (static_cast<unsigned char>(ll->chars[i]) >= 0x80) && IsUnicodeMode()) {
- // A single byte >= 0x80 in UTF-8 is a bad byte and is displayed as its hex value
- char hexits[4];
- sprintf(hexits, "x%2X", ll->chars[i] & 0xff);
- DrawTextBlob(surface, vsDraw, rcSegment, hexits, textBack, textFore, twoPhaseDraw);
} else {
// Normal text display
if (vsDraw.styles[styleMain].visible) {
if (twoPhaseDraw) {
surface->DrawTextTransparent(rcSegment, textFont,
- rcSegment.top + vsDraw.maxAscent, ll->chars + startseg,
- i - startseg + 1, textFore);
+ rcSegment.top + vsDraw.maxAscent, ll->chars + ts.start,
+ i - ts.start + 1, textFore);
} else {
surface->DrawTextNoClip(rcSegment, textFont,
- rcSegment.top + vsDraw.maxAscent, ll->chars + startseg,
- i - startseg + 1, textFore, textBack);
+ rcSegment.top + vsDraw.maxAscent, ll->chars + ts.start,
+ i - ts.start + 1, textFore, textBack);
}
}
if (vsDraw.viewWhitespace != wsInvisible ||
(inIndentation && vsDraw.viewIndentationGuides != ivNone)) {
- for (int cpos = 0; cpos <= i - startseg; cpos++) {
- if (ll->chars[cpos + startseg] == ' ') {
+ for (int cpos = 0; cpos <= i - ts.start; cpos++) {
+ if (ll->chars[cpos + ts.start] == ' ') {
if (vsDraw.viewWhitespace != wsInvisible) {
- if (vsDraw.whitespaceForegroundSet)
- textFore = vsDraw.whitespaceForeground;
+ if (vsDraw.whitespaceColours.fore.isSet)
+ textFore = vsDraw.whitespaceColours.fore;
if (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways) {
- XYPOSITION xmid = (ll->positions[cpos + startseg] + ll->positions[cpos + startseg + 1]) / 2;
+ XYPOSITION xmid = (ll->positions[cpos + ts.start] + ll->positions[cpos + ts.start + 1]) / 2;
if (!twoPhaseDraw && drawWhitespaceBackground &&
(!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) {
- textBack = vsDraw.whitespaceBackground;
- PRectangle rcSpace(ll->positions[cpos + startseg] + xStart - subLineStart,
+ textBack = vsDraw.whitespaceColours.back;
+ PRectangle rcSpace(ll->positions[cpos + ts.start] + xStart - subLineStart,
rcSegment.top,
- ll->positions[cpos + startseg + 1] + xStart - subLineStart,
+ ll->positions[cpos + ts.start + 1] + xStart - subLineStart,
rcSegment.bottom);
surface->FillRectangle(rcSpace, textBack);
}
@@ -3143,8 +3135,8 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
}
}
if (inIndentation && vsDraw.viewIndentationGuides == ivReal) {
- for (int indentCount = (ll->positions[cpos + startseg] + epsilon) / indentWidth;
- indentCount <= (ll->positions[cpos + startseg + 1] - epsilon) / indentWidth;
+ for (int indentCount = (ll->positions[cpos + ts.start] + epsilon) / indentWidth;
+ indentCount <= (ll->positions[cpos + ts.start + 1] - epsilon) / indentWidth;
indentCount++) {
if (indentCount > 0) {
int xIndent = indentCount * indentWidth;
@@ -3163,8 +3155,8 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
PRectangle rcUL = rcSegment;
rcUL.top = rcUL.top + vsDraw.maxAscent + 1;
rcUL.bottom = rcUL.top + 1;
- if (vsDraw.hotspotForegroundSet)
- surface->FillRectangle(rcUL, vsDraw.hotspotForeground);
+ if (vsDraw.hotspotColours.fore.isSet)
+ surface->FillRectangle(rcUL, vsDraw.hotspotColours.fore);
else
surface->FillRectangle(rcUL, textFore);
} else if (vsDraw.styles[styleMain].underline) {
@@ -3380,11 +3372,11 @@ void Editor::RefreshPixMaps(Surface *surfaceWindow) {
colourFMFill = vs.selbarlight;
}
- if (vs.foldmarginColourSet) {
+ if (vs.foldmarginColour.isSet) {
// override default fold margin colour
colourFMFill = vs.foldmarginColour;
}
- if (vs.foldmarginHighlightColourSet) {
+ if (vs.foldmarginHighlightColour.isSet) {
// override default fold margin highlight colour
colourFMStripes = vs.foldmarginHighlightColour;
}
@@ -3578,7 +3570,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
// Either styling or NotifyUpdateUI noticed that painting is needed
// outside the current painting rectangle
//Platform::DebugPrintf("Abandoning paint\n");
- if (wrapState != eWrapNone) {
+ if (Wrapping()) {
if (paintAbandonedByStyling) {
// Styling has spilled over a line end, such as occurs by starting a multiline
// comment. The width of subsequent text may have changed, so rewrap.
@@ -3747,7 +3739,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
if (rcBeyondEOF.top < rcBeyondEOF.bottom) {
surfaceWindow->FillRectangle(rcBeyondEOF, vs.styles[STYLE_DEFAULT].back);
if (vs.edgeState == EDGE_LINE) {
- int edgeX = theEdge * vs.spaceWidth;
+ int edgeX = vs.theEdge * vs.spaceWidth;
rcBeyondEOF.left = edgeX + xStart;
rcBeyondEOF.right = rcBeyondEOF.left + 1;
surfaceWindow->FillRectangle(rcBeyondEOF, vs.edgecolour);
@@ -3809,17 +3801,17 @@ long Editor::FormatRange(bool draw, Sci_RangeToFormat *pfr) {
}
}
vsPrint.fixedColumnWidth = 0;
- vsPrint.zoomLevel = printMagnification;
+ vsPrint.zoomLevel = printParameters.magnification;
// Don't show indentation guides
// If this ever gets changed, cached pixmap would need to be recreated if technology != SC_TECHNOLOGY_DEFAULT
vsPrint.viewIndentationGuides = ivNone;
// Don't show the selection when printing
- vsPrint.selbackset = false;
- vsPrint.selforeset = false;
+ vsPrint.selColours.back.isSet = false;
+ vsPrint.selColours.fore.isSet = false;
vsPrint.selAlpha = SC_ALPHA_NOALPHA;
vsPrint.selAdditionalAlpha = SC_ALPHA_NOALPHA;
- vsPrint.whitespaceBackgroundSet = false;
- vsPrint.whitespaceForegroundSet = false;
+ vsPrint.whitespaceColours.back.isSet = false;
+ vsPrint.whitespaceColours.fore.isSet = false;
vsPrint.showCaretLineBackground = false;
vsPrint.alwaysShowCaretLineBackground = false;
// Don't highlight matching braces using indicators
@@ -3828,15 +3820,15 @@ long Editor::FormatRange(bool draw, Sci_RangeToFormat *pfr) {
// Set colours for printing according to users settings
for (size_t sty = 0; sty < vsPrint.styles.size(); sty++) {
- if (printColourMode == SC_PRINT_INVERTLIGHT) {
+ if (printParameters.colourMode == SC_PRINT_INVERTLIGHT) {
vsPrint.styles[sty].fore = InvertedLight(vsPrint.styles[sty].fore);
vsPrint.styles[sty].back = InvertedLight(vsPrint.styles[sty].back);
- } else if (printColourMode == SC_PRINT_BLACKONWHITE) {
+ } else if (printParameters.colourMode == SC_PRINT_BLACKONWHITE) {
vsPrint.styles[sty].fore = ColourDesired(0, 0, 0);
vsPrint.styles[sty].back = ColourDesired(0xff, 0xff, 0xff);
- } else if (printColourMode == SC_PRINT_COLOURONWHITE) {
+ } else if (printParameters.colourMode == SC_PRINT_COLOURONWHITE) {
vsPrint.styles[sty].back = ColourDesired(0xff, 0xff, 0xff);
- } else if (printColourMode == SC_PRINT_COLOURONWHITEDEFAULTBG) {
+ } else if (printParameters.colourMode == SC_PRINT_COLOURONWHITEDEFAULTBG) {
if (sty <= STYLE_DEFAULT) {
vsPrint.styles[sty].back = ColourDesired(0xff, 0xff, 0xff);
}
@@ -3849,14 +3841,14 @@ long Editor::FormatRange(bool draw, Sci_RangeToFormat *pfr) {
vsPrint.leftMarginWidth = 0;
vsPrint.rightMarginWidth = 0;
- vsPrint.Refresh(*surfaceMeasure);
+ vsPrint.Refresh(*surfaceMeasure, pdoc->tabInChars);
// Determining width must hapen after fonts have been realised in Refresh
int lineNumberWidth = 0;
if (lineNumberIndex >= 0) {
lineNumberWidth = surfaceMeasure->WidthText(vsPrint.styles[STYLE_LINENUMBER].font,
"99999" lineNumberPrintSpace, 5 + istrlen(lineNumberPrintSpace));
vsPrint.ms[lineNumberIndex].width = lineNumberWidth;
- vsPrint.Refresh(*surfaceMeasure); // Recalculate fixedColumnWidth
+ vsPrint.Refresh(*surfaceMeasure, pdoc->tabInChars); // Recalculate fixedColumnWidth
}
int linePrintStart = pdoc->LineFromPosition(pfr->chrg.cpMin);
@@ -3884,7 +3876,7 @@ long Editor::FormatRange(bool draw, Sci_RangeToFormat *pfr) {
int nPrintPos = pfr->chrg.cpMin;
int visibleLine = 0;
int widthPrint = pfr->rc.right - pfr->rc.left - vsPrint.fixedColumnWidth;
- if (printWrapState == eWrapNone)
+ if (printParameters.wrapState == eWrapNone)
widthPrint = LineLayout::wrapWidthInfinite;
while (lineDoc <= linePrintLast && ypos < pfr->rc.bottom) {
@@ -4011,7 +4003,7 @@ void Editor::SetScrollBars() {
void Editor::ChangeSize() {
DropGraphics(false);
SetScrollBars();
- if (wrapState != eWrapNone) {
+ if (Wrapping()) {
PRectangle rcTextArea = GetClientRectangle();
rcTextArea.left = vs.textStart;
rcTextArea.right -= vs.rightMarginWidth;
@@ -4091,7 +4083,7 @@ void Editor::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) {
}
currentSel->ClearVirtualSpace();
// If in wrap mode rewrap current line so EnsureCaretVisible has accurate information
- if (wrapState != eWrapNone) {
+ if (Wrapping()) {
AutoSurface surface(this);
if (surface) {
if (WrapOneLine(surface, pdoc->LineFromPosition(positionInsert))) {
@@ -4104,7 +4096,7 @@ void Editor::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) {
}
}
}
- if (wrapState != eWrapNone) {
+ if (Wrapping()) {
SetScrollBars();
}
ThinRectangularRange();
@@ -4586,7 +4578,7 @@ void Editor::NotifyDwelling(Point pt, bool state) {
SCNotification scn = {0};
scn.nmhdr.code = state ? SCN_DWELLSTART : SCN_DWELLEND;
scn.position = PositionFromLocation(pt, true);
- scn.x = pt.x;
+ scn.x = pt.x + vs.ExternalMarginWidth();
scn.y = pt.y;
NotifyParent(scn);
}
@@ -4613,7 +4605,7 @@ void Editor::CheckModificationForWrap(DocModification mh) {
llc.Invalidate(LineLayout::llCheckTextAndStyle);
int lineDoc = pdoc->LineFromPosition(mh.position);
int lines = Platform::Maximum(0, mh.linesAdded);
- if (wrapState != eWrapNone) {
+ if (Wrapping()) {
NeedWrapping(lineDoc, lineDoc + lines + 1);
}
RefreshStyleData();
@@ -6342,7 +6334,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
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;
+ selectionType = (Wrapping() && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine;
}
} else {
if (selectionType == selChar) {
@@ -6406,7 +6398,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
if (!shift) {
// Single click in margin: select whole line or only subline if word wrap is enabled
lineAnchorPos = newPos.Position();
- selectionType = ((wrapState != eWrapNone) && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine;
+ selectionType = (Wrapping() && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine;
LineSelection(lineAnchorPos, lineAnchorPos, selectionType == selWholeLine);
} else {
// Single shift+click in margin: select from line anchor to clicked line
@@ -6419,7 +6411,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
// 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))
- selectionType = ((wrapState != eWrapNone) && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine;
+ selectionType = (Wrapping() && (marginOptions & SC_MARGINOPTION_SUBLINESELECT)) ? selSubLine : selWholeLine;
LineSelection(newPos.Position(), lineAnchorPos, selectionType == selWholeLine);
}
@@ -6521,7 +6513,7 @@ void Editor::GetHotSpotRange(int &hsStart_, int &hsEnd_) const {
hsEnd_ = hsEnd;
}
-void Editor::ButtonMove(Point pt) {
+void Editor::ButtonMoveWithModifiers(Point pt, int modifiers) {
if ((ptMouseLast.x != pt.x) || (ptMouseLast.y != pt.y)) {
DwellEnd(true);
}
@@ -6555,10 +6547,14 @@ void Editor::ButtonMove(Point pt) {
SetDragPosition(movePos);
} else {
if (selectionType == selChar) {
+ if (sel.selType == Selection::selStream && (modifiers & SCI_ALT) && mouseSelectionRectangularSwitch) {
+ sel.selType = Selection::selRectangle;
+ }
if (sel.IsRectangular()) {
sel.Rectangular() = SelectionRange(movePos, sel.Rectangular().anchor);
SetSelection(movePos, sel.RangeMain().anchor);
} else if (sel.Count() > 1) {
+ InvalidateSelection(sel.RangeMain(), false);
SelectionRange range(movePos, sel.RangeMain().anchor);
sel.TentativeSelection(range);
InvalidateSelection(range, true);
@@ -6632,6 +6628,10 @@ void Editor::ButtonMove(Point pt) {
}
}
+void Editor::ButtonMove(Point pt) {
+ ButtonMoveWithModifiers(pt, 0);
+}
+
void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {
//Platform::DebugPrintf("ButtonUp %d %d\n", HaveMouseCapture(), inDragDrop);
SelectionPosition newPos = SPositionFromLocation(pt, false, false,
@@ -6745,7 +6745,7 @@ bool Editor::Idle() {
bool idleDone;
- bool wrappingDone = wrapState == eWrapNone;
+ bool wrappingDone = !Wrapping();
if (!wrappingDone) {
// Wrap lines during idle.
@@ -6881,7 +6881,7 @@ void Editor::SetAnnotationHeights(int start, int end) {
bool changedHeight = false;
for (int line=start; line<end && line<pdoc->LinesTotal(); line++) {
int linesWrapped = 1;
- if (wrapState != eWrapNone) {
+ if (Wrapping()) {
AutoSurface surface(this);
AutoLineLayout ll(llc, RetrieveLineLayout(line));
if (surface && ll) {
@@ -6919,6 +6919,8 @@ void Editor::SetDocPointer(Document *document) {
vs.ReleaseAllExtendedStyles();
+ SetRepresentations();
+
// Reset the contraction state to fully shown.
cs.Clear();
cs.InsertLines(0, pdoc->LinesTotal() - 1);
@@ -7620,6 +7622,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_POSITIONAFTER:
return pdoc->MovePositionOutsideChar(wParam + 1, 1, true);
+ case SCI_POSITIONRELATIVE:
+ return Platform::Clamp(pdoc->GetRelativePosition(wParam, lParam), 0, pdoc->Length());
+
case SCI_LINESCROLL:
ScrollTo(topLine + lParam);
HorizontalScrollTo(xOffset + static_cast<int>(wParam) * vs.spaceWidth);
@@ -7703,6 +7708,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return vs.rightMarginWidth;
case SCI_SETMARGINLEFT:
+ lastXChosen += lParam - vs.leftMarginWidth;
vs.leftMarginWidth = lParam;
InvalidateStyleRedraw();
break;
@@ -7870,25 +7876,25 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
break;
case SCI_SETPRINTMAGNIFICATION:
- printMagnification = wParam;
+ printParameters.magnification = wParam;
break;
case SCI_GETPRINTMAGNIFICATION:
- return printMagnification;
+ return printParameters.magnification;
case SCI_SETPRINTCOLOURMODE:
- printColourMode = wParam;
+ printParameters.colourMode = wParam;
break;
case SCI_GETPRINTCOLOURMODE:
- return printColourMode;
+ return printParameters.colourMode;
case SCI_SETPRINTWRAPMODE:
- printWrapState = (wParam == SC_WRAP_WORD) ? eWrapWord : eWrapNone;
+ printParameters.wrapState = (wParam == SC_WRAP_WORD) ? eWrapWord : eWrapNone;
break;
case SCI_GETPRINTWRAPMODE:
- return printWrapState;
+ return printParameters.wrapState;
case SCI_GETSTYLEAT:
if (static_cast<int>(wParam) >= pdoc->Length())
@@ -7949,16 +7955,20 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
break;
case SCI_POSITIONFROMPOINT:
- return PositionFromLocation(Point(wParam, lParam), false, false);
+ return PositionFromLocation(Point(wParam - vs.ExternalMarginWidth(), lParam),
+ false, false);
case SCI_POSITIONFROMPOINTCLOSE:
- return PositionFromLocation(Point(wParam, lParam), true, false);
+ return PositionFromLocation(Point(wParam - vs.ExternalMarginWidth(), lParam),
+ true, false);
case SCI_CHARPOSITIONFROMPOINT:
- return PositionFromLocation(Point(wParam, lParam), false, true);
+ return PositionFromLocation(Point(wParam - vs.ExternalMarginWidth(), lParam),
+ false, true);
case SCI_CHARPOSITIONFROMPOINTCLOSE:
- return PositionFromLocation(Point(wParam, lParam), true, true);
+ return PositionFromLocation(Point(wParam - vs.ExternalMarginWidth(), lParam),
+ true, true);
case SCI_GOTOLINE:
GoToLine(wParam);
@@ -8120,66 +8130,55 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return pdoc->ExtendWordSelect(wParam, 1, lParam != 0);
case SCI_SETWRAPMODE:
- switch (wParam) {
- case SC_WRAP_WORD:
- wrapState = eWrapWord;
- break;
- case SC_WRAP_CHAR:
- wrapState = eWrapChar;
- break;
- default:
- wrapState = eWrapNone;
- break;
+ if (vs.SetWrapState(wParam)) {
+ xOffset = 0;
+ ContainerNeedsUpdate(SC_UPDATE_H_SCROLL);
+ InvalidateStyleRedraw();
+ ReconfigureScrollBars();
}
- xOffset = 0;
- ContainerNeedsUpdate(SC_UPDATE_H_SCROLL);
- InvalidateStyleRedraw();
- ReconfigureScrollBars();
break;
case SCI_GETWRAPMODE:
- return wrapState;
+ return vs.wrapState;
case SCI_SETWRAPVISUALFLAGS:
- if (wrapVisualFlags != static_cast<int>(wParam)) {
- wrapVisualFlags = wParam;
+ if (vs.SetWrapVisualFlags(wParam)) {
InvalidateStyleRedraw();
ReconfigureScrollBars();
}
break;
case SCI_GETWRAPVISUALFLAGS:
- return wrapVisualFlags;
+ return vs.wrapVisualFlags;
case SCI_SETWRAPVISUALFLAGSLOCATION:
- wrapVisualFlagsLocation = wParam;
- InvalidateStyleRedraw();
+ if (vs.SetWrapVisualFlagsLocation(wParam)) {
+ InvalidateStyleRedraw();
+ }
break;
case SCI_GETWRAPVISUALFLAGSLOCATION:
- return wrapVisualFlagsLocation;
+ return vs.wrapVisualFlagsLocation;
case SCI_SETWRAPSTARTINDENT:
- if (wrapVisualStartIndent != static_cast<int>(wParam)) {
- wrapVisualStartIndent = wParam;
+ if (vs.SetWrapVisualStartIndent(wParam)) {
InvalidateStyleRedraw();
ReconfigureScrollBars();
}
break;
case SCI_GETWRAPSTARTINDENT:
- return wrapVisualStartIndent;
+ return vs.wrapVisualStartIndent;
case SCI_SETWRAPINDENTMODE:
- if (wrapIndentMode != static_cast<int>(wParam)) {
- wrapIndentMode = wParam;
+ if (vs.SetWrapIndentMode(wParam)) {
InvalidateStyleRedraw();
ReconfigureScrollBars();
}
break;
case SCI_GETWRAPINDENTMODE:
- return wrapIndentMode;
+ return vs.wrapIndentMode;
case SCI_SETLAYOUTCACHE:
llc.SetLevel(wParam);
@@ -8313,6 +8312,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
cs.InsertLines(0, pdoc->LinesTotal() - 1);
SetAnnotationHeights(0, pdoc->LinesTotal());
InvalidateStyleRedraw();
+ SetRepresentations();
}
}
break;
@@ -8450,6 +8450,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
if (ValidMargin(wParam)) {
// Short-circuit if the width is unchanged, to avoid unnecessary redraw.
if (vs.ms[wParam].width != lParam) {
+ lastXChosen += lParam - vs.ms[wParam].width;
vs.ms[wParam].width = lParam;
InvalidateStyleRedraw();
}
@@ -8713,15 +8714,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return LinesOnScreen();
case SCI_SETSELFORE:
- vs.selforeset = wParam != 0;
- vs.selforeground = ColourDesired(lParam);
+ vs.selColours.fore = ColourOptional(wParam, lParam);
vs.selAdditionalForeground = ColourDesired(lParam);
InvalidateStyleRedraw();
break;
case SCI_SETSELBACK:
- vs.selbackset = wParam != 0;
- vs.selbackground = ColourDesired(lParam);
+ vs.selColours.back = ColourOptional(wParam, lParam);
vs.selAdditionalBackground = ColourDesired(lParam);
InvalidateStyleRedraw();
break;
@@ -8744,14 +8743,12 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
break;
case SCI_SETWHITESPACEFORE:
- vs.whitespaceForegroundSet = wParam != 0;
- vs.whitespaceForeground = ColourDesired(lParam);
+ vs.whitespaceColours.fore = ColourOptional(wParam, lParam);
InvalidateStyleRedraw();
break;
case SCI_SETWHITESPACEBACK:
- vs.whitespaceBackgroundSet = wParam != 0;
- vs.whitespaceBackground = ColourDesired(lParam);
+ vs.whitespaceColours.back = ColourOptional(wParam, lParam);
InvalidateStyleRedraw();
break;
@@ -9022,10 +9019,10 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return vs.zoomLevel;
case SCI_GETEDGECOLUMN:
- return theEdge;
+ return vs.theEdge;
case SCI_SETEDGECOLUMN:
- theEdge = wParam;
+ vs.theEdge = wParam;
InvalidateStyleRedraw();
break;
@@ -9117,6 +9114,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
sel.selType = Selection::selStream;
}
InvalidateSelection(sel.RangeMain(), true);
+ break;
}
case SCI_GETSELECTIONMODE:
switch (sel.selType) {
@@ -9181,11 +9179,31 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
return cursorMode;
case SCI_SETCONTROLCHARSYMBOL:
- controlCharSymbol = wParam;
+ vs.controlCharSymbol = wParam;
+ InvalidateStyleRedraw();
break;
case SCI_GETCONTROLCHARSYMBOL:
- return controlCharSymbol;
+ return vs.controlCharSymbol;
+
+ case SCI_SETREPRESENTATION:
+ reprs.SetRepresentation(reinterpret_cast<const char *>(wParam), CharPtrFromSPtr(lParam));
+ break;
+
+ case SCI_GETREPRESENTATION: {
+ Representation *repr = reprs.RepresentationFromCharacter(
+ reinterpret_cast<const char *>(wParam), UTF8MaxBytes);
+ if (repr) {
+ if (lParam != 0)
+ strcpy(CharPtrFromSPtr(lParam), repr->stringRep.c_str());
+ return repr->stringRep.size();
+ }
+ return 0;
+ }
+
+ case SCI_CLEARREPRESENTATION:
+ reprs.ClearRepresentation(reinterpret_cast<const char *>(wParam));
+ break;
case SCI_STARTRECORD:
recordingMacro = true;
@@ -9200,34 +9218,30 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
break;
case SCI_SETFOLDMARGINCOLOUR:
- vs.foldmarginColourSet = wParam != 0;
- vs.foldmarginColour = ColourDesired(lParam);
+ vs.foldmarginColour = ColourOptional(wParam, lParam);
InvalidateStyleRedraw();
break;
case SCI_SETFOLDMARGINHICOLOUR:
- vs.foldmarginHighlightColourSet = wParam != 0;
- vs.foldmarginHighlightColour = ColourDesired(lParam);
+ vs.foldmarginHighlightColour = ColourOptional(wParam, lParam);
InvalidateStyleRedraw();
break;
case SCI_SETHOTSPOTACTIVEFORE:
- vs.hotspotForegroundSet = wParam != 0;
- vs.hotspotForeground = ColourDesired(lParam);
+ vs.hotspotColours.fore = ColourOptional(wParam, lParam);
InvalidateStyleRedraw();
break;
case SCI_GETHOTSPOTACTIVEFORE:
- return vs.hotspotForeground.AsLong();
+ return vs.hotspotColours.fore.AsLong();
case SCI_SETHOTSPOTACTIVEBACK:
- vs.hotspotBackgroundSet = wParam != 0;
- vs.hotspotBackground = ColourDesired(lParam);
+ vs.hotspotColours.back = ColourOptional(wParam, lParam);
InvalidateStyleRedraw();
break;
case SCI_GETHOTSPOTACTIVEBACK:
- return vs.hotspotBackground.AsLong();
+ return vs.hotspotColours.back.AsLong();
case SCI_SETHOTSPOTACTIVEUNDERLINE:
vs.hotspotUnderline = wParam != 0;
@@ -9407,6 +9421,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
pdoc->AddUndoAction(wParam, lParam & UNDO_MAY_COALESCE);
break;
+ case SCI_SETMOUSESELECTIONRECTANGULARSWITCH:
+ mouseSelectionRectangularSwitch = wParam != 0;
+ break;
+
+ case SCI_GETMOUSESELECTIONRECTANGULARSWITCH:
+ return mouseSelectionRectangularSwitch;
+
case SCI_SETMULTIPLESELECTION:
multipleSelection = wParam != 0;
InvalidateCaret();
diff --git a/scintilla/src/Editor.h b/scintilla/src/Editor.h
index cbd11f4..026956e 100644
--- a/scintilla/src/Editor.h
+++ b/scintilla/src/Editor.h
@@ -160,6 +160,13 @@ struct WrapPending {
}
};
+struct PrintParameters {
+ int magnification;
+ int colourMode;
+ WrapMode wrapState;
+ PrintParameters();
+};
+
/**
*/
class Editor : public DocWatcher {
@@ -182,11 +189,9 @@ protected: // ScintillaBase subclass needs access to much of Editor
Point sizeRGBAImage;
float scaleRGBAImage;
- int printMagnification;
- int printColourMode;
- int printWrapState;
+ PrintParameters printParameters;
+
int cursorMode;
- int controlCharSymbol;
// Highlight current folding block
HighlightDelimiter highlightDelimiter;
@@ -214,6 +219,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
bool endAtLastLine;
int caretSticky;
int marginOptions;
+ bool mouseSelectionRectangularSwitch;
bool multipleSelection;
bool additionalSelectionTyping;
int multiPasteMode;
@@ -231,6 +237,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
LineLayoutCache llc;
PositionCache posCache;
+ SpecialRepresentations reprs;
KeyMap kmap;
@@ -271,8 +278,6 @@ protected: // ScintillaBase subclass needs access to much of Editor
int bracesMatchStyle;
int highlightGuideColumn;
- int theEdge;
-
enum { notPainting, painting, paintAbandoned } paintState;
bool paintAbandonedByStyling;
PRectangle rcPaint;
@@ -308,20 +313,11 @@ protected: // ScintillaBase subclass needs access to much of Editor
int hsEnd;
// Wrapping support
- enum { eWrapNone, eWrapWord, eWrapChar } wrapState;
int wrapWidth;
WrapPending wrapPending;
- int wrapVisualFlags;
- int wrapVisualFlagsLocation;
- int wrapVisualStartIndent;
- int wrapIndentMode; // SC_WRAPINDENT_FIXED, _SAME, _INDENT
bool convertPastes;
- int marginNumberPadding; // the right-side padding of the number margin
- int ctrlCharPadding; // the padding around control character text blobs
- int lastSegItalicsOffset; // the offset so as not to clip italic characters at EOLs
-
Document *pdoc;
Editor();
@@ -332,6 +328,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
void InvalidateStyleData();
void InvalidateStyleRedraw();
void RefreshStyleData();
+ void SetRepresentations();
void DropGraphics(bool freeObjects);
void AllocateGraphics();
@@ -424,6 +421,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
void InvalidateCaret();
virtual void UpdateSystemCaret();
+ bool Wrapping() const;
void NeedWrapping(int docLineStart=0, int docLineEnd=WrapPending::lineLarge);
bool WrapOneLine(Surface *surface, int lineToWrap);
enum wrapScope {wsAll, wsVisible, wsIdle};
@@ -523,7 +521,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
void ContainerNeedsUpdate(int flags);
void PageMove(int direction, Selection::selTypes sel=Selection::noSel, bool stuttered = false);
- enum { cmSame, cmUpper, cmLower } caseMap;
+ enum { cmSame, cmUpper, cmLower };
virtual std::string CaseMapString(const std::string &s, int caseMapping);
void ChangeCaseOfSelection(int caseMapping);
void LineTranspose();
@@ -569,6 +567,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
void DwellEnd(bool mouseMoved);
void MouseLeave();
virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
+ void ButtonMoveWithModifiers(Point pt, int modifiers);
void ButtonMove(Point pt);
void ButtonUp(Point pt, unsigned int curTime, bool ctrl);
diff --git a/scintilla/src/ExternalLexer.cxx b/scintilla/src/ExternalLexer.cxx
index fc818ce..4e15c2d 100644
--- a/scintilla/src/ExternalLexer.cxx
+++ b/scintilla/src/ExternalLexer.cxx
@@ -6,8 +6,8 @@
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
-#include <stdio.h>
#include <string.h>
+#include <stdio.h>
#include <ctype.h>
#include <assert.h>
diff --git a/scintilla/src/FontQuality.h b/scintilla/src/FontQuality.h
index 46e2c91..a8ee8c9 100644
--- a/scintilla/src/FontQuality.h
+++ b/scintilla/src/FontQuality.h
@@ -5,6 +5,13 @@
// Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
+#ifndef FONTQUALITY_H
+#define FONTQUALITY_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
#define SC_EFF_QUALITY_MASK 0xF
#define SC_EFF_QUALITY_DEFAULT 0
#define SC_EFF_QUALITY_NON_ANTIALIASED 1
@@ -13,3 +20,9 @@
#define SCWIN_TECH_GDI 0
#define SCWIN_TECH_DIRECTWRITE 1
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/scintilla/src/KeyMap.h b/scintilla/src/KeyMap.h
index 3254d7c..63240af 100644
--- a/scintilla/src/KeyMap.h
+++ b/scintilla/src/KeyMap.h
@@ -5,8 +5,8 @@
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
-#ifndef KEYTOCOMMAND_H
-#define KEYTOCOMMAND_H
+#ifndef KEYMAP_H
+#define KEYMAP_H
#ifdef SCI_NAMESPACE
namespace Scintilla {
diff --git a/scintilla/src/LineMarker.h b/scintilla/src/LineMarker.h
index ac3e7e6..c9dfeb7 100644
--- a/scintilla/src/LineMarker.h
+++ b/scintilla/src/LineMarker.h
@@ -12,7 +12,6 @@
namespace Scintilla {
#endif
-
/**
*/
class LineMarker {
diff --git a/scintilla/src/Partitioning.h b/scintilla/src/Partitioning.h
index 01bdf8b..b1c24cc 100644
--- a/scintilla/src/Partitioning.h
+++ b/scintilla/src/Partitioning.h
@@ -8,6 +8,10 @@
#ifndef PARTITIONING_H
#define PARTITIONING_H
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
/// A split vector of integers with a method for adding a value to all elements
/// in a range.
/// Used by the Partitioning class.
@@ -186,4 +190,9 @@ public:
}
};
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
#endif
diff --git a/scintilla/src/PositionCache.cxx b/scintilla/src/PositionCache.cxx
index cada960..9cd21ed 100644
--- a/scintilla/src/PositionCache.cxx
+++ b/scintilla/src/PositionCache.cxx
@@ -13,6 +13,7 @@
#include <string>
#include <vector>
#include <map>
+#include <algorithm>
#include "Platform.h"
@@ -34,6 +35,7 @@
#include "ILexer.h"
#include "CaseFolder.h"
#include "Document.h"
+#include "UniConversion.h"
#include "Selection.h"
#include "PositionCache.h"
@@ -336,35 +338,75 @@ void LineLayoutCache::Dispose(LineLayout *ll) {
}
}
-void BreakFinder::Insert(int val) {
- if (val >= nextBreak) {
- for (std::vector<int>::iterator it = selAndEdge.begin(); it != selAndEdge.end(); ++it) {
- if (val == *it) {
- return;
- }
- if (val <*it) {
- selAndEdge.insert(it, 1, val);
- return;
- }
- }
- // Not less than any so append
- selAndEdge.push_back(val);
+// Simply pack the (maximum 4) character bytes into an int
+static inline int KeyFromString(const char *charBytes, size_t len) {
+ PLATFORM_ASSERT(len <= 4);
+ int k=0;
+ for (size_t i=0; i<len && charBytes[i]; i++) {
+ k = k * 0x100;
+ k += static_cast<unsigned char>(charBytes[i]);
}
+ return k;
}
-extern bool BadUTF(const char *s, int len, int &trailBytes);
+SpecialRepresentations::SpecialRepresentations() {
+ std::fill(startByteHasReprs, startByteHasReprs+0x100, 0);
+}
+
+void SpecialRepresentations::SetRepresentation(const char *charBytes, const char *value) {
+ MapRepresentation::iterator it = mapReprs.find(KeyFromString(charBytes, UTF8MaxBytes));
+ if (it == mapReprs.end()) {
+ // New entry so increment for first byte
+ startByteHasReprs[static_cast<unsigned char>(charBytes[0])]++;
+ }
+ mapReprs[KeyFromString(charBytes, UTF8MaxBytes)] = value;
+}
-static int NextBadU(const char *s, int p, int len, int &trailBytes) {
- while (p < len) {
- p++;
- if (BadUTF(s + p, len - p, trailBytes))
- return p;
+void SpecialRepresentations::ClearRepresentation(const char *charBytes) {
+ MapRepresentation::iterator it = mapReprs.find(KeyFromString(charBytes, UTF8MaxBytes));
+ if (it != mapReprs.end()) {
+ mapReprs.erase(it);
+ startByteHasReprs[static_cast<unsigned char>(charBytes[0])]--;
+ }
+}
+
+Representation *SpecialRepresentations::RepresentationFromCharacter(const char *charBytes, size_t len) {
+ PLATFORM_ASSERT(len <= 4);
+ if (!startByteHasReprs[static_cast<unsigned char>(charBytes[0])])
+ return 0;
+ MapRepresentation::iterator it = mapReprs.find(KeyFromString(charBytes, len));
+ if (it != mapReprs.end()) {
+ return &(it->second);
+ }
+ return 0;
+}
+
+bool SpecialRepresentations::Contains(const char *charBytes, size_t len) const {
+ PLATFORM_ASSERT(len <= 4);
+ if (!startByteHasReprs[static_cast<unsigned char>(charBytes[0])])
+ return false;
+ MapRepresentation::const_iterator it = mapReprs.find(KeyFromString(charBytes, len));
+ return it != mapReprs.end();
+}
+
+void SpecialRepresentations::Clear() {
+ mapReprs.clear();
+ std::fill(startByteHasReprs, startByteHasReprs+0x100, 0);
+}
+
+void BreakFinder::Insert(int val) {
+ if (val > nextBreak) {
+ const std::vector<int>::iterator it = std::lower_bound(selAndEdge.begin(), selAndEdge.end(), val);
+ if (it == selAndEdge.end()) {
+ selAndEdge.push_back(val);
+ } else if (*it != val) {
+ selAndEdge.insert(it, 1, val);
+ }
}
- return -1;
}
BreakFinder::BreakFinder(LineLayout *ll_, int lineStart_, int lineEnd_, int posLineStart_,
- int xStart, bool breakForSelection, Document *pdoc_) :
+ int xStart, bool breakForSelection, Document *pdoc_, SpecialRepresentations *preprs_) :
ll(ll_),
lineStart(lineStart_),
lineEnd(lineEnd_),
@@ -373,11 +415,14 @@ BreakFinder::BreakFinder(LineLayout *ll_, int lineStart_, int lineEnd_, int posL
saeCurrentPos(0),
saeNext(0),
subBreak(-1),
- pdoc(pdoc_) {
+ pdoc(pdoc_),
+ encodingFamily(pdoc_->CodePageFamily()),
+ preprs(preprs_) {
// Search for first visible break
// First find the first visible character
- nextBreak = ll->FindBefore(xStart, lineStart, lineEnd);
+ if (xStart > 0.0f)
+ nextBreak = ll->FindBefore(xStart, lineStart, lineEnd);
// Now back to a style break
while ((nextBreak > lineStart) && (ll->styles[nextBreak] == ll->styles[nextBreak - 1])) {
nextBreak--;
@@ -391,76 +436,80 @@ BreakFinder::BreakFinder(LineLayout *ll_, int lineStart_, int lineEnd_, int posL
SelectionSegment portion = ll->psel->Range(r).Intersect(segmentLine);
if (!(portion.start == portion.end)) {
if (portion.start.IsValid())
- Insert(portion.start.Position() - posLineStart - 1);
+ Insert(portion.start.Position() - posLineStart);
if (portion.end.IsValid())
- Insert(portion.end.Position() - posLineStart - 1);
+ Insert(portion.end.Position() - posLineStart);
}
}
}
- Insert(ll->edgeColumn - 1);
- Insert(lineEnd - 1);
-
- if (pdoc && (SC_CP_UTF8 == pdoc->dbcsCodePage)) {
- int trailBytes=0;
- for (int pos = -1;;) {
- pos = NextBadU(ll->chars, pos, lineEnd, trailBytes);
- if (pos < 0)
- break;
- Insert(pos-1);
- Insert(pos);
- }
- }
+ Insert(ll->edgeColumn);
+ Insert(lineEnd);
saeNext = (!selAndEdge.empty()) ? selAndEdge[0] : -1;
}
BreakFinder::~BreakFinder() {
}
-int BreakFinder::First() const {
- return nextBreak;
-}
-
-int BreakFinder::Next() {
+TextSegment BreakFinder::Next() {
if (subBreak == -1) {
int prev = nextBreak;
- while (nextBreak < lineEnd) {
- if ((ll->styles[nextBreak] != ll->styles[nextBreak + 1]) ||
- (nextBreak == saeNext) ||
- IsControlCharacter(ll->chars[nextBreak]) || IsControlCharacter(ll->chars[nextBreak + 1])) {
- if (nextBreak == saeNext) {
+ while (nextBreak < lineEnd) {
+ int charWidth = 1;
+ if (encodingFamily == efUnicode)
+ charWidth = UTF8DrawBytes(reinterpret_cast<unsigned char *>(ll->chars) + nextBreak, lineEnd - nextBreak);
+ else if (encodingFamily == efDBCS)
+ charWidth = pdoc->IsDBCSLeadByte(ll->chars[nextBreak]) ? 2 : 1;
+ Representation *repr = preprs->RepresentationFromCharacter(ll->chars + nextBreak, charWidth);
+ if (((nextBreak > 0) && (ll->styles[nextBreak] != ll->styles[nextBreak - 1])) ||
+ repr ||
+ (nextBreak == saeNext)) {
+ while ((nextBreak >= saeNext) && (saeNext < lineEnd)) {
saeCurrentPos++;
- saeNext = (saeCurrentPos < selAndEdge.size()) ? selAndEdge[saeCurrentPos] : -1;
+ saeNext = (saeCurrentPos < selAndEdge.size()) ? selAndEdge[saeCurrentPos] : lineEnd;
}
- nextBreak++;
- if ((nextBreak - prev) < lengthStartSubdivision) {
- return nextBreak;
+ if ((nextBreak > prev) || repr) {
+ // Have a segment to report
+ if (nextBreak == prev) {
+ nextBreak += charWidth;
+ } else {
+ repr = 0; // Optimize -> should remember repr
+ }
+ if ((nextBreak - prev) < lengthStartSubdivision) {
+ return TextSegment(prev, nextBreak - prev, repr);
+ } else {
+ break;
+ }
}
- break;
}
- nextBreak++;
+ nextBreak += charWidth;
}
if ((nextBreak - prev) < lengthStartSubdivision) {
- return nextBreak;
+ return TextSegment(prev, nextBreak - prev);
}
subBreak = prev;
}
// Splitting up a long run from prev to nextBreak in lots of approximately lengthEachSubdivision.
// For very long runs add extra breaks after spaces or if no spaces before low punctuation.
+ int startSegment = subBreak;
if ((nextBreak - subBreak) <= lengthEachSubdivision) {
subBreak = -1;
- return nextBreak;
+ return TextSegment(startSegment, nextBreak - startSegment);
} else {
subBreak += pdoc->SafeSegment(ll->chars + subBreak, nextBreak-subBreak, lengthEachSubdivision);
if (subBreak >= nextBreak) {
subBreak = -1;
- return nextBreak;
+ return TextSegment(startSegment, nextBreak - startSegment);
} else {
- return subBreak;
+ return TextSegment(startSegment, subBreak - startSegment);
}
}
}
+bool BreakFinder::More() const {
+ return (subBreak >= 0) || (nextBreak < lineEnd);
+}
+
PositionCacheEntry::PositionCacheEntry() :
styleNumber(0), len(0), clock(0), positions(0) {
}
diff --git a/scintilla/src/PositionCache.h b/scintilla/src/PositionCache.h
index 50913f4..bc43915 100644
--- a/scintilla/src/PositionCache.h
+++ b/scintilla/src/PositionCache.h
@@ -113,6 +113,39 @@ public:
void ResetClock();
};
+class Representation {
+public:
+ std::string stringRep;
+ Representation(const char *value="") : stringRep(value) {
+ }
+};
+
+typedef std::map<int, Representation> MapRepresentation;
+
+class SpecialRepresentations {
+ MapRepresentation mapReprs;
+ short startByteHasReprs[0x100];
+public:
+ SpecialRepresentations();
+ void SetRepresentation(const char *charBytes, const char *value);
+ void ClearRepresentation(const char *charBytes);
+ Representation *RepresentationFromCharacter(const char *charBytes, size_t len);
+ bool Contains(const char *charBytes, size_t len) const;
+ void Clear();
+};
+
+struct TextSegment {
+ int start;
+ int length;
+ Representation *representation;
+ TextSegment(int start_=0, int length_=0, Representation *representation_=0) :
+ start(start_), length(length_), representation(representation_) {
+ }
+ int end() const {
+ return start + length;
+ }
+};
+
// Class to break a line of text into shorter runs at sensible places.
class BreakFinder {
LineLayout *ll;
@@ -125,6 +158,8 @@ class BreakFinder {
int saeNext;
int subBreak;
Document *pdoc;
+ EncodingFamily encodingFamily;
+ SpecialRepresentations *preprs;
void Insert(int val);
// Private so BreakFinder objects can not be copied
BreakFinder(const BreakFinder &);
@@ -135,10 +170,10 @@ public:
// Try to make each subdivided run lengthEachSubdivision or shorter.
enum { lengthEachSubdivision = 100 };
BreakFinder(LineLayout *ll_, int lineStart_, int lineEnd_, int posLineStart_,
- int xStart, bool breakForSelection, Document *pdoc_);
+ int xStart, bool breakForSelection, Document *pdoc_, SpecialRepresentations *preprs_);
~BreakFinder();
- int First() const;
- int Next();
+ TextSegment Next();
+ bool More() const;
};
class PositionCache {
diff --git a/scintilla/src/RunStyles.cxx b/scintilla/src/RunStyles.cxx
index 56aca40..733cc0b 100644
--- a/scintilla/src/RunStyles.cxx
+++ b/scintilla/src/RunStyles.cxx
@@ -4,12 +4,13 @@
// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
-#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
#include <stdarg.h>
#include <stdexcept>
+#include <algorithm>
#include "Platform.h"
diff --git a/scintilla/src/ScintillaBase.cxx b/scintilla/src/ScintillaBase.cxx
index 10c9260..53b05a0 100644
--- a/scintilla/src/ScintillaBase.cxx
+++ b/scintilla/src/ScintillaBase.cxx
@@ -262,7 +262,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
ac.lb->SetAverageCharWidth(aveCharWidth);
ac.lb->SetDoubleClickAction(AutoCompleteDoubleClick, this);
- ac.SetList(list);
+ ac.SetList(list ? list : "");
// Fiddle the position of the list so it is right next to the target and wide enough for all its strings
PRectangle rcList = ac.lb->GetDesiredRect();
diff --git a/scintilla/src/SplitVector.h b/scintilla/src/SplitVector.h
index 5b8876c..c52e84b 100644
--- a/scintilla/src/SplitVector.h
+++ b/scintilla/src/SplitVector.h
@@ -9,6 +9,10 @@
#ifndef SPLITVECTOR_H
#define SPLITVECTOR_H
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
template <typename T>
class SplitVector {
protected:
@@ -280,4 +284,8 @@ public:
}
};
+#ifdef SCI_NAMESPACE
+}
+#endif
+
#endif
diff --git a/scintilla/src/UniConversion.cxx b/scintilla/src/UniConversion.cxx
index ed26c5c..8ec1bc4 100644
--- a/scintilla/src/UniConversion.cxx
+++ b/scintilla/src/UniConversion.cxx
@@ -9,6 +9,14 @@
#include "UniConversion.h"
+#ifdef SCI_NAMESPACE
+using namespace Scintilla;
+#endif
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
enum { SURROGATE_LEAD_FIRST = 0xD800 };
enum { SURROGATE_TRAIL_FIRST = 0xDC00 };
enum { SURROGATE_TRAIL_LAST = 0xDFFF };
@@ -246,3 +254,12 @@ int UTF8Classify(const unsigned char *us, int len) {
return UTF8MaskInvalid | 1;
}
}
+
+int UTF8DrawBytes(const unsigned char *us, int len) {
+ int utf8StatusNext = UTF8Classify(us, len);
+ return (utf8StatusNext & UTF8MaskInvalid) ? 1 : (utf8StatusNext & UTF8MaskWidth);
+}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
diff --git a/scintilla/src/UniConversion.h b/scintilla/src/UniConversion.h
index 1f1e537..573ff28 100644
--- a/scintilla/src/UniConversion.h
+++ b/scintilla/src/UniConversion.h
@@ -5,6 +5,13 @@
// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
+#ifndef UNICONVERSION_H
+#define UNICONVERSION_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
const int UTF8MaxBytes = 4;
unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen);
@@ -27,6 +34,10 @@ inline bool UTF8IsAscii(int ch) {
enum { UTF8MaskWidth=0x7, UTF8MaskInvalid=0x8 };
int UTF8Classify(const unsigned char *us, int len);
+// Similar to UTF8Classify but returns a length of 1 for invalid bytes
+// instead of setting the invalid flag
+int UTF8DrawBytes(const unsigned char *us, int len);
+
// Line separator is U+2028 \xe2\x80\xa8
// Paragraph separator is U+2029 \xe2\x80\xa9
const int UTF8SeparatorLength = 3;
@@ -39,3 +50,9 @@ const int UTF8NELLength = 2;
inline bool UTF8IsNEL(const unsigned char *us) {
return (us[0] == 0xc2) && (us[1] == 0x85);
}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/scintilla/src/UnicodeFromUTF8.h b/scintilla/src/UnicodeFromUTF8.h
index 24517e8..ae66cb0 100644
--- a/scintilla/src/UnicodeFromUTF8.h
+++ b/scintilla/src/UnicodeFromUTF8.h
@@ -5,6 +5,13 @@
// Copyright 2013 by Neil Hodgson <neilh@scintilla.org>
// This file is in the public domain.
+#ifndef UNICODEFROMUTF8_H
+#define UNICODEFROMUTF8_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
inline int UnicodeFromUTF8(const unsigned char *us) {
if (us[0] < 0xC2) {
return us[0];
@@ -17,3 +24,9 @@ inline int UnicodeFromUTF8(const unsigned char *us) {
}
return us[0];
}
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/scintilla/src/ViewStyle.cxx b/scintilla/src/ViewStyle.cxx
index 4b99771..4ac2b8e 100644
--- a/scintilla/src/ViewStyle.cxx
+++ b/scintilla/src/ViewStyle.cxx
@@ -104,33 +104,24 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
indicators[ind] = source.indicators[ind];
}
- selforeset = source.selforeset;
- selforeground = source.selforeground;
+ selColours = source.selColours;
selAdditionalForeground = source.selAdditionalForeground;
- selbackset = source.selbackset;
- selbackground = source.selbackground;
selAdditionalBackground = source.selAdditionalBackground;
- selbackground2 = source.selbackground2;
+ selBackground2 = source.selBackground2;
selAlpha = source.selAlpha;
selAdditionalAlpha = source.selAdditionalAlpha;
selEOLFilled = source.selEOLFilled;
- foldmarginColourSet = source.foldmarginColourSet;
foldmarginColour = source.foldmarginColour;
- foldmarginHighlightColourSet = source.foldmarginHighlightColourSet;
foldmarginHighlightColour = source.foldmarginHighlightColour;
- hotspotForegroundSet = source.hotspotForegroundSet;
- hotspotForeground = source.hotspotForeground;
- hotspotBackgroundSet = source.hotspotBackgroundSet;
- hotspotBackground = source.hotspotBackground;
+ hotspotColours = source.hotspotColours;
hotspotUnderline = source.hotspotUnderline;
hotspotSingleLine = source.hotspotSingleLine;
- whitespaceForegroundSet = source.whitespaceForegroundSet;
- whitespaceForeground = source.whitespaceForeground;
- whitespaceBackgroundSet = source.whitespaceBackgroundSet;
- whitespaceBackground = source.whitespaceBackground;
+ whitespaceColours = source.whitespaceColours;
+ controlCharSymbol = source.controlCharSymbol;
+ controlCharWidth = source.controlCharWidth;
selbar = source.selbar;
selbarlight = source.selbarlight;
caretcolour = source.caretcolour;
@@ -169,6 +160,18 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
braceHighlightIndicator = source.braceHighlightIndicator;
braceBadLightIndicatorSet = source.braceBadLightIndicatorSet;
braceBadLightIndicator = source.braceBadLightIndicator;
+
+ theEdge = source.theEdge;
+
+ marginNumberPadding = source.marginNumberPadding;
+ ctrlCharPadding = source.ctrlCharPadding;
+ lastSegItalicsOffset = source.lastSegItalicsOffset;
+
+ wrapState = source.wrapState;
+ wrapVisualFlags = source.wrapVisualFlags;
+ wrapVisualFlagsLocation = source.wrapVisualFlagsLocation;
+ wrapVisualStartIndent = source.wrapVisualStartIndent;
+ wrapIndentMode = source.wrapIndentMode;
}
ViewStyle::~ViewStyle() {
@@ -204,27 +207,24 @@ void ViewStyle::Init(size_t stylesSize_) {
maxDescent = 1;
aveCharWidth = 8;
spaceWidth = 8;
+ tabWidth = spaceWidth * 8;
- selforeset = false;
- selforeground = ColourDesired(0xff, 0, 0);
+ selColours.fore = ColourOptional(ColourDesired(0xff, 0, 0));
+ selColours.back = ColourOptional(ColourDesired(0xc0, 0xc0, 0xc0), true);
selAdditionalForeground = ColourDesired(0xff, 0, 0);
- selbackset = true;
- selbackground = ColourDesired(0xc0, 0xc0, 0xc0);
selAdditionalBackground = ColourDesired(0xd7, 0xd7, 0xd7);
- selbackground2 = ColourDesired(0xb0, 0xb0, 0xb0);
+ selBackground2 = ColourDesired(0xb0, 0xb0, 0xb0);
selAlpha = SC_ALPHA_NOALPHA;
selAdditionalAlpha = SC_ALPHA_NOALPHA;
selEOLFilled = false;
- foldmarginColourSet = false;
- foldmarginColour = ColourDesired(0xff, 0, 0);
- foldmarginHighlightColourSet = false;
- foldmarginHighlightColour = ColourDesired(0xc0, 0xc0, 0xc0);
+ foldmarginColour = ColourOptional(ColourDesired(0xff, 0, 0));
+ foldmarginHighlightColour = ColourOptional(ColourDesired(0xc0, 0xc0, 0xc0));
- whitespaceForegroundSet = false;
- whitespaceForeground = ColourDesired(0, 0, 0);
- whitespaceBackgroundSet = false;
- whitespaceBackground = ColourDesired(0xff, 0xff, 0xff);
+ whitespaceColours.fore = ColourOptional();
+ whitespaceColours.back = ColourOptional(ColourDesired(0xff, 0xff, 0xff));
+ controlCharSymbol = 0; /* Draw the control characters */
+ controlCharWidth = 0;
selbar = Platform::Chrome();
selbarlight = Platform::ChromeHighlight();
styles[STYLE_LINENUMBER].fore = ColourDesired(0, 0, 0);
@@ -242,10 +242,8 @@ void ViewStyle::Init(size_t stylesSize_) {
someStylesProtected = false;
someStylesForceCase = false;
- hotspotForegroundSet = false;
- hotspotForeground = ColourDesired(0, 0, 0xff);
- hotspotBackgroundSet = false;
- hotspotBackground = ColourDesired(0xff, 0xff, 0xff);
+ hotspotColours.fore = ColourOptional(ColourDesired(0, 0, 0xff));
+ hotspotColours.back = ColourOptional(ColourDesired(0xff, 0xff, 0xff));
hotspotUnderline = true;
hotspotSingleLine = true;
@@ -284,9 +282,21 @@ void ViewStyle::Init(size_t stylesSize_) {
braceHighlightIndicator = 0;
braceBadLightIndicatorSet = false;
braceBadLightIndicator = 0;
+
+ theEdge = 0;
+
+ marginNumberPadding = 3;
+ ctrlCharPadding = 3; // +3 For a blank on front and rounded edge each side
+ lastSegItalicsOffset = 2;
+
+ wrapState = eWrapNone;
+ wrapVisualFlags = 0;
+ wrapVisualFlagsLocation = 0;
+ wrapVisualStartIndent = 0;
+ wrapIndentMode = SC_WRAPINDENT_FIXED;
}
-void ViewStyle::Refresh(Surface &surface) {
+void ViewStyle::Refresh(Surface &surface, int tabInChars) {
for (FontMap::iterator it = fonts.begin(); it != fonts.end(); ++it) {
delete it->second;
}
@@ -332,6 +342,12 @@ void ViewStyle::Refresh(Surface &surface) {
aveCharWidth = styles[STYLE_DEFAULT].aveCharWidth;
spaceWidth = styles[STYLE_DEFAULT].spaceWidth;
+ tabWidth = spaceWidth * tabInChars;
+
+ controlCharWidth = 0.0;
+ if (controlCharSymbol >= 32) {
+ controlCharWidth = surface.WidthChar(styles[STYLE_CONTROLCHAR].font, controlCharSymbol);
+ }
fixedColumnWidth = marginInside ? leftMarginWidth : 0;
maskInLine = 0xffffffff;
@@ -350,6 +366,10 @@ void ViewStyle::ReleaseAllExtendedStyles() {
int ViewStyle::AllocateExtendedStyles(int numberStyles) {
int startRange = static_cast<int>(nextExtendedStyle);
nextExtendedStyle += numberStyles;
+ EnsureStyle(nextExtendedStyle);
+ for (size_t i=startRange; i<nextExtendedStyle; i++) {
+ styles[i].ClearTo(styles[STYLE_DEFAULT]);
+ }
return startRange;
}
@@ -389,6 +409,10 @@ bool ViewStyle::ProtectionActive() const {
return someStylesProtected;
}
+int ViewStyle::ExternalMarginWidth() const {
+ return marginInside ? 0 : fixedColumnWidth;
+}
+
bool ViewStyle::ValidStyle(size_t styleIndex) const {
return styleIndex < styles.size();
}
@@ -409,6 +433,55 @@ void ViewStyle::CalcLargestMarkerHeight() {
}
}
+ColourDesired ViewStyle::WrapColour() const {
+ if (whitespaceColours.fore.isSet)
+ return whitespaceColours.fore;
+ else
+ return styles[STYLE_DEFAULT].fore;
+}
+
+bool ViewStyle::SetWrapState(int wrapState_) {
+ WrapMode wrapStateWanted;
+ switch (wrapState_) {
+ case SC_WRAP_WORD:
+ wrapStateWanted = eWrapWord;
+ break;
+ case SC_WRAP_CHAR:
+ wrapStateWanted = eWrapChar;
+ break;
+ default:
+ wrapStateWanted = eWrapNone;
+ break;
+ }
+ bool changed = wrapState != wrapStateWanted;
+ wrapState = wrapStateWanted;
+ return changed;
+}
+
+bool ViewStyle::SetWrapVisualFlags(int wrapVisualFlags_) {
+ bool changed = wrapVisualFlags != wrapVisualFlags_;
+ wrapVisualFlags = wrapVisualFlags_;
+ return changed;
+}
+
+bool ViewStyle::SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation_) {
+ bool changed = wrapVisualFlagsLocation != wrapVisualFlagsLocation_;
+ wrapVisualFlagsLocation = wrapVisualFlagsLocation_;
+ return changed;
+}
+
+bool ViewStyle::SetWrapVisualStartIndent(int wrapVisualStartIndent_) {
+ bool changed = wrapVisualStartIndent != wrapVisualStartIndent_;
+ wrapVisualStartIndent = wrapVisualStartIndent_;
+ return changed;
+}
+
+bool ViewStyle::SetWrapIndentMode(int wrapIndentMode_) {
+ bool changed = wrapIndentMode != wrapIndentMode_;
+ wrapIndentMode = wrapIndentMode_;
+ return changed;
+}
+
void ViewStyle::AllocStyles(size_t sizeNew) {
size_t i=styles.size();
styles.resize(sizeNew);
diff --git a/scintilla/src/ViewStyle.h b/scintilla/src/ViewStyle.h
index 2288a64..f795993 100644
--- a/scintilla/src/ViewStyle.h
+++ b/scintilla/src/ViewStyle.h
@@ -56,6 +56,22 @@ enum WhiteSpaceVisibility {wsInvisible=0, wsVisibleAlways=1, wsVisibleAfterInden
typedef std::map<FontSpecification, FontRealised *> FontMap;
+enum WrapMode { eWrapNone, eWrapWord, eWrapChar };
+
+class ColourOptional : public ColourDesired {
+public:
+ bool isSet;
+ ColourOptional(ColourDesired colour_=ColourDesired(0,0,0), bool isSet_=false) : ColourDesired(colour_), isSet(isSet_) {
+ }
+ ColourOptional(uptr_t wParam, sptr_t lParam) : ColourDesired(lParam), isSet(wParam != 0) {
+ }
+};
+
+struct ForeBackColours {
+ ColourOptional fore;
+ ColourOptional back;
+};
+
/**
*/
class ViewStyle {
@@ -73,30 +89,22 @@ public:
unsigned int maxDescent;
XYPOSITION aveCharWidth;
XYPOSITION spaceWidth;
- bool selforeset;
- ColourDesired selforeground;
+ XYPOSITION tabWidth;
+ ForeBackColours selColours;
ColourDesired selAdditionalForeground;
- bool selbackset;
- ColourDesired selbackground;
ColourDesired selAdditionalBackground;
- ColourDesired selbackground2;
+ ColourDesired selBackground2;
int selAlpha;
int selAdditionalAlpha;
bool selEOLFilled;
- bool whitespaceForegroundSet;
- ColourDesired whitespaceForeground;
- bool whitespaceBackgroundSet;
- ColourDesired whitespaceBackground;
+ ForeBackColours whitespaceColours;
+ int controlCharSymbol;
+ XYPOSITION controlCharWidth;
ColourDesired selbar;
ColourDesired selbarlight;
- bool foldmarginColourSet;
- ColourDesired foldmarginColour;
- bool foldmarginHighlightColourSet;
- ColourDesired foldmarginHighlightColour;
- bool hotspotForegroundSet;
- ColourDesired hotspotForeground;
- bool hotspotBackgroundSet;
- ColourDesired hotspotBackground;
+ ColourOptional foldmarginColour;
+ ColourOptional foldmarginHighlightColour;
+ ForeBackColours hotspotColours;
bool hotspotUnderline;
bool hotspotSingleLine;
/// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin
@@ -134,12 +142,23 @@ public:
int braceHighlightIndicator;
bool braceBadLightIndicatorSet;
int braceBadLightIndicator;
+ int theEdge;
+ int marginNumberPadding; // the right-side padding of the number margin
+ int ctrlCharPadding; // the padding around control character text blobs
+ int lastSegItalicsOffset; // the offset so as not to clip italic characters at EOLs
+
+ // Wrapping support
+ WrapMode wrapState;
+ int wrapVisualFlags;
+ int wrapVisualFlagsLocation;
+ int wrapVisualStartIndent;
+ int wrapIndentMode; // SC_WRAPINDENT_FIXED, _SAME, _INDENT
ViewStyle();
ViewStyle(const ViewStyle &source);
~ViewStyle();
void Init(size_t stylesSize_=64);
- void Refresh(Surface &surface);
+ void Refresh(Surface &surface, int tabInChars);
void ReleaseAllExtendedStyles();
int AllocateExtendedStyles(int numberStyles);
void EnsureStyle(size_t index);
@@ -147,8 +166,16 @@ public:
void ClearStyles();
void SetStyleFontName(int styleIndex, const char *name);
bool ProtectionActive() const;
+ int ExternalMarginWidth() const;
bool ValidStyle(size_t styleIndex) const;
void CalcLargestMarkerHeight();
+ ColourDesired WrapColour() const;
+ bool SetWrapState(int wrapState_);
+ bool SetWrapVisualFlags(int wrapVisualFlags_);
+ bool SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation_);
+ bool SetWrapVisualStartIndent(int wrapVisualStartIndent_);
+ bool SetWrapIndentMode(int wrapIndentMode_);
+
private:
void AllocStyles(size_t sizeNew);
void CreateFont(const FontSpecification &fs);
diff --git a/scintilla/src/XPM.cxx b/scintilla/src/XPM.cxx
index 59fa2c2..eeadce9 100644
--- a/scintilla/src/XPM.cxx
+++ b/scintilla/src/XPM.cxx
@@ -5,8 +5,8 @@
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
#include <vector>
#include <map>
diff --git a/scintilla/version.txt b/scintilla/version.txt
index 2d40575..ebf9bc9 100644
--- a/scintilla/version.txt
+++ b/scintilla/version.txt
@@ -1 +1 @@
-334
+335
diff --git a/scintilla/win32/PlatWin.cxx b/scintilla/win32/PlatWin.cxx
index d9c65f8..9d45735 100644
--- a/scintilla/win32/PlatWin.cxx
+++ b/scintilla/win32/PlatWin.cxx
@@ -7,12 +7,12 @@
#include <stdlib.h>
#include <string.h>
+#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
-#include <stdio.h>
#include <time.h>
-#include <limits.h>
#include <math.h>
+#include <limits.h>
#include <vector>
#include <map>
@@ -285,6 +285,7 @@ static void SetLogFont(LOGFONTA &lf, const char *faceName, int characterSet, flo
lf.lfCharSet = static_cast<BYTE>(characterSet);
lf.lfQuality = Win32MapFontQuality(extraFontFlag);
strncpy(lf.lfFaceName, faceName, sizeof(lf.lfFaceName));
+ lf.lfFaceName[sizeof(lf.lfFaceName)-1] = '\0';
}
/**
@@ -1746,14 +1747,17 @@ void SurfaceD2D::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *
} else {
// May be more than one byte per position
- int ui = 0;
+ unsigned int ui = 0;
+ FLOAT position = 0.0f;
for (int i=0;i<len;) {
+ if (ui < count)
+ position = poses.buffer[ui];
if (Platform::IsDBCSLeadByte(codePageText, s[i])) {
- positions[i] = poses.buffer[ui];
- positions[i+1] = poses.buffer[ui];
+ positions[i] = position;
+ positions[i+1] = position;
i += 2;
} else {
- positions[i] = poses.buffer[ui];
+ positions[i] = position;
i++;
}
@@ -2270,12 +2274,15 @@ PRectangle ListBoxX::GetDesiredRect() {
HDC hdc = ::GetDC(lb);
HFONT oldFont = SelectFont(hdc, fontCopy);
SIZE textSize = {0, 0};
- int len = static_cast<int>(widestItem ? strlen(widestItem) : 0);
- if (unicodeMode) {
- const TextWide tbuf(widestItem, len, unicodeMode);
- ::GetTextExtentPoint32W(hdc, tbuf.buffer, tbuf.tlen, &textSize);
- } else {
- ::GetTextExtentPoint32A(hdc, widestItem, len, &textSize);
+ int len = 0;
+ if (widestItem) {
+ len = static_cast<int>(strlen(widestItem));
+ if (unicodeMode) {
+ const TextWide tbuf(widestItem, len, unicodeMode);
+ ::GetTextExtentPoint32W(hdc, tbuf.buffer, tbuf.tlen, &textSize);
+ } else {
+ ::GetTextExtentPoint32A(hdc, widestItem, len, &textSize);
+ }
}
TEXTMETRIC tm;
::GetTextMetrics(hdc, &tm);
@@ -2439,7 +2446,11 @@ void ListBoxX::Draw(DRAWITEMSTRUCT *pDrawItem) {
delete surfaceItem;
pDCRT->EndDraw();
pDCRT->Release();
+ } else {
+ delete surfaceItem;
}
+ } else {
+ delete surfaceItem;
}
#endif
}
@@ -2991,6 +3002,7 @@ ElapsedTime::ElapsedTime() {
littleBit = timeVal.LowPart;
} else {
bigBit = clock();
+ littleBit = 0;
}
}
diff --git a/scintilla/win32/PlatWin.h b/scintilla/win32/PlatWin.h
index 40c95bf..310059b 100644
--- a/scintilla/win32/PlatWin.h
+++ b/scintilla/win32/PlatWin.h
@@ -5,6 +5,13 @@
// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
+#ifndef PLATWIN_H
+#define PLATWIN_H
+
+#ifdef SCI_NAMESPACE
+namespace Scintilla {
+#endif
+
extern bool IsNT();
extern void Platform_Initialise(void *hInstance);
extern void Platform_Finalise();
@@ -14,3 +21,9 @@ extern bool LoadD2D();
extern ID2D1Factory *pD2DFactory;
extern IDWriteFactory *pIDWriteFactory;
#endif
+
+#ifdef SCI_NAMESPACE
+}
+#endif
+
+#endif
diff --git a/scintilla/win32/ScintillaWin.cxx b/scintilla/win32/ScintillaWin.cxx
index 8b3a98f..e0da04f 100644
--- a/scintilla/win32/ScintillaWin.cxx
+++ b/scintilla/win32/ScintillaWin.cxx
@@ -5,7 +5,6 @@
// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
-#include <new>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -13,6 +12,7 @@
#include <assert.h>
#include <limits.h>
+#include <new>
#include <string>
#include <vector>
#include <map>
@@ -197,6 +197,7 @@ class ScintillaWin :
bool hasOKText;
CLIPFORMAT cfColumnSelect;
+ CLIPFORMAT cfBorlandIDEBlockType;
CLIPFORMAT cfLineSelect;
HRESULT hrOle;
@@ -347,9 +348,11 @@ ScintillaWin::ScintillaWin(HWND hwnd) {
hasOKText = false;
// There does not seem to be a real standard for indicating that the clipboard
- // contains a rectangular selection, so copy Developer Studio.
+ // contains a rectangular selection, so copy Developer Studio and Borland Delphi.
cfColumnSelect = static_cast<CLIPFORMAT>(
::RegisterClipboardFormat(TEXT("MSDEVColumnSelect")));
+ cfBorlandIDEBlockType = static_cast<CLIPFORMAT>(
+ ::RegisterClipboardFormat(TEXT("Borland IDE Block Type")));
// Likewise for line-copy (copies a full line when no text is selected)
cfLineSelect = static_cast<CLIPFORMAT>(
@@ -623,7 +626,11 @@ LRESULT ScintillaWin::WndPaint(uptr_t wParam) {
::EndPaint(MainHWND(), pps);
if (paintState == paintAbandoned) {
// Painting area was insufficient to cover new styling or brace highlight positions
- FullPaint();
+ if (IsOcxCtrl) {
+ FullPaintDC(pps->hdc);
+ } else {
+ FullPaint();
+ }
}
paintState = notPainting;
@@ -890,7 +897,10 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
case WM_MOUSEMOVE:
SetTrackMouseLeaveEvent(true);
- ButtonMove(Point::FromLong(lParam));
+ ButtonMoveWithModifiers(Point::FromLong(lParam),
+ ((wParam & MK_SHIFT) != 0 ? SCI_SHIFT : 0) |
+ ((wParam & MK_CONTROL) != 0 ? SCI_CTRL : 0) |
+ (Platform::IsKeyDown(VK_MENU) ? SCI_ALT : 0));
break;
case WM_MOUSELEAVE:
@@ -1386,7 +1396,7 @@ bool ScintillaWin::ModifyScrollBars(int nMax, int nPage) {
if (horizEndPreferred < 0)
horizEndPreferred = 0;
unsigned int pageWidth = rcText.Width();
- if (!horizontalScrollBarVisible || (wrapState != eWrapNone))
+ if (!horizontalScrollBarVisible || Wrapping())
pageWidth = horizEndPreferred + 1;
sci.fMask = SIF_PAGE | SIF_RANGE;
GetScrollInfo(SB_HORZ, &sci);
@@ -1697,7 +1707,16 @@ void ScintillaWin::Paste() {
SelectionPosition selStart = sel.IsRectangular() ?
sel.Rectangular().Start() :
sel.Range(sel.Main()).Start();
- bool isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect) != 0;
+ bool isRectangular = (::IsClipboardFormatAvailable(cfColumnSelect) != 0);
+
+ if (!isRectangular) {
+ // Evaluate "Borland IDE Block Type" explicitly
+ GlobalMemory memBorlandSelection(::GetClipboardData(cfBorlandIDEBlockType));
+ if (memBorlandSelection) {
+ isRectangular = (memBorlandSelection.Size() == 1) && (static_cast<BYTE *>(memBorlandSelection.ptr)[0] == 0x02);
+ memBorlandSelection.Unlock();
+ }
+ }
// Always use CF_UNICODETEXT if available
GlobalMemory memUSelection(::GetClipboardData(CF_UNICODETEXT));
@@ -2132,7 +2151,7 @@ void ScintillaWin::ImeStartComposition() {
lf.lfItalic = static_cast<BYTE>(vs.styles[styleHere].italic ? 1 : 0);
lf.lfCharSet = DEFAULT_CHARSET;
lf.lfFaceName[0] = '\0';
- if (vs.styles[styleHere].fontName)
+ if (vs.styles[styleHere].fontName && (strlen(vs.styles[styleHere].fontName) < sizeof(lf.lfFaceName)))
strcpy(lf.lfFaceName, vs.styles[styleHere].fontName);
::ImmSetCompositionFontA(hIMC, &lf);
@@ -2244,6 +2263,13 @@ void ScintillaWin::CopyToClipboard(const SelectionText &selectedText) {
if (selectedText.rectangular) {
::SetClipboardData(cfColumnSelect, 0);
+
+ GlobalMemory borlandSelection;
+ borlandSelection.Allocate(1);
+ if (borlandSelection) {
+ static_cast<BYTE *>(borlandSelection.ptr)[0] = 0x02;
+ borlandSelection.SetClip(cfBorlandIDEBlockType);
+ }
}
if (selectedText.lineCopy) {