summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Readme-mod.txt2
-rw-r--r--scintilla/doc/ScintillaDoc.html31
-rw-r--r--scintilla/doc/ScintillaHistory.html2
-rw-r--r--scintilla/include/Scintilla.h4
-rw-r--r--scintilla/include/Scintilla.iface14
-rw-r--r--scintilla/src/CharClassify.cxx16
-rw-r--r--scintilla/src/CharClassify.h1
-rw-r--r--scintilla/src/Document.cxx6
-rw-r--r--scintilla/src/Document.h1
-rw-r--r--scintilla/src/Editor.cxx16
10 files changed, 84 insertions, 9 deletions
diff --git a/Readme-mod.txt b/Readme-mod.txt
index 426f8ac..3263423 100644
--- a/Readme-mod.txt
+++ b/Readme-mod.txt
@@ -31,6 +31,6 @@ Ctrl+Alt+F2 Expand selection to next match.
Ctrl+Alt+Shift+F2 Expand selection to previous match.
Ctrl+Shift+Enter New line with toggled auto indent option.
-Notepad2-mod 4.2.25 has been created with Scintilla 3.2.0 HG cdf405b6a70c.
+Notepad2-mod 4.2.25 has been created with Scintilla 3.2.0 HG 6b1e016f96a2.
You can use WDK 7.1, MSVC 2010 or Intel C++ Compiler XE 2011 SP1 Update 10
to build Notepad2-mod.
diff --git a/scintilla/doc/ScintillaDoc.html b/scintilla/doc/ScintillaDoc.html
index 307b664..76fd1bd 100644
--- a/scintilla/doc/ScintillaDoc.html
+++ b/scintilla/doc/ScintillaDoc.html
@@ -3026,10 +3026,12 @@ struct Sci_TextToFind {
<a class="message" href="#SCI_GETCODEPAGE">SCI_GETCODEPAGE</a><br />
<a class="message" href="#SCI_SETKEYSUNICODE">SCI_SETKEYSUNICODE(bool keysUnicode)</a><br />
<a class="message" href="#SCI_GETKEYSUNICODE">SCI_GETKEYSUNICODE</a><br />
- <a class="message" href="#SCI_SETWORDCHARS">SCI_SETWORDCHARS(&lt;unused&gt;, const char
- *chars)</a><br />
- <a class="message" href="#SCI_SETWHITESPACECHARS">SCI_SETWHITESPACECHARS(&lt;unused&gt;, const char
- *chars)</a><br />
+ <a class="message" href="#SCI_SETWORDCHARS">SCI_SETWORDCHARS(&lt;unused&gt;, const char *characters)</a><br />
+ <a class="message" href="#SCI_GETWORDCHARS">SCI_GETWORDCHARS(&lt;unused&gt;, char *characters)</a><br />
+ <a class="message" href="#SCI_SETWHITESPACECHARS">SCI_SETWHITESPACECHARS(&lt;unused&gt;, const char *characters)</a><br />
+ <a class="message" href="#SCI_GETWHITESPACECHARS">SCI_GETWHITESPACECHARS(&lt;unused&gt;, char *characters)</a><br />
+ <a class="message" href="#SCI_SETPUNCTUATIONCHARS">SCI_SETPUNCTUATIONCHARS(&lt;unused&gt;, const char *characters)</a><br />
+ <a class="message" href="#SCI_GETPUNCTUATIONCHARS">SCI_GETPUNCTUATIONCHARS(&lt;unused&gt;, char *characters)</a><br />
<a class="message" href="#SCI_SETCHARSDEFAULT">SCI_SETCHARSDEFAULT</a><br />
<a class="message" href="#SCI_GRABFOCUS">SCI_GRABFOCUS</a><br />
<a class="message" href="#SCI_SETFOCUS">SCI_SETFOCUS(bool focus)</a><br />
@@ -3111,7 +3113,7 @@ struct Sci_TextToFind {
or narrow character window with character messages treated as Unicode when wide and as 8 bit otherwise.
Set this property to always treat as Unicode. This option is needed for Delphi.</p>
- <p><b id="SCI_SETWORDCHARS">SCI_SETWORDCHARS(&lt;unused&gt;, const char *chars)</b><br />
+ <p><b id="SCI_SETWORDCHARS">SCI_SETWORDCHARS(&lt;unused&gt;, const char *characters)</b><br />
Scintilla has several functions that operate on words, which are defined to be contiguous
sequences of characters from a particular set of characters. This message defines which
characters are members of that set. The character sets are set to default values before processing this
@@ -3120,13 +3122,28 @@ struct Sci_TextToFind {
use:<br />
<code>SCI_SETWORDCHARS(0, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")</code>;</p>
- <p><b id="SCI_SETWHITESPACECHARS">SCI_SETWHITESPACECHARS(&lt;unused&gt;, const char *chars)</b><br />
+ <p><b id="SCI_GETWORDCHARS">SCI_GETWORDCHARS(&lt;unused&gt;, char *characters)</b><br />
+ This fills the characters parameter with all the characters included in words.
+ The characters parameter must be large enough to hold all of the characters.
+ If the characters parameter is 0 then the length that should be allocated
+ to store the entire set is returned.</p>
+
+ <p><b id="SCI_SETWHITESPACECHARS">SCI_SETWHITESPACECHARS(&lt;unused&gt;, const char *characters)</b><br />
+ <b id="SCI_GETWHITESPACECHARS">SCI_GETWHITESPACECHARS(&lt;unused&gt;, char *characters)</b><br />
Similar to <code>SCI_SETWORDCHARS</code>, this message allows the user to define which chars Scintilla considers
as whitespace. Setting the whitespace chars allows the user to fine-tune Scintilla's behaviour doing
such things as moving the cursor to the start or end of a word; for example, by defining punctuation chars
as whitespace, they will be skipped over when the user presses ctrl+left or ctrl+right.
This function should be called after <code>SCI_SETWORDCHARS</code> as it will
- reset the whitespace characters to the default set.</p>
+ reset the whitespace characters to the default set.
+ <code>SCI_GETWHITESPACECHARS</code> behaves similarly to <code>SCI_GETWORDCHARS</code>.</p>
+
+ <p><b id="SCI_SETPUNCTUATIONCHARS">SCI_SETPUNCTUATIONCHARS(&lt;unused&gt;, const char *characters)</b><br />
+ <b id="SCI_GETPUNCTUATIONCHARS">SCI_GETPUNCTUATIONCHARS(&lt;unused&gt;, char *characters)</b><br />
+ Similar to <code>SCI_SETWORDCHARS</code> and <code>SCI_SETWHITESPACECHARS</code>, this message
+ allows the user to define which chars Scintilla considers as punctuation.
+ <code>SCI_GETPUNCTUATIONCHARS</code> behaves similarly to <code>SCI_GETWORDCHARS</code>.</p>
+
<p><b id="SCI_SETCHARSDEFAULT">SCI_SETCHARSDEFAULT</b><br />
Use the default sets of word and whitespace characters. This sets whitespace to space, tab and other
characters with codes less than 0x20, with word characters set to alphanumeric and '_'.
diff --git a/scintilla/doc/ScintillaHistory.html b/scintilla/doc/ScintillaHistory.html
index a401389..70fe55a 100644
--- a/scintilla/doc/ScintillaHistory.html
+++ b/scintilla/doc/ScintillaHistory.html
@@ -400,6 +400,8 @@
<td>James Ribe</td>
<td>Markus Nißl</td>
<td>Martin Panter</td>
+ </tr><tr>
+ <td>Mark Yen</td>
</tr>
</table>
<p>
diff --git a/scintilla/include/Scintilla.h b/scintilla/include/Scintilla.h
index 17a60c1..8344538 100644
--- a/scintilla/include/Scintilla.h
+++ b/scintilla/include/Scintilla.h
@@ -246,6 +246,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_GETCARETPERIOD 2075
#define SCI_SETCARETPERIOD 2076
#define SCI_SETWORDCHARS 2077
+#define SCI_GETWORDCHARS 2646
#define SCI_BEGINUNDOACTION 2078
#define SCI_ENDUNDOACTION 2079
#define INDIC_PLAIN 0
@@ -684,6 +685,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_WORDRIGHTEND 2441
#define SCI_WORDRIGHTENDEXTEND 2442
#define SCI_SETWHITESPACECHARS 2443
+#define SCI_GETWHITESPACECHARS 2647
+#define SCI_SETPUNCTUATIONCHARS 2648
+#define SCI_GETPUNCTUATIONCHARS 2649
#define SCI_SETCHARSDEFAULT 2444
#define SCI_AUTOCGETCURRENT 2445
#define SCI_AUTOCGETCURRENTTEXT 2610
diff --git a/scintilla/include/Scintilla.iface b/scintilla/include/Scintilla.iface
index adc637c..c628ead 100644
--- a/scintilla/include/Scintilla.iface
+++ b/scintilla/include/Scintilla.iface
@@ -552,6 +552,10 @@ set void SetCaretPeriod=2076(int periodMilliseconds,)
# First sets defaults like SetCharsDefault.
set void SetWordChars=2077(, string characters)
+# Get the set of characters making up words for when moving or selecting by word.
+# Retuns the number of characters
+get int GetWordChars=2646(, stringresult characters)
+
# Start a sequence of actions that is undone and redone as a unit.
# May be nested.
fun void BeginUndoAction=2078(,)
@@ -1800,6 +1804,16 @@ fun void WordRightEndExtend=2442(,)
# Should be called after SetWordChars.
set void SetWhitespaceChars=2443(, string characters)
+# Get the set of characters making up whitespace for when moving or selecting by word.
+get int GetWhitespaceChars=2647(, stringresult characters)
+
+# Set the set of characters making up punctuation characters
+# Should be called after SetWordChars.
+set void SetPunctuationChars=2648(, string characters)
+
+# Get the set of characters making up punctuation characters
+get int GetPunctuationChars=2649(, stringresult characters)
+
# Reset the set of characters for whitespace and word characters to the defaults.
fun void SetCharsDefault=2444(,)
diff --git a/scintilla/src/CharClassify.cxx b/scintilla/src/CharClassify.cxx
index 89e690d..abe39f8 100644
--- a/scintilla/src/CharClassify.cxx
+++ b/scintilla/src/CharClassify.cxx
@@ -46,3 +46,19 @@ void CharClassify::SetCharClasses(const unsigned char *chars, cc newCharClass) {
}
}
}
+
+int CharClassify::GetCharsOfClass(cc characterClass, unsigned char *buffer) {
+ // Get characters belonging to the given char class; return the number
+ // of characters (if the buffer is NULL, don't write to it).
+ int count = 0;
+ for (int ch = maxChar - 1; ch >= 0; --ch) {
+ if (charClass[ch] == characterClass) {
+ ++count;
+ if (buffer) {
+ *buffer = static_cast<unsigned char>(ch);
+ buffer++;
+ }
+ }
+ }
+ return count;
+}
diff --git a/scintilla/src/CharClassify.h b/scintilla/src/CharClassify.h
index f4b5aef..4b322a6 100644
--- a/scintilla/src/CharClassify.h
+++ b/scintilla/src/CharClassify.h
@@ -19,6 +19,7 @@ public:
enum cc { ccSpace, ccNewLine, ccWord, ccPunctuation };
void SetDefaultCharClasses(bool includeWordClass);
void SetCharClasses(const unsigned char *chars, cc newCharClass);
+ int GetCharsOfClass(cc charClass, unsigned char *buffer);
cc GetClass(unsigned char ch) const { return static_cast<cc>(charClass[ch]);}
bool IsWord(unsigned char ch) const { return static_cast<cc>(charClass[ch]) == ccWord;}
diff --git a/scintilla/src/Document.cxx b/scintilla/src/Document.cxx
index f5ac169..a491aa8 100644
--- a/scintilla/src/Document.cxx
+++ b/scintilla/src/Document.cxx
@@ -751,7 +751,7 @@ void Document::CheckReadOnly() {
// SetStyleAt does not change the persistent state of a document
bool Document::DeleteChars(int pos, int len) {
- if (len == 0)
+ if (len <= 0)
return false;
if ((pos + len) > Length())
return false;
@@ -1615,6 +1615,10 @@ void Document::SetCharClasses(const unsigned char *chars, CharClassify::cc newCh
charClass.SetCharClasses(chars, newCharClass);
}
+int Document::GetCharsOfClass(CharClassify::cc characterClass, unsigned char *buffer) {
+ return charClass.GetCharsOfClass(characterClass, buffer);
+}
+
void Document::SetStylingBits(int bits) {
stylingBits = bits;
stylingBitsMask = (1 << stylingBits) - 1;
diff --git a/scintilla/src/Document.h b/scintilla/src/Document.h
index dcdafd4..926fb48 100644
--- a/scintilla/src/Document.h
+++ b/scintilla/src/Document.h
@@ -364,6 +364,7 @@ public:
void SetDefaultCharClasses(bool includeWordClass);
void SetCharClasses(const unsigned char *chars, CharClassify::cc newCharClass);
+ int GetCharsOfClass(CharClassify::cc charClass, unsigned char *buffer);
void SetStylingBits(int bits);
void SCI_METHOD StartStyling(int position, char mask);
bool SCI_METHOD SetStyleFor(int length, char style);
diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx
index 4d3a7ff..24306a4 100644
--- a/scintilla/src/Editor.cxx
+++ b/scintilla/src/Editor.cxx
@@ -7527,6 +7527,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
caret.period = wParam;
break;
+ case SCI_GETWORDCHARS:
+ return pdoc->GetCharsOfClass(CharClassify::ccWord, reinterpret_cast<unsigned char *>(lParam));
+
case SCI_SETWORDCHARS: {
pdoc->SetDefaultCharClasses(false);
if (lParam == 0)
@@ -7535,6 +7538,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
}
break;
+ case SCI_GETWHITESPACECHARS:
+ return pdoc->GetCharsOfClass(CharClassify::ccSpace, reinterpret_cast<unsigned char *>(lParam));
+
case SCI_SETWHITESPACECHARS: {
if (lParam == 0)
return 0;
@@ -7542,6 +7548,16 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
}
break;
+ case SCI_GETPUNCTUATIONCHARS:
+ return pdoc->GetCharsOfClass(CharClassify::ccPunctuation, reinterpret_cast<unsigned char *>(lParam));
+
+ case SCI_SETPUNCTUATIONCHARS: {
+ if (lParam == 0)
+ return 0;
+ pdoc->SetCharClasses(reinterpret_cast<unsigned char *>(lParam), CharClassify::ccPunctuation);
+ }
+ break;
+
case SCI_SETCHARSDEFAULT:
pdoc->SetDefaultCharClasses(true);
break;