📄 scintilladoc.html
字号:
<a class="message" href="#SCI_GETCOLUMN">SCI_GETCOLUMN(int position)</a><br />
<a class="message" href="#SCI_FINDCOLUMN">SCI_FINDCOLUMN(int line, int column)</a><br />
<a class="message" href="#SCI_POSITIONFROMPOINT">SCI_POSITIONFROMPOINT(int x, int y)</a><br />
<a class="message" href="#SCI_POSITIONFROMPOINTCLOSE">SCI_POSITIONFROMPOINTCLOSE(int x, int
y)</a><br />
<a class="message" href="#SCI_POINTXFROMPOSITION">SCI_POINTXFROMPOSITION(<unused>, int
position)</a><br />
<a class="message" href="#SCI_POINTYFROMPOSITION">SCI_POINTYFROMPOSITION(<unused>, int
position)</a><br />
<a class="message" href="#SCI_HIDESELECTION">SCI_HIDESELECTION(bool hide)</a><br />
<a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT(<unused>, char *text)</a><br />
<a class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE(int textLen, char *text)</a><br />
<a class="message" href="#SCI_SELECTIONISRECTANGLE">SCI_SELECTIONISRECTANGLE</a><br />
<a class="message" href="#SCI_SETSELECTIONMODE">SCI_SETSELECTIONMODE(int mode)</a><br />
<a class="message" href="#SCI_GETSELECTIONMODE">SCI_GETSELECTIONMODE</a><br />
<a class="message" href="#SCI_GETLINESELSTARTPOSITION">SCI_GETLINESELSTARTPOSITION(int line)</a><br />
<a class="message" href="#SCI_GETLINESELENDPOSITION">SCI_GETLINESELENDPOSITION(int line)</a><br />
<a class="message" href="#SCI_MOVECARETINSIDEVIEW">SCI_MOVECARETINSIDEVIEW</a><br />
<a class="message" href="#SCI_WORDENDPOSITION">SCI_WORDENDPOSITION(int position, bool
onlyWordCharacters)</a><br />
<a class="message" href="#SCI_WORDSTARTPOSITION">SCI_WORDSTARTPOSITION(int position, bool
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_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 />
</code>
<p><b id="SCI_GETTEXTLENGTH">SCI_GETTEXTLENGTH</b><br />
<b id="SCI_GETLENGTH">SCI_GETLENGTH</b><br />
Both these messages return the length of the document in characters.</p>
<p><b id="SCI_GETLINECOUNT">SCI_GETLINECOUNT</b><br />
This returns the number of lines in the document. An empty document contains 1 line. A
document holding only an end of line sequence has 2 lines.</p>
<p><b id="SCI_GETFIRSTVISIBLELINE">SCI_GETFIRSTVISIBLELINE</b><br />
This returns the line number of the first visible line in the Scintilla view. The first line
in the document is numbered 0. The value is a visible line rather than a document line.</p>
<p><b id="SCI_LINESONSCREEN">SCI_LINESONSCREEN</b><br />
This returns the number of complete lines visible on the screen. With a constant line height,
this is the vertical space available divided by the line separation. Unless you arrange to size
your window to an integral number of lines, there may be a partial line visible at the bottom
of the view.</p>
<p><b id="SCI_GETMODIFY">SCI_GETMODIFY</b><br />
This returns non-zero if the document is modified and 0 if it is unmodified. The modified
status of a document is determined by the undo position relative to the save point. The save
point is set by <a class="message" href="#SCI_SETSAVEPOINT"><code>SCI_SETSAVEPOINT</code></a>,
usually when you have saved data to a file.</p>
<p>If you need to be notified when the document becomes modified, Scintilla notifies the
container that it has entered or left the save point with the <a class="message"
href="#SCN_SAVEPOINTREACHED"><code>SCN_SAVEPOINTREACHED</code></a> and <a class="message"
href="#SCN_SAVEPOINTLEFT"><code>SCN_SAVEPOINTLEFT</code></a> <a class="jump"
href="#Notifications">notification messages</a>.</p>
<p><b id="SCI_SETSEL">SCI_SETSEL(int anchorPos, int currentPos)</b><br />
This message sets both the anchor and the current position. If <code>currentPos</code> is
negative, it means the end of the document. If <code>anchorPos</code> is negative, it means
remove any selection (i.e. set the anchor to the same position as <code>currentPos</code>). The
caret is scrolled into view after this operation.</p>
<p><b id="SCI_GOTOPOS">SCI_GOTOPOS(int pos)</b><br />
This removes any selection, sets the caret at <code>pos</code> and scrolls the view to make
the caret visible, if necessary. It is equivalent to
<code>SCI_SETSEL(pos, pos)</code>. The anchor position is set the same as the current
position.</p>
<p><b id="SCI_GOTOLINE">SCI_GOTOLINE(int line)</b><br />
This removes any selection and sets the caret at the start of line number <code>line</code>
and scrolls the view (if needed) to make it visible. The anchor position is set the same as the
current position. If <code>line</code> is outside the lines in the document (first line is 0),
the line set is the first or last.</p>
<p><b id="SCI_SETCURRENTPOS">SCI_SETCURRENTPOS(int pos)</b><br />
This sets the current position and creates a selection between the anchor and the current
position. The caret is not scrolled into view.</p>
<p>See also: <a class="message" href="#SCI_SCROLLCARET"><code>SCI_SCROLLCARET</code></a></p>
<p><b id="SCI_GETCURRENTPOS">SCI_GETCURRENTPOS</b><br />
This returns the current position.</p>
<p><b id="SCI_SETANCHOR">SCI_SETANCHOR(int pos)</b><br />
This sets the anchor position and creates a selection between the anchor position and the
current position. The caret is not scrolled into view.</p>
<p>See also: <a class="message" href="#SCI_SCROLLCARET"><code>SCI_SCROLLCARET</code></a></p>
<p><b id="SCI_GETANCHOR">SCI_GETANCHOR</b><br />
This returns the current anchor position.</p>
<p><b id="SCI_SETSELECTIONSTART">SCI_SETSELECTIONSTART(int pos)</b><br />
<b id="SCI_SETSELECTIONEND">SCI_SETSELECTIONEND(int pos)</b><br />
These set the selection based on the assumption that the anchor position is less than the
current position. They do not make the caret visible. The table shows the positions of the
anchor and the current position after using these messages.</p>
<table cellpadding="3" cellspacing="0" border="1" summary="SetSelection caret positioning">
<thead align="center">
<tr>
<th>
</th>
<th>anchor</th>
<th>current</th>
</tr>
</thead>
<tbody align="center">
<tr>
<th><code>SCI_SETSELECTIONSTART</code></th>
<td><code>pos</code></td>
<td><code>Max(pos, current)</code></td>
</tr>
<tr>
<th><code>SCI_SETSELECTIONEND</code></th>
<td><code>Min(anchor, pos)</code></td>
<td><code>pos</code></td>
</tr>
</tbody>
</table>
<p>See also: <a class="message" href="#SCI_SCROLLCARET"><code>SCI_SCROLLCARET</code></a></p>
<p><b id="SCI_GETSELECTIONSTART">SCI_GETSELECTIONSTART</b><br />
<b id="SCI_GETSELECTIONEND">SCI_GETSELECTIONEND</b><br />
These return the start and end of the selection without regard to which end is the current
position and which is the anchor. <code>SCI_GETSELECTIONSTART</code> returns the smaller of the
current position or the anchor position. <code>SCI_GETSELECTIONEND</code> returns the larger of
the two values.</p>
<p><b id="SCI_SELECTALL">SCI_SELECTALL</b><br />
This selects all the text in the document. The current position is not scrolled into view.</p>
<p><b id="SCI_LINEFROMPOSITION">SCI_LINEFROMPOSITION(int pos)</b><br />
This message returns the line that contains the position <code>pos</code> in the document. The
return value is 0 if <code>pos</code> <= 0. The return value is the last line if
<code>pos</code> is beyond the end of the document.</p>
<p><b id="SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(int line)</b><br />
This returns the document position that corresponds with the start of the line. If
<code>line</code> is negative, the position of the line holding the start of the selection is
returned. If <code>line</code> is greater than the lines in the document, the return value is
-1. If <code>line</code> is equal to the number of lines in the document (i.e. 1 line past the
last line), the return value is the end of the document.</p>
<p><b id="SCI_GETLINEENDPOSITION">SCI_GETLINEENDPOSITION(int line)</b><br />
This returns the position at the end of the line, before any line end characters. If <code>line</code>
is the last line in the document (which does not have any end of line characters), the result is the size of the
document. If <code>line</code> is negative or <code>line</code> >= <a class="message"
href="#SCI_GETLINECOUNT"><code>SCI_GETLINECOUNT()</code></a>, the result is undefined.</p>
<p><b id="SCI_LINELENGTH">SCI_LINELENGTH(int line)</b><br />
This returns the length of the line, including any line end characters. If <code>line</code>
is negative or beyond the last line in the document, the result is 0. If you want the length of
the line not including any end of line characters, use <a class="message"
href="#SCI_GETLINEENDPOSITION"><code>SCI_GETLINEENDPOSITION(line)</code></a> - <a class="message"
href="#SCI_POSITIONFROMLINE"><code>SCI_POSITIONFROMLINE(line)</code></a>.</p>
<b id="SCI_GETSELTEXT">SCI_GETSELTEXT(<unused>, char *text)</b><br />
This copies the currently selected text and a terminating 0 byte to the <code>text</code>
buffer. The buffer must be at least
<code>SCI_GETSELECTIONEND()-SCI_GETSELECTIONSTART()+1</code> bytes long. <br />
If the text argument is 0 then the length that should be allocated
to store the entire selection is returned.<br />
<p>See also: <code><a class="message" href="#SCI_GETCURLINE">SCI_GETCURLINE</a>, <a
class="message" href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"
href="#SCI_GETTEXT">SCI_GETTEXT</a>, <a class="message"
href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"
href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a></code></p>
<p><b id="SCI_GETCURLINE">SCI_GETCURLINE(int textLen, char *text)</b><br />
This retrieves the text of the line containing the caret and returns the position within the
line of the caret. Pass in <code>char* text</code> pointing at a buffer large enough to hold
the text you wish to retrieve and a terminating 0 character.
Set <code>textLen</code> to the
length of the buffer which must be at least 1 to hold the terminating 0 character.
If the text argument is 0 then the length that should be allocated
to store the entire current line is returned.</p>
<p>See also: <code><a class="message" href="#SCI_GETSELTEXT">SCI_GETSELTEXT</a>, <a
class="message" href="#SCI_GETLINE">SCI_GETLINE</a>, <a class="message"
href="#SCI_GETTEXT">SCI_GETTEXT</a>, <a class="message"
href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT</a>, <a class="message"
href="#SCI_GETTEXTRANGE">SCI_GETTEXTRANGE</a></code></p>
<p><b id="SCI_SELECTIONISRECTANGLE">SCI_SELECTIONISRECTANGLE</b><br />
This returns 1 if the current selection is in rectangle mode, 0 if not.</p>
<p><b id="SCI_SETSELECTIONMODE">SCI_SETSELECTIONMODE(int mode)</b><br />
<b id="SCI_GETSELECTIONMODE">SCI_GETSELECTIONMODE</b><br />
The two functions set and get the selection mode, which can be
stream (<code>SC_SEL_STREAM</code>=0) or
rectangular (<code>SC_SEL_RECTANGLE</code>=1)
or by lines (<code>SC_SEL_LINES</code>=2).
When set in these modes, regular caret moves will extend or reduce the selection,
until the mode is cancelled by a call with same value or with <code>SCI_CANCEL</code>.
The get function returns the current mode even if the selection was made by mouse
or with regular extended moves.</p>
<p><b id="SCI_GETLINESELSTARTPOSITION">SCI_GETLINESELSTARTPOSITION(int line)</b><br />
<b id="SCI_GETLINESELENDPOSITION">SCI_GETLINESELENDPOSITION(int line)</b><br />
Retrieve the position of the start and end of the selection at the given line with
INVALID_POSITION returned if no selection on this line.</p>
<p><b id="SCI_MOVECARETINSIDEVIEW">SCI_MOVECARETINSIDEVIEW</b><br />
If the caret is off the top or bottom of the view, it is moved to the nearest line that is
visible to its current position. Any selection is lost.</p>
<p><b id="SCI_WORDENDPOSITION">SCI_WORDENDPOSITION(int position, bool
onlyWordCharacters)</b><br />
<b id="SCI_WORDSTARTPOSITION">SCI_WORDSTARTPOSITION(int position, bool
onlyWordCharacters)</b><br />
These messages return the start and end of words using the same definition of words as used
internally within Scintilla. You can set your own list of characters that count as words with
<a class="message" href="#SCI_SETWORDCHARS"><code>SCI_SETWORDCHARS</code></a>. The position
sets the start or the search, which is forwards when searching for the end and backwards when
searching for the start.</p>
<p>Set <code>onlyWordCharacters</code> to <code>true</code> (1) to stop searching at the first
non-word character in the search direction. If <code>onlyWordCharacters</code> is
<code>false</code> (0), the first character in the search direction sets the type of the search
as word or non-word and the search stops at the first non-matching character. Searches are also
terminated by the start or end of the document.</p>
<p>If "w" represe
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -