From 0eeee7531d739c2fc06e54eb56d27f361ece0503 Mon Sep 17 00:00:00 2001
From: nyamatongwe
On X, the clipboard is asynchronous and may require several messages between - the destination and source applications. Data from SCI_PASTE will not arrive in the + the destination and source applications. Data from SCI_PASTE will not arrive in the document immediately.
SCI_COPYRANGE(int start, int end)On Windows, code page can be set to 932 (Japanese Shift-JIS), 936 (Simplified Chinese GBK), - 949 (Korean), and 950 (Traditional Chinese Big5) although these may require installation of language +
On Windows, code page can be set to 932 (Japanese Shift-JIS), 936 (Simplified Chinese GBK), + 949 (Korean), and 950 (Traditional Chinese Big5) although these may require installation of language specific support.
On GTK+, code page SC_CP_DBCS (1) sets Scintilla into
@@ -2888,10 +2888,10 @@ struct TextToFind {
When the user makes a selection from the list the container is sent a notification message. On return from the notification Scintilla will insert
+ href="#Notifications">notification message. On return from the notification Scintilla will insert
the selected text unless the autocompletion list has been cancelled, for example by the container sending
.
To make use of autocompletion you must monitor each character added to the document. See
SciTEBase::CharAdded() in SciTEBase.cxx for an example of autocompletion.
SCI_AUTOCSHOW(int lenEntered, const char
@@ -3599,10 +3599,10 @@ struct RangeToFormat {
into the print rectangle. If you set SC_WRAP_NONE, each line of text
generates one line of output and the line is truncated if it is too long to fit
into the print area.
- SC_WRAP_WORD tries to wrap only between words as indicated by
- white space or style changes although if a word is longer than a line, it will be wrapped before
- the line end. SC_WRAP_CHAR is preferred to
- SC_WRAP_WORD for Asian languages where there is no white space
+ SC_WRAP_WORD tries to wrap only between words as indicated by
+ white space or style changes although if a word is longer than a line, it will be wrapped before
+ the line end. SC_WRAP_CHAR is preferred to
+ SC_WRAP_WORD for Asian languages where there is no white space
between words.
Direct access
@@ -3730,7 +3730,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
The best way to see how this is done is to search the SciTE source code for the messages used
in this section of the documentation and see how they are used. You will also need to use
markers and a folding margin to complete your folding implementation.
- The "fold" property should be set to "1" with
+ The "fold" property should be set to "1" with
SCI_SETPROPERTY("fold", "1") to enable folding.
SCI_VISIBLEFROMDOCLINE(int
docLine)
@@ -3910,6 +3910,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
SCI_GETLAYOUTCACHE
SCI_LINESSPLIT
SCI_LINESJOIN
+ SCI_WRAPCOUNT(int docLine)
By default, Scintilla does not wrap lines of text. If you enable line wrapping, lines wider
@@ -3944,13 +3945,13 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
SCI_SETWRAPMODE(int wrapMode)
SCI_GETWRAPMODE
- Set wrapMode to SC_WRAP_WORD (1) to enable wrapping
- on word boundaries, SC_WRAP_CHAR (2) to enable wrapping
- between any characters, and to SC_WRAP_NONE (0) to disable line
- wrapping. SC_WRAP_CHAR is preferred to
- SC_WRAP_WORD for Asian languages where there is no white space
+ Set wrapMode to SC_WRAP_WORD (1) to enable wrapping
+ on word boundaries, SC_WRAP_CHAR (2) to enable wrapping
+ between any characters, and to SC_WRAP_NONE (0) to disable line
+ wrapping. SC_WRAP_CHAR is preferred to
+ SC_WRAP_WORD for Asian languages where there is no white space
between words.
-
+
SCI_SETWRAPVISUALFLAGS(int wrapVisualFlags)
SCI_GETWRAPVISUALFLAGS
@@ -4100,6 +4101,10 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
Where this would lead to no space between words, an extra space is inserted.
+ SCI_WRAPCOUNT(int docLine)
+ Document lines can occupy more than one display line if they wrap and this
+ returns the number of display lines needed to wrap a document line.
+
Zooming
Scintilla incorporates a "zoom factor" that lets you make all the text in the document
@@ -4416,7 +4421,7 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE
(lineNumber);
href="#SCI_SETREADONLY">SCI_SETREADONLY.
SCN_KEY
- Reports all keys pressed but not consumed by Scintilla. Used on GTK+ because of
+ Reports all keys pressed but not consumed by Scintilla. Used on GTK+ because of
some problems with keyboard focus and is not sent by the Windows version. SCNotification.ch holds the key code and
SCNotification.modifiers holds the modifiers. This notification is sent if the
modifiers include SCMOD_ALT or SCMOD_CTRL and the key code is less
@@ -4485,7 +4490,7 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(lineNumber);
SCN_AUTOCSELECTION
The user has selected an item in an autocompletion list. The
- notification is sent before the selection is inserted. Automatic insertion can be cancelled by sending a
+ notification is sent before the selection is inserted. Automatic insertion can be cancelled by sending a
message
before returning from the notification. The SCNotification fields used are:
Images used in GTK+ version diff --git a/include/Scintilla.h b/include/Scintilla.h index cd1dbd77f..5e5528c0a 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -352,6 +352,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_CALLTIPSETFOREHLT 2207 #define SCI_VISIBLEFROMDOCLINE 2220 #define SCI_DOCLINEFROMVISIBLE 2221 +#define SCI_WRAPCOUNT 2235 #define SC_FOLDLEVELBASE 0x400 #define SC_FOLDLEVELWHITEFLAG 0x1000 #define SC_FOLDLEVELHEADERFLAG 0x2000 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 5436fced4..b7e64ed17 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -905,6 +905,9 @@ fun int VisibleFromDocLine=2220(int line,) # Find the document line of a display line taking hidden lines into account. fun int DocLineFromVisible=2221(int lineDisplay,) +# The number of display lines needed to wrap a document line +fun int WrapCount=2235(int line,) + enu FoldLevel=SC_FOLDLEVEL val SC_FOLDLEVELBASE=0x400 val SC_FOLDLEVELWHITEFLAG=0x1000 @@ -1596,7 +1599,7 @@ fun void SetLengthForEncode=2448(int bytes,) # On error return 0. fun int EncodedFromUTF8=2449(string utf8, stringresult encoded) -# Find the position of a column on a line taking into account tabs and +# Find the position of a column on a line taking into account tabs and # multi-byte characters. If beyond end of line, return line end position. fun int FindColumn=2456(int line, int column) diff --git a/src/Editor.cxx b/src/Editor.cxx index 9211335df..5eb384bb2 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -5572,6 +5572,18 @@ int Editor::CodePage() const { return 0; } +int Editor::WrapCount(int line) { + AutoSurface surface(this); + AutoLineLayout ll(llc, RetrieveLineLayout(line)); + + if (surface && ll) { + LayoutLine(line, surface, vs, ll, wrapWidth); + return ll->lines; + } else { + return 1; + } +} + static bool ValidMargin(unsigned long wParam) { return wParam < ViewStyle::margins; } @@ -6642,6 +6654,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_DOCLINEFROMVISIBLE: return cs.DocFromDisplay(wParam); + case SCI_WRAPCOUNT: + return WrapCount(wParam); + case SCI_SETFOLDLEVEL: { int prev = pdoc->SetLevel(wParam, lParam); if (prev != lParam) diff --git a/src/Editor.h b/src/Editor.h index bace500bd..76e79e7e7 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -516,6 +516,7 @@ protected: // ScintillaBase subclass needs access to much of Editor void GetHotSpotRange(int& hsStart, int& hsEnd); int CodePage() const; + int WrapCount(int line); virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0; -- cgit v1.2.3