The Editor class, with the instance name of Npp.editor (or normally simply editor) represents the Scintilla component of Notepad++. Scintilla is the “edit” component, the place where text is entered and altered. Scintilla is well documented, and Python Script allows you to call any of the Scintilla functions in a Pythonised way.
Npp.editor (or editor) always refers to the active document. To switch to another document (or open a new one, etc), use the notepad object.
The arguments to the functions are therefore slightly different to the original Scintilla arguments, effectively simplified by Python.
SCI_ADDTEXT has the arguments:
SCI_ADDTEXT(int length, const char *text)
In Python, that just becomes:
editor.addText(text)
Likewise, return parameters are converted to return values. So SCI_GETTEXT has the arguments:
SCI_GETTEXT(int length, char *text)
In Python, that becomes:
text = editor.getText()
The comments for each function have been taken directly from Scintilla, so occassionally you may see reference to a parameter that doesn’t exist. I’m sure you’ll cope :)
Colours are a tuple of (red, green, blue) where each of red, green, and blue is between 0 and 255.
There are some Helper Methods discussed at the end, that perform some common functions with Scintilla. For instance, searching and replacing, regular expressions, replacing and deleting lines and so on.
Gets a copy of the text of the document, without first allowing Scintilla to make it’s copy of it. In practice, that means it does exactly the same as Editor.getText, however, if you have the possibility of the user interfering with the document _whilst_ getCharacterPointer() is running, then it’s safer to use getText(). On larger documents, getCharacterPointer() could be noticable quicker.
See Scintilla documentation for SCI_GETCHARACTERPOINTER
Add text to the document at current position.
See Scintilla documentation for SCI_ADDTEXT
Add array of cells to document.
See Scintilla documentation for SCI_ADDSTYLEDTEXT
Insert string at a position.
See Scintilla documentation for SCI_INSERTTEXT
Delete all text in the document.
See Scintilla documentation for SCI_CLEARALL
Set all style bytes to 0, remove all folding information.
See Scintilla documentation for SCI_CLEARDOCUMENTSTYLE
Returns the number of bytes in the document.
See Scintilla documentation for SCI_GETLENGTH
Returns the character byte at the position.
See Scintilla documentation for SCI_GETCHARAT
Returns the position of the caret.
See Scintilla documentation for SCI_GETCURRENTPOS
Returns the position of the opposite end of the selection to the caret.
See Scintilla documentation for SCI_GETANCHOR
Returns the style byte at the position.
See Scintilla documentation for SCI_GETSTYLEAT
Choose between collecting actions into the undo history and discarding them.
See Scintilla documentation for SCI_SETUNDOCOLLECTION
Select all the text in the document.
See Scintilla documentation for SCI_SELECTALL
Remember the current position in the undo history as the position at which the document was saved.
See Scintilla documentation for SCI_SETSAVEPOINT
Retrieve a buffer of cells. Returns the number of bytes in the buffer not including terminating NULs.
See Scintilla documentation for SCI_GETSTYLEDTEXT
Are there any redoable actions in the undo history?
See Scintilla documentation for SCI_CANREDO
Retrieve the line number at which a particular marker is located.
See Scintilla documentation for SCI_MARKERLINEFROMHANDLE
Delete a marker.
See Scintilla documentation for SCI_MARKERDELETEHANDLE
Is undo history being collected?
See Scintilla documentation for SCI_GETUNDOCOLLECTION
Are white space characters currently visible? Returns one of SCWS_* constants.
See Scintilla documentation for SCI_GETVIEWWS
Make white space characters invisible, always visible or visible outside indentation.
See Scintilla documentation for SCI_SETVIEWWS
Find the position from a point within the window.
See Scintilla documentation for SCI_POSITIONFROMPOINT
Find the position from a point within the window but return INVALID_POSITION if not close to text.
See Scintilla documentation for SCI_POSITIONFROMPOINTCLOSE
Set caret to start of a line and ensure it is visible.
See Scintilla documentation for SCI_GOTOLINE
Set caret to a position and ensure it is visible.
See Scintilla documentation for SCI_GOTOPOS
Set the selection anchor to a position. The anchor is the opposite end of the selection from the caret.
See Scintilla documentation for SCI_SETANCHOR
Retrieve the text of the line containing the caret. Returns the index of the caret on the line.
See Scintilla documentation for SCI_GETCURLINE
Retrieve the position of the last correctly styled character.
See Scintilla documentation for SCI_GETENDSTYLED
Convert all line endings in the document to one mode.
See Scintilla documentation for SCI_CONVERTEOLS
Retrieve the current end of line mode - one of CRLF, CR, or LF.
See Scintilla documentation for SCI_GETEOLMODE
Set the current end of line mode.
See Scintilla documentation for SCI_SETEOLMODE
Set the current styling position to pos and the styling mask to mask. The styling mask can be used to protect some bits in each styling byte from modification.
See Scintilla documentation for SCI_STARTSTYLING
Change style from current styling position for length characters to a style and move the current styling position to after this newly styled segment.
See Scintilla documentation for SCI_SETSTYLING
Is drawing done first into a buffer or direct to the screen?
See Scintilla documentation for SCI_GETBUFFEREDDRAW
If drawing is buffered then each line of text is drawn into a bitmap buffer before drawing it to the screen to avoid flicker.
See Scintilla documentation for SCI_SETBUFFEREDDRAW
Change the visible size of a tab to be a multiple of the width of a space character.
See Scintilla documentation for SCI_SETTABWIDTH
Retrieve the visible size of a tab.
See Scintilla documentation for SCI_GETTABWIDTH
Set the code page used to interpret the bytes of the document as characters. The SC_CP_UTF8 value can be used to enter Unicode mode.
See Scintilla documentation for SCI_SETCODEPAGE
In palette mode, Scintilla uses the environment’s palette calls to display more colours. This may lead to ugly displays.
See Scintilla documentation for SCI_SETUSEPALETTE
Set the symbol used for a particular marker number.
See Scintilla documentation for SCI_MARKERDEFINE
Set the foreground colour used for a particular marker number.
See Scintilla documentation for SCI_MARKERSETFORE
Set the background colour used for a particular marker number.
See Scintilla documentation for SCI_MARKERSETBACK
Add a marker to a line, returning an ID which can be used to find or delete the marker.
See Scintilla documentation for SCI_MARKERADD
Delete a marker from a line.
See Scintilla documentation for SCI_MARKERDELETE
Delete all markers with a particular number from all lines.
See Scintilla documentation for SCI_MARKERDELETEALL
Get a bit mask of all the markers set on a line.
See Scintilla documentation for SCI_MARKERGET
Find the next line at or after lineStart that includes a marker in mask. Return -1 when no more lines.
See Scintilla documentation for SCI_MARKERNEXT
Find the previous line before lineStart that includes a marker in mask.
See Scintilla documentation for SCI_MARKERPREVIOUS
Define a marker from a pixmap.
See Scintilla documentation for SCI_MARKERDEFINEPIXMAP
Add a set of markers to a line.
See Scintilla documentation for SCI_MARKERADDSET
Set the alpha used for a marker that is drawn in the text area, not the margin.
See Scintilla documentation for SCI_MARKERSETALPHA
Set a margin to be either numeric or symbolic.
See Scintilla documentation for SCI_SETMARGINTYPEN
Retrieve the type of a margin.
See Scintilla documentation for SCI_GETMARGINTYPEN
Set the width of a margin to a width expressed in pixels.
See Scintilla documentation for SCI_SETMARGINWIDTHN
Retrieve the width of a margin in pixels.
See Scintilla documentation for SCI_GETMARGINWIDTHN
Set a mask that determines which markers are displayed in a margin.
See Scintilla documentation for SCI_SETMARGINMASKN
Retrieve the marker mask of a margin.
See Scintilla documentation for SCI_GETMARGINMASKN
Make a margin sensitive or insensitive to mouse clicks.
See Scintilla documentation for SCI_SETMARGINSENSITIVEN
Retrieve the mouse click sensitivity of a margin.
See Scintilla documentation for SCI_GETMARGINSENSITIVEN
Set the cursor shown when the mouse is inside a margin.
See Scintilla documentation for SCI_SETMARGINCURSORN
Retrieve the cursor shown in a margin.
See Scintilla documentation for SCI_GETMARGINCURSORN
Clear all the styles and make equivalent to the global default style.
See Scintilla documentation for SCI_STYLECLEARALL
Set the foreground colour of a style.
See Scintilla documentation for SCI_STYLESETFORE
Set the background colour of a style.
See Scintilla documentation for SCI_STYLESETBACK
Set a style to be bold or not.
See Scintilla documentation for SCI_STYLESETBOLD
Set a style to be italic or not.
See Scintilla documentation for SCI_STYLESETITALIC
Set the size of characters of a style.
See Scintilla documentation for SCI_STYLESETSIZE
Set the font of a style.
See Scintilla documentation for SCI_STYLESETFONT
Set a style to have its end of line filled or not.
See Scintilla documentation for SCI_STYLESETEOLFILLED
Reset the default style to its state at startup
See Scintilla documentation for SCI_STYLERESETDEFAULT
Set a style to be underlined or not.
See Scintilla documentation for SCI_STYLESETUNDERLINE
Get the foreground colour of a style.
See Scintilla documentation for SCI_STYLEGETFORE
Get the background colour of a style.
See Scintilla documentation for SCI_STYLEGETBACK
Get is a style bold or not.
See Scintilla documentation for SCI_STYLEGETBOLD
Get is a style italic or not.
See Scintilla documentation for SCI_STYLEGETITALIC
Get the size of characters of a style.
See Scintilla documentation for SCI_STYLEGETSIZE
Get the font of a style. Returns the length of the fontName
See Scintilla documentation for SCI_STYLEGETFONT
Get is a style to have its end of line filled or not.
See Scintilla documentation for SCI_STYLEGETEOLFILLED
Get is a style underlined or not.
See Scintilla documentation for SCI_STYLEGETUNDERLINE
Get is a style mixed case, or to force upper or lower case.
See Scintilla documentation for SCI_STYLEGETCASE
Get the character get of the font in a style.
See Scintilla documentation for SCI_STYLEGETCHARACTERSET
Get is a style visible or not.
See Scintilla documentation for SCI_STYLEGETVISIBLE
Get is a style changeable or not (read only). Experimental feature, currently buggy.
See Scintilla documentation for SCI_STYLEGETCHANGEABLE
Get is a style a hotspot or not.
See Scintilla documentation for SCI_STYLEGETHOTSPOT
Set a style to be mixed case, or to force upper or lower case.
See Scintilla documentation for SCI_STYLESETCASE
Set the character set of the font in a style.
See Scintilla documentation for SCI_STYLESETCHARACTERSET
Set a style to be a hotspot or not.
See Scintilla documentation for SCI_STYLESETHOTSPOT
Set the foreground colour of the main and additional selections and whether to use this setting.
See Scintilla documentation for SCI_SETSELFORE
Set the background colour of the main and additional selections and whether to use this setting.
See Scintilla documentation for SCI_SETSELBACK
Get the alpha of the selection.
See Scintilla documentation for SCI_GETSELALPHA
Set the alpha of the selection.
See Scintilla documentation for SCI_SETSELALPHA
Is the selection end of line filled?
See Scintilla documentation for SCI_GETSELEOLFILLED
Set the selection to have its end of line filled or not.
See Scintilla documentation for SCI_SETSELEOLFILLED
Set the foreground colour of the caret.
See Scintilla documentation for SCI_SETCARETFORE
When key+modifier combination km is pressed perform msg.
See Scintilla documentation for SCI_ASSIGNCMDKEY
When key+modifier combination km is pressed do nothing.
See Scintilla documentation for SCI_CLEARCMDKEY
Drop all key mappings.
See Scintilla documentation for SCI_CLEARALLCMDKEYS
Set the styles for a segment of the document.
See Scintilla documentation for SCI_SETSTYLINGEX
Set a style to be visible or not.
See Scintilla documentation for SCI_STYLESETVISIBLE
Get the time in milliseconds that the caret is on and off.
See Scintilla documentation for SCI_GETCARETPERIOD
Get the time in milliseconds that the caret is on and off. 0 = steady on.
See Scintilla documentation for SCI_SETCARETPERIOD
Set the set of characters making up words for when moving or selecting by word. First sets defaults like SetCharsDefault.
See Scintilla documentation for SCI_SETWORDCHARS
Start a sequence of actions that is undone and redone as a unit. May be nested.
See Scintilla documentation for SCI_BEGINUNDOACTION
End a sequence of actions that is undone and redone as a unit.
See Scintilla documentation for SCI_ENDUNDOACTION
Set an indicator to plain, squiggle or TT.
See Scintilla documentation for SCI_INDICSETSTYLE
Retrieve the style of an indicator.
See Scintilla documentation for SCI_INDICGETSTYLE
Set the foreground colour of an indicator.
See Scintilla documentation for SCI_INDICSETFORE
Retrieve the foreground colour of an indicator.
See Scintilla documentation for SCI_INDICGETFORE
Set an indicator to draw under text or over(default).
See Scintilla documentation for SCI_INDICSETUNDER
Retrieve whether indicator drawn under or over text.
See Scintilla documentation for SCI_INDICGETUNDER
Set the foreground colour of all whitespace and whether to use this setting.
See Scintilla documentation for SCI_SETWHITESPACEFORE
Set the background colour of all whitespace and whether to use this setting.
See Scintilla documentation for SCI_SETWHITESPACEBACK
Set the size of the dots used to mark space characters.
See Scintilla documentation for SCI_SETWHITESPACESIZE
Get the size of the dots used to mark space characters.
See Scintilla documentation for SCI_GETWHITESPACESIZE
Divide each styling byte into lexical class bits (default: 5) and indicator bits (default: 3). If a lexer requires more than 32 lexical states, then this is used to expand the possible states.
See Scintilla documentation for SCI_SETSTYLEBITS
Retrieve number of bits in style bytes used to hold the lexical state.
See Scintilla documentation for SCI_GETSTYLEBITS
Used to hold extra styling information for each line.
See Scintilla documentation for SCI_SETLINESTATE
Retrieve the extra styling information for a line.
See Scintilla documentation for SCI_GETLINESTATE
Retrieve the last line number that has line state.
See Scintilla documentation for SCI_GETMAXLINESTATE
Is the background of the line containing the caret in a different colour?
See Scintilla documentation for SCI_GETCARETLINEVISIBLE
Display the background of the line containing the caret in a different colour.
See Scintilla documentation for SCI_SETCARETLINEVISIBLE
Get the colour of the background of the line containing the caret.
See Scintilla documentation for SCI_GETCARETLINEBACK
Set the colour of the background of the line containing the caret.
See Scintilla documentation for SCI_SETCARETLINEBACK
Set a style to be changeable or not (read only). Experimental feature, currently buggy.
See Scintilla documentation for SCI_STYLESETCHANGEABLE
Display a auto-completion list. The lenEntered parameter indicates how many characters before the caret should be used to provide context.
See Scintilla documentation for SCI_AUTOCSHOW
Remove the auto-completion list from the screen.
See Scintilla documentation for SCI_AUTOCCANCEL
Is there an auto-completion list visible?
See Scintilla documentation for SCI_AUTOCACTIVE
Retrieve the position of the caret when the auto-completion list was displayed.
See Scintilla documentation for SCI_AUTOCPOSSTART
User has selected an item so remove the list and insert the selection.
See Scintilla documentation for SCI_AUTOCCOMPLETE
Define a set of character that when typed cancel the auto-completion list.
See Scintilla documentation for SCI_AUTOCSTOPS
Change the separator character in the string setting up an auto-completion list. Default is space but can be changed if items contain space.
See Scintilla documentation for SCI_AUTOCSETSEPARATOR
Retrieve the auto-completion list separator character.
See Scintilla documentation for SCI_AUTOCGETSEPARATOR
Select the item in the auto-completion list that starts with a string.
See Scintilla documentation for SCI_AUTOCSELECT
Should the auto-completion list be cancelled if the user backspaces to a position before where the box was created.
See Scintilla documentation for SCI_AUTOCSETCANCELATSTART
Retrieve whether auto-completion cancelled by backspacing before start.
See Scintilla documentation for SCI_AUTOCGETCANCELATSTART
Define a set of characters that when typed will cause the autocompletion to choose the selected item.
See Scintilla documentation for SCI_AUTOCSETFILLUPS
Should a single item auto-completion list automatically choose the item.
See Scintilla documentation for SCI_AUTOCSETCHOOSESINGLE
Retrieve whether a single item auto-completion list automatically choose the item.
See Scintilla documentation for SCI_AUTOCGETCHOOSESINGLE
Set whether case is significant when performing auto-completion searches.
See Scintilla documentation for SCI_AUTOCSETIGNORECASE
Retrieve state of ignore case flag.
See Scintilla documentation for SCI_AUTOCGETIGNORECASE
Display a list of strings and send notification when user chooses one.
See Scintilla documentation for SCI_USERLISTSHOW
Set whether or not autocompletion is hidden automatically when nothing matches.
See Scintilla documentation for SCI_AUTOCSETAUTOHIDE
Retrieve whether or not autocompletion is hidden automatically when nothing matches.
See Scintilla documentation for SCI_AUTOCGETAUTOHIDE
Set whether or not autocompletion deletes any word characters after the inserted text upon completion.
See Scintilla documentation for SCI_AUTOCSETDROPRESTOFWORD
Retrieve whether or not autocompletion deletes any word characters after the inserted text upon completion.
See Scintilla documentation for SCI_AUTOCGETDROPRESTOFWORD
Register an XPM image for use in autocompletion lists.
See Scintilla documentation for SCI_REGISTERIMAGE
Clear all the registered XPM images.
See Scintilla documentation for SCI_CLEARREGISTEREDIMAGES
Retrieve the auto-completion list type-separator character.
See Scintilla documentation for SCI_AUTOCGETTYPESEPARATOR
Change the type-separator character in the string setting up an auto-completion list. Default is ‘?’ but can be changed if items contain ‘?’.
See Scintilla documentation for SCI_AUTOCSETTYPESEPARATOR
Set the maximum width, in characters, of auto-completion and user lists. Set to 0 to autosize to fit longest item, which is the default.
See Scintilla documentation for SCI_AUTOCSETMAXWIDTH
Get the maximum width, in characters, of auto-completion and user lists.
See Scintilla documentation for SCI_AUTOCGETMAXWIDTH
Set the maximum height, in rows, of auto-completion and user lists. The default is 5 rows.
See Scintilla documentation for SCI_AUTOCSETMAXHEIGHT
Set the maximum height, in rows, of auto-completion and user lists.
See Scintilla documentation for SCI_AUTOCGETMAXHEIGHT
Set the number of spaces used for one level of indentation.
See Scintilla documentation for SCI_SETINDENT
Retrieve indentation size.
See Scintilla documentation for SCI_GETINDENT
Indentation will only use space characters if useTabs is false, otherwise it will use a combination of tabs and spaces.
See Scintilla documentation for SCI_SETUSETABS
Retrieve whether tabs will be used in indentation.
See Scintilla documentation for SCI_GETUSETABS
Change the indentation of a line to a number of columns.
See Scintilla documentation for SCI_SETLINEINDENTATION
Retrieve the number of columns that a line is indented.
See Scintilla documentation for SCI_GETLINEINDENTATION
Retrieve the position before the first non indentation character on a line.
See Scintilla documentation for SCI_GETLINEINDENTPOSITION
Retrieve the column number of a position, taking tab width into account.
See Scintilla documentation for SCI_GETCOLUMN
Show or hide the horizontal scroll bar.
See Scintilla documentation for SCI_SETHSCROLLBAR
Is the horizontal scroll bar visible?
See Scintilla documentation for SCI_GETHSCROLLBAR
Show or hide indentation guides.
See Scintilla documentation for SCI_SETINDENTATIONGUIDES
Are the indentation guides visible?
See Scintilla documentation for SCI_GETINDENTATIONGUIDES
Set the highlighted indentation guide column. 0 = no highlighted guide.
See Scintilla documentation for SCI_SETHIGHLIGHTGUIDE
Get the highlighted indentation guide column.
See Scintilla documentation for SCI_GETHIGHLIGHTGUIDE
Get the position after the last visible characters on a line.
See Scintilla documentation for SCI_GETLINEENDPOSITION
Get the code page used to interpret the bytes of the document as characters.
See Scintilla documentation for SCI_GETCODEPAGE
Get the foreground colour of the caret.
See Scintilla documentation for SCI_GETCARETFORE
In palette mode?
See Scintilla documentation for SCI_GETUSEPALETTE
In read-only mode?
See Scintilla documentation for SCI_GETREADONLY
Sets the position of the caret.
See Scintilla documentation for SCI_SETCURRENTPOS
Sets the position that starts the selection - this becomes the anchor.
See Scintilla documentation for SCI_SETSELECTIONSTART
Returns the position at the start of the selection.
See Scintilla documentation for SCI_GETSELECTIONSTART
Sets the position that ends the selection - this becomes the currentPosition.
See Scintilla documentation for SCI_SETSELECTIONEND
Returns the position at the end of the selection.
See Scintilla documentation for SCI_GETSELECTIONEND
Sets the print magnification added to the point size of each style for printing.
See Scintilla documentation for SCI_SETPRINTMAGNIFICATION
Returns the print magnification.
See Scintilla documentation for SCI_GETPRINTMAGNIFICATION
Modify colours when printing for clearer printed text.
See Scintilla documentation for SCI_SETPRINTCOLOURMODE
Returns the print colour mode.
See Scintilla documentation for SCI_GETPRINTCOLOURMODE
Find some text in the document.
See Scintilla documentation for SCI_FINDTEXT
Retrieve the display line at the top of the display.
See Scintilla documentation for SCI_GETFIRSTVISIBLELINE
Retrieve the contents of a line. Returns the length of the line.
See Scintilla documentation for SCI_GETLINE
Returns the number of lines in the document. There is always at least one.
See Scintilla documentation for SCI_GETLINECOUNT
Sets the size in pixels of the left margin.
See Scintilla documentation for SCI_SETMARGINLEFT
Returns the size in pixels of the left margin.
See Scintilla documentation for SCI_GETMARGINLEFT
Sets the size in pixels of the right margin.
See Scintilla documentation for SCI_SETMARGINRIGHT
Returns the size in pixels of the right margin.
See Scintilla documentation for SCI_GETMARGINRIGHT
Is the document different from when it was last saved?
See Scintilla documentation for SCI_GETMODIFY
Select a range of text.
See Scintilla documentation for SCI_SETSEL
Retrieve the selected text. Return the length of the text.
See Scintilla documentation for SCI_GETSELTEXT
Retrieve a range of text. Return the length of the text.
See Scintilla documentation for SCI_GETTEXTRANGE
Draw the selection in normal style or with selection highlighted.
See Scintilla documentation for SCI_HIDESELECTION
Retrieve the x value of the point in the window where a position is displayed.
See Scintilla documentation for SCI_POINTXFROMPOSITION
Retrieve the y value of the point in the window where a position is displayed.
See Scintilla documentation for SCI_POINTYFROMPOSITION
Retrieve the line containing a position.
See Scintilla documentation for SCI_LINEFROMPOSITION
Retrieve the position at the start of a line.
See Scintilla documentation for SCI_POSITIONFROMLINE
Scroll horizontally and vertically.
See Scintilla documentation for SCI_LINESCROLL
Ensure the caret is visible.
See Scintilla documentation for SCI_SCROLLCARET
Replace the selected text with the argument text.
See Scintilla documentation for SCI_REPLACESEL
Set to read only or read write.
See Scintilla documentation for SCI_SETREADONLY
Will a paste succeed?
See Scintilla documentation for SCI_CANPASTE
Are there any undoable actions in the undo history?
See Scintilla documentation for SCI_CANUNDO
Delete the undo history.
See Scintilla documentation for SCI_EMPTYUNDOBUFFER
Paste the contents of the clipboard into the document replacing the selection.
See Scintilla documentation for SCI_PASTE
Replace the contents of the document with the argument text.
See Scintilla documentation for SCI_SETTEXT
Retrieve all the text in the document. Returns number of characters retrieved.
See Scintilla documentation for SCI_GETTEXT
Retrieve the number of characters in the document.
See Scintilla documentation for SCI_GETTEXTLENGTH
Retrieve a pointer to a function that processes messages for this Scintilla.
See Scintilla documentation for SCI_GETDIRECTFUNCTION
Retrieve a pointer value to use as the first argument when calling the function returned by GetDirectFunction.
See Scintilla documentation for SCI_GETDIRECTPOINTER
Set to overtype (true) or insert mode.
See Scintilla documentation for SCI_SETOVERTYPE
Returns true if overtype mode is active otherwise false is returned.
See Scintilla documentation for SCI_GETOVERTYPE
Set the width of the insert mode caret.
See Scintilla documentation for SCI_SETCARETWIDTH
Returns the width of the insert mode caret.
See Scintilla documentation for SCI_GETCARETWIDTH
Sets the position that starts the target which is used for updating the document without affecting the scroll position.
See Scintilla documentation for SCI_SETTARGETSTART
Get the position that starts the target.
See Scintilla documentation for SCI_GETTARGETSTART
Sets the position that ends the target which is used for updating the document without affecting the scroll position.
See Scintilla documentation for SCI_SETTARGETEND
Get the position that ends the target.
See Scintilla documentation for SCI_GETTARGETEND
Replace the target text with the argument text. Text is counted so it can contain NULs. Returns the length of the replacement text.
See Scintilla documentation for SCI_REPLACETARGET
Replace the target text with the argument text after d processing. Text is counted so it can contain NULs. Looks for d where d is between 1 and 9 and replaces these with the strings matched in the last search operation which were surrounded by ( and ). Returns the length of the replacement text including any change caused by processing the d patterns.
See Scintilla documentation for SCI_REPLACETARGETRE
Search for a counted string in the target and set the target to the found range. Text is counted so it can contain NULs. Returns length of range or -1 for failure in which case target is not moved.
See Scintilla documentation for SCI_SEARCHINTARGET
Set the search flags used by SearchInTarget.
See Scintilla documentation for SCI_SETSEARCHFLAGS
Get the search flags used by SearchInTarget.
See Scintilla documentation for SCI_GETSEARCHFLAGS
Show a call tip containing a definition near position pos.
See Scintilla documentation for SCI_CALLTIPSHOW
Remove the call tip from the screen.
See Scintilla documentation for SCI_CALLTIPCANCEL
Is there an active call tip?
See Scintilla documentation for SCI_CALLTIPACTIVE
Retrieve the position where the caret was before displaying the call tip.
See Scintilla documentation for SCI_CALLTIPPOSSTART
Highlight a segment of the definition.
See Scintilla documentation for SCI_CALLTIPSETHLT
Set the background colour for the call tip.
See Scintilla documentation for SCI_CALLTIPSETBACK
Set the foreground colour for the call tip.
See Scintilla documentation for SCI_CALLTIPSETFORE
Set the foreground colour for the highlighted part of the call tip.
See Scintilla documentation for SCI_CALLTIPSETFOREHLT
Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
See Scintilla documentation for SCI_CALLTIPUSESTYLE
Find the display line of a document line taking hidden lines into account.
See Scintilla documentation for SCI_VISIBLEFROMDOCLINE
Find the document line of a display line taking hidden lines into account.
See Scintilla documentation for SCI_DOCLINEFROMVISIBLE
The number of display lines needed to wrap a document line
See Scintilla documentation for SCI_WRAPCOUNT
Set the fold level of a line. This encodes an integer level along with flags indicating whether the line is a header and whether it is effectively white space.
See Scintilla documentation for SCI_SETFOLDLEVEL
Retrieve the fold level of a line.
See Scintilla documentation for SCI_GETFOLDLEVEL
Find the last child line of a header line.
See Scintilla documentation for SCI_GETLASTCHILD
Find the parent line of a child line.
See Scintilla documentation for SCI_GETFOLDPARENT
Make a range of lines visible.
See Scintilla documentation for SCI_SHOWLINES
Make a range of lines invisible.
See Scintilla documentation for SCI_HIDELINES
Is a line visible?
See Scintilla documentation for SCI_GETLINEVISIBLE
Show the children of a header line.
See Scintilla documentation for SCI_SETFOLDEXPANDED
Is a header line expanded?
See Scintilla documentation for SCI_GETFOLDEXPANDED
Switch a header line between expanded and contracted.
See Scintilla documentation for SCI_TOGGLEFOLD
Ensure a particular line is visible by expanding any header line hiding it.
See Scintilla documentation for SCI_ENSUREVISIBLE
Set some style options for folding.
See Scintilla documentation for SCI_SETFOLDFLAGS
Ensure a particular line is visible by expanding any header line hiding it. Use the currently set visibility policy to determine which range to display.
See Scintilla documentation for SCI_ENSUREVISIBLEENFORCEPOLICY
Sets whether a tab pressed when caret is within indentation indents.
See Scintilla documentation for SCI_SETTABINDENTS
Does a tab pressed when caret is within indentation indent?
See Scintilla documentation for SCI_GETTABINDENTS
Sets whether a backspace pressed when caret is within indentation unindents.
See Scintilla documentation for SCI_SETBACKSPACEUNINDENTS
Does a backspace pressed when caret is within indentation unindent?
See Scintilla documentation for SCI_GETBACKSPACEUNINDENTS
Sets the time the mouse must sit still to generate a mouse dwell event.
See Scintilla documentation for SCI_SETMOUSEDWELLTIME
Retrieve the time the mouse must sit still to generate a mouse dwell event.
See Scintilla documentation for SCI_GETMOUSEDWELLTIME
Get position of start of word.
See Scintilla documentation for SCI_WORDSTARTPOSITION
Get position of end of word.
See Scintilla documentation for SCI_WORDENDPOSITION
Sets whether text is word wrapped.
See Scintilla documentation for SCI_SETWRAPMODE
Retrieve whether text is word wrapped.
See Scintilla documentation for SCI_GETWRAPMODE
Set the display mode of visual flags for wrapped lines.
See Scintilla documentation for SCI_SETWRAPVISUALFLAGS
Retrive the display mode of visual flags for wrapped lines.
See Scintilla documentation for SCI_GETWRAPVISUALFLAGS
Set the location of visual flags for wrapped lines.
See Scintilla documentation for SCI_SETWRAPVISUALFLAGSLOCATION
Retrive the location of visual flags for wrapped lines.
See Scintilla documentation for SCI_GETWRAPVISUALFLAGSLOCATION
Set the start indent for wrapped lines.
See Scintilla documentation for SCI_SETWRAPSTARTINDENT
Retrive the start indent for wrapped lines.
See Scintilla documentation for SCI_GETWRAPSTARTINDENT
Sets how wrapped sublines are placed. Default is fixed.
See Scintilla documentation for SCI_SETWRAPINDENTMODE
Retrieve how wrapped sublines are placed. Default is fixed.
See Scintilla documentation for SCI_GETWRAPINDENTMODE
Sets the degree of caching of layout information.
See Scintilla documentation for SCI_SETLAYOUTCACHE
Retrieve the degree of caching of layout information.
See Scintilla documentation for SCI_GETLAYOUTCACHE
Sets the document width assumed for scrolling.
See Scintilla documentation for SCI_SETSCROLLWIDTH
Retrieve the document width assumed for scrolling.
See Scintilla documentation for SCI_GETSCROLLWIDTH
Sets whether the maximum width line displayed is used to set scroll width.
See Scintilla documentation for SCI_SETSCROLLWIDTHTRACKING
Retrieve whether the scroll width tracks wide lines.
See Scintilla documentation for SCI_GETSCROLLWIDTHTRACKING
Measure the pixel width of some text in a particular style. NUL terminated text argument. Does not handle tab or control characters.
See Scintilla documentation for SCI_TEXTWIDTH
Sets the scroll range so that maximum scroll position has the last line at the bottom of the view (default). Setting this to false allows scrolling one page below the last line.
See Scintilla documentation for SCI_SETENDATLASTLINE
Retrieve whether the maximum scroll position has the last line at the bottom of the view.
See Scintilla documentation for SCI_GETENDATLASTLINE
Retrieve the height of a particular line of text in pixels.
See Scintilla documentation for SCI_TEXTHEIGHT
Show or hide the vertical scroll bar.
See Scintilla documentation for SCI_SETVSCROLLBAR
Is the vertical scroll bar visible?
See Scintilla documentation for SCI_GETVSCROLLBAR
Append a string to the end of the document without changing the selection.
See Scintilla documentation for SCI_APPENDTEXT
Is drawing done in two phases with backgrounds drawn before faoregrounds?
See Scintilla documentation for SCI_GETTWOPHASEDRAW
In twoPhaseDraw mode, drawing is performed in two phases, first the background and then the foreground. This avoids chopping off characters that overlap the next run.
See Scintilla documentation for SCI_SETTWOPHASEDRAW
Choose the quality level for text from the FontQuality enumeration.
See Scintilla documentation for SCI_SETFONTQUALITY
Retrieve the quality level for text.
See Scintilla documentation for SCI_GETFONTQUALITY
Scroll so that a display line is at the top of the display.
See Scintilla documentation for SCI_SETFIRSTVISIBLELINE
Change the effect of pasting when there are multiple selections.
See Scintilla documentation for SCI_SETMULTIPASTE
Retrieve the effect of pasting when there are multiple selections..
See Scintilla documentation for SCI_GETMULTIPASTE
Retrieve the value of a tag from a regular expression search.
See Scintilla documentation for SCI_GETTAG
Make the target range start and end be the same as the selection range start and end.
See Scintilla documentation for SCI_TARGETFROMSELECTION
Join the lines in the target.
See Scintilla documentation for SCI_LINESJOIN
Split the lines in the target into lines that are less wide than pixelWidth where possible.
See Scintilla documentation for SCI_LINESSPLIT
Set the colours used as a chequerboard pattern in the fold margin
See Scintilla documentation for SCI_SETFOLDMARGINCOLOUR
Set the colours used as a chequerboard pattern in the fold margin
See Scintilla documentation for SCI_SETFOLDMARGINHICOLOUR
Move caret down one line.
See Scintilla documentation for SCI_LINEDOWN
Move caret down one line extending selection to new caret position.
See Scintilla documentation for SCI_LINEDOWNEXTEND
Move caret up one line.
See Scintilla documentation for SCI_LINEUP
Move caret up one line extending selection to new caret position.
See Scintilla documentation for SCI_LINEUPEXTEND
Move caret left one character.
See Scintilla documentation for SCI_CHARLEFT
Move caret left one character extending selection to new caret position.
See Scintilla documentation for SCI_CHARLEFTEXTEND
Move caret right one character.
See Scintilla documentation for SCI_CHARRIGHT
Move caret right one character extending selection to new caret position.
See Scintilla documentation for SCI_CHARRIGHTEXTEND
Move caret left one word.
See Scintilla documentation for SCI_WORDLEFT
Move caret left one word extending selection to new caret position.
See Scintilla documentation for SCI_WORDLEFTEXTEND
Move caret right one word.
See Scintilla documentation for SCI_WORDRIGHT
Move caret right one word extending selection to new caret position.
See Scintilla documentation for SCI_WORDRIGHTEXTEND
Move caret to first position on line extending selection to new caret position.
See Scintilla documentation for SCI_HOMEEXTEND
Move caret to last position on line.
See Scintilla documentation for SCI_LINEEND
Move caret to last position on line extending selection to new caret position.
See Scintilla documentation for SCI_LINEENDEXTEND
Move caret to first position in document.
See Scintilla documentation for SCI_DOCUMENTSTART
Move caret to first position in document extending selection to new caret position.
See Scintilla documentation for SCI_DOCUMENTSTARTEXTEND
Move caret to last position in document.
See Scintilla documentation for SCI_DOCUMENTEND
Move caret to last position in document extending selection to new caret position.
See Scintilla documentation for SCI_DOCUMENTENDEXTEND
Move caret one page up.
See Scintilla documentation for SCI_PAGEUP
Move caret one page up extending selection to new caret position.
See Scintilla documentation for SCI_PAGEUPEXTEND
Move caret one page down.
See Scintilla documentation for SCI_PAGEDOWN
Move caret one page down extending selection to new caret position.
See Scintilla documentation for SCI_PAGEDOWNEXTEND
Switch from insert to overtype mode or the reverse.
See Scintilla documentation for SCI_EDITTOGGLEOVERTYPE
Cancel any modes such as call tip or auto-completion list display.
See Scintilla documentation for SCI_CANCEL
Delete the selection or if no selection, the character before the caret.
See Scintilla documentation for SCI_DELETEBACK
If selection is empty or all on one line replace the selection with a tab character. If more than one line selected, indent the lines.
See Scintilla documentation for SCI_TAB
Dedent the selected lines.
See Scintilla documentation for SCI_BACKTAB
Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
See Scintilla documentation for SCI_NEWLINE
Insert a Form Feed character.
See Scintilla documentation for SCI_FORMFEED
Move caret to before first visible character on line. If already there move to first character on line.
See Scintilla documentation for SCI_VCHOME
Like VCHome but extending selection to new caret position.
See Scintilla documentation for SCI_VCHOMEEXTEND
Magnify the displayed text by increasing the sizes by 1 point.
See Scintilla documentation for SCI_ZOOMIN
Make the displayed text smaller by decreasing the sizes by 1 point.
See Scintilla documentation for SCI_ZOOMOUT
Delete the word to the left of the caret.
See Scintilla documentation for SCI_DELWORDLEFT
Delete the word to the right of the caret.
See Scintilla documentation for SCI_DELWORDRIGHT
Delete the word to the right of the caret, but not the trailing non-word characters.
See Scintilla documentation for SCI_DELWORDRIGHTEND
Cut the line containing the caret.
See Scintilla documentation for SCI_LINECUT
Delete the line containing the caret.
See Scintilla documentation for SCI_LINEDELETE
Switch the current line with the previous.
See Scintilla documentation for SCI_LINETRANSPOSE
Duplicate the current line.
See Scintilla documentation for SCI_LINEDUPLICATE
Transform the selection to lower case.
See Scintilla documentation for SCI_LOWERCASE
Transform the selection to upper case.
See Scintilla documentation for SCI_UPPERCASE
Scroll the document down, keeping the caret visible.
See Scintilla documentation for SCI_LINESCROLLDOWN
Scroll the document up, keeping the caret visible.
See Scintilla documentation for SCI_LINESCROLLUP
Delete the selection or if no selection, the character before the caret. Will not delete the character before at the start of a line.
See Scintilla documentation for SCI_DELETEBACKNOTLINE
Move caret to first position on display line.
See Scintilla documentation for SCI_HOMEDISPLAY
Move caret to first position on display line extending selection to new caret position.
See Scintilla documentation for SCI_HOMEDISPLAYEXTEND
Move caret to last position on display line.
See Scintilla documentation for SCI_LINEENDDISPLAY
Move caret to last position on display line extending selection to new caret position.
See Scintilla documentation for SCI_LINEENDDISPLAYEXTEND
These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like (Home|LineEnd)Display The difference is that, the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
See Scintilla documentation for SCI_HOMEWRAP
These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like (Home|LineEnd)Display The difference is that, the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
See Scintilla documentation for SCI_HOMEWRAPEXTEND
These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like (Home|LineEnd)Display The difference is that, the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
See Scintilla documentation for SCI_LINEENDWRAP
These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like (Home|LineEnd)Display The difference is that, the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
See Scintilla documentation for SCI_LINEENDWRAPEXTEND
These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like (Home|LineEnd)Display The difference is that, the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
See Scintilla documentation for SCI_VCHOMEWRAP
These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like (Home|LineEnd)Display The difference is that, the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
See Scintilla documentation for SCI_VCHOMEWRAPEXTEND
Copy the line containing the caret.
See Scintilla documentation for SCI_LINECOPY
Move the caret inside current view if it’s not there already.
See Scintilla documentation for SCI_MOVECARETINSIDEVIEW
How many characters are on a line, including end of line characters?
See Scintilla documentation for SCI_LINELENGTH
Highlight the characters at two positions.
See Scintilla documentation for SCI_BRACEHIGHLIGHT
Highlight the character at a position indicating there is no matching brace.
See Scintilla documentation for SCI_BRACEBADLIGHT
Find the position of a matching brace or INVALID_POSITION if no match.
See Scintilla documentation for SCI_BRACEMATCH
Are the end of line characters visible?
See Scintilla documentation for SCI_GETVIEWEOL
Make the end of line characters visible or invisible.
See Scintilla documentation for SCI_SETVIEWEOL
Retrieve a pointer to the document object.
See Scintilla documentation for SCI_GETDOCPOINTER
Change the document object used.
See Scintilla documentation for SCI_SETDOCPOINTER
Set which document modification events are sent to the container.
See Scintilla documentation for SCI_SETMODEVENTMASK
Retrieve the column number which text should be kept within.
See Scintilla documentation for SCI_GETEDGECOLUMN
Set the column number of the edge. If text goes past the edge then it is highlighted.
See Scintilla documentation for SCI_SETEDGECOLUMN
Retrieve the edge highlight mode.
See Scintilla documentation for SCI_GETEDGEMODE
The edge may be displayed by a line (EDGE_LINE) or by highlighting text that goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
See Scintilla documentation for SCI_SETEDGEMODE
Retrieve the colour used in edge indication.
See Scintilla documentation for SCI_GETEDGECOLOUR
Change the colour used in edge indication.
See Scintilla documentation for SCI_SETEDGECOLOUR
Sets the current caret position to be the search anchor.
See Scintilla documentation for SCI_SEARCHANCHOR
Find some text starting at the search anchor. Does not ensure the selection is visible.
See Scintilla documentation for SCI_SEARCHNEXT
Find some text starting at the search anchor and moving backwards. Does not ensure the selection is visible.
See Scintilla documentation for SCI_SEARCHPREV
Retrieves the number of lines completely visible.
See Scintilla documentation for SCI_LINESONSCREEN
Set whether a pop up menu is displayed automatically when the user presses the wrong mouse button.
See Scintilla documentation for SCI_USEPOPUP
Is the selection rectangular? The alternative is the more common stream selection.
See Scintilla documentation for SCI_SELECTIONISRECTANGLE
Set the zoom level. This number of points is added to the size of all fonts. It may be positive to magnify or negative to reduce.
See Scintilla documentation for SCI_SETZOOM
Retrieve the zoom level.
See Scintilla documentation for SCI_GETZOOM
Create a new document object. Starts with reference count of 1 and not selected into editor.
See Scintilla documentation for SCI_CREATEDOCUMENT
Extend life of document.
See Scintilla documentation for SCI_ADDREFDOCUMENT
Release a reference to the document, deleting document if it fades to black.
See Scintilla documentation for SCI_RELEASEDOCUMENT
Get which document modification events are sent to the container.
See Scintilla documentation for SCI_GETMODEVENTMASK
Change internal focus flag.
See Scintilla documentation for SCI_SETFOCUS
Get internal focus flag.
See Scintilla documentation for SCI_GETFOCUS
Change error status - 0 = OK.
See Scintilla documentation for SCI_SETSTATUS
Get error status.
See Scintilla documentation for SCI_GETSTATUS
Set whether the mouse is captured when its button is pressed.
See Scintilla documentation for SCI_SETMOUSEDOWNCAPTURES
Get whether mouse gets captured.
See Scintilla documentation for SCI_GETMOUSEDOWNCAPTURES
Sets the cursor to one of the SC_CURSOR* values.
See Scintilla documentation for SCI_SETCURSOR
Get cursor type.
See Scintilla documentation for SCI_GETCURSOR
Change the way control characters are displayed: If symbol is < 32, keep the drawn way, else, use the given character.
See Scintilla documentation for SCI_SETCONTROLCHARSYMBOL
Get the way control characters are displayed.
See Scintilla documentation for SCI_GETCONTROLCHARSYMBOL
Move to the previous change in capitalisation.
See Scintilla documentation for SCI_WORDPARTLEFT
Move to the previous change in capitalisation extending selection to new caret position.
See Scintilla documentation for SCI_WORDPARTLEFTEXTEND
Move to the change next in capitalisation.
See Scintilla documentation for SCI_WORDPARTRIGHT
Move to the next change in capitalisation extending selection to new caret position.
See Scintilla documentation for SCI_WORDPARTRIGHTEXTEND
Set the way the display area is determined when a particular line is to be moved to by Find, FindNext, GotoLine, etc.
See Scintilla documentation for SCI_SETVISIBLEPOLICY
Delete back from the current position to the start of the line.
See Scintilla documentation for SCI_DELLINELEFT
Delete forwards from the current position to the end of the line.
See Scintilla documentation for SCI_DELLINERIGHT
Get and Set the xOffset (ie, horizonal scroll position).
See Scintilla documentation for SCI_SETXOFFSET
Get and Set the xOffset (ie, horizonal scroll position).
See Scintilla documentation for SCI_GETXOFFSET
Set the last x chosen value to be the caret x position.
See Scintilla documentation for SCI_CHOOSECARETX
Set the focus to this Scintilla widget.
See Scintilla documentation for SCI_GRABFOCUS
Set the way the caret is kept visible when going sideway. The exclusion zone is given in pixels.
See Scintilla documentation for SCI_SETXCARETPOLICY
Set the way the line the caret is on is kept visible. The exclusion zone is given in lines.
See Scintilla documentation for SCI_SETYCARETPOLICY
Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE).
See Scintilla documentation for SCI_SETPRINTWRAPMODE
Is printing line wrapped?
See Scintilla documentation for SCI_GETPRINTWRAPMODE
Set a fore colour for active hotspots.
See Scintilla documentation for SCI_SETHOTSPOTACTIVEFORE
Get the fore colour for active hotspots.
See Scintilla documentation for SCI_GETHOTSPOTACTIVEFORE
Set a back colour for active hotspots.
See Scintilla documentation for SCI_SETHOTSPOTACTIVEBACK
Get the back colour for active hotspots.
See Scintilla documentation for SCI_GETHOTSPOTACTIVEBACK
Enable / Disable underlining active hotspots.
See Scintilla documentation for SCI_SETHOTSPOTACTIVEUNDERLINE
Get whether underlining for active hotspots.
See Scintilla documentation for SCI_GETHOTSPOTACTIVEUNDERLINE
Limit hotspots to single line so hotspots on two lines don’t merge.
See Scintilla documentation for SCI_SETHOTSPOTSINGLELINE
Get the HotspotSingleLine property
See Scintilla documentation for SCI_GETHOTSPOTSINGLELINE
Move caret between paragraphs (delimited by empty lines).
See Scintilla documentation for SCI_PARADOWN
Move caret between paragraphs (delimited by empty lines).
See Scintilla documentation for SCI_PARADOWNEXTEND
Move caret between paragraphs (delimited by empty lines).
See Scintilla documentation for SCI_PARAUP
Move caret between paragraphs (delimited by empty lines).
See Scintilla documentation for SCI_PARAUPEXTEND
Given a valid document position, return the previous position taking code page into account. Returns 0 if passed 0.
See Scintilla documentation for SCI_POSITIONBEFORE
Given a valid document position, return the next position taking code page into account. Maximum value returned is the last position in the document.
See Scintilla documentation for SCI_POSITIONAFTER
Copy a range of text to the clipboard. Positions are clipped into the document.
See Scintilla documentation for SCI_COPYRANGE
Copy argument text to the clipboard.
See Scintilla documentation for SCI_COPYTEXT
Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or by lines (SC_SEL_LINES).
See Scintilla documentation for SCI_SETSELECTIONMODE
Get the mode of the current selection.
See Scintilla documentation for SCI_GETSELECTIONMODE
Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line).
See Scintilla documentation for SCI_GETLINESELSTARTPOSITION
Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line).
See Scintilla documentation for SCI_GETLINESELENDPOSITION
Move caret down one line, extending rectangular selection to new caret position.
See Scintilla documentation for SCI_LINEDOWNRECTEXTEND
Move caret up one line, extending rectangular selection to new caret position.
See Scintilla documentation for SCI_LINEUPRECTEXTEND
Move caret left one character, extending rectangular selection to new caret position.
See Scintilla documentation for SCI_CHARLEFTRECTEXTEND
Move caret right one character, extending rectangular selection to new caret position.
See Scintilla documentation for SCI_CHARRIGHTRECTEXTEND
Move caret to first position on line, extending rectangular selection to new caret position.
See Scintilla documentation for SCI_HOMERECTEXTEND
Move caret to before first visible character on line. If already there move to first character on line. In either case, extend rectangular selection to new caret position.
See Scintilla documentation for SCI_VCHOMERECTEXTEND
Move caret to last position on line, extending rectangular selection to new caret position.
See Scintilla documentation for SCI_LINEENDRECTEXTEND
Move caret one page up, extending rectangular selection to new caret position.
See Scintilla documentation for SCI_PAGEUPRECTEXTEND
Move caret one page down, extending rectangular selection to new caret position.
See Scintilla documentation for SCI_PAGEDOWNRECTEXTEND
Move caret to top of page, or one page up if already at top of page.
See Scintilla documentation for SCI_STUTTEREDPAGEUP
Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.
See Scintilla documentation for SCI_STUTTEREDPAGEUPEXTEND
Move caret to bottom of page, or one page down if already at bottom of page.
See Scintilla documentation for SCI_STUTTEREDPAGEDOWN
Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.
See Scintilla documentation for SCI_STUTTEREDPAGEDOWNEXTEND
Move caret left one word, position cursor at end of word.
See Scintilla documentation for SCI_WORDLEFTEND
Move caret left one word, position cursor at end of word, extending selection to new caret position.
See Scintilla documentation for SCI_WORDLEFTENDEXTEND
Move caret right one word, position cursor at end of word.
See Scintilla documentation for SCI_WORDRIGHTEND
Move caret right one word, position cursor at end of word, extending selection to new caret position.
See Scintilla documentation for SCI_WORDRIGHTENDEXTEND
Set the set of characters making up whitespace for when moving or selecting by word. Should be called after SetWordChars.
See Scintilla documentation for SCI_SETWHITESPACECHARS
Reset the set of characters for whitespace and word characters to the defaults.
See Scintilla documentation for SCI_SETCHARSDEFAULT
Get currently selected item position in the auto-completion list
See Scintilla documentation for SCI_AUTOCGETCURRENT
Get currently selected item text in the auto-completion list Returns the length of the item text
See Scintilla documentation for SCI_AUTOCGETCURRENTTEXT
Enlarge the document to a particular size of text bytes.
See Scintilla documentation for SCI_ALLOCATE
Returns the target converted to UTF8. Return the length in bytes.
See Scintilla documentation for SCI_TARGETASUTF8
Set the length of the utf8 argument for calling EncodedFromUTF8. Set to -1 and the string will be measured to the first nul.
See Scintilla documentation for SCI_SETLENGTHFORENCODE
Translates a UTF8 string into the document encoding. Return the length of the result in bytes. On error return 0.
See Scintilla documentation for SCI_ENCODEDFROMUTF8
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.
See Scintilla documentation for SCI_FINDCOLUMN
Can the caret preferred x position only be changed by explicit movement commands?
See Scintilla documentation for SCI_GETCARETSTICKY
Stop the caret preferred x position changing when the user types.
See Scintilla documentation for SCI_SETCARETSTICKY
Switch between sticky and non-sticky: meant to be bound to a key.
See Scintilla documentation for SCI_TOGGLECARETSTICKY
Enable/Disable convert-on-paste for line endings
See Scintilla documentation for SCI_SETPASTECONVERTENDINGS
Get convert-on-paste setting
See Scintilla documentation for SCI_GETPASTECONVERTENDINGS
Duplicate the selection. If selection empty duplicate the line containing the caret.
See Scintilla documentation for SCI_SELECTIONDUPLICATE
Set background alpha of the caret line.
See Scintilla documentation for SCI_SETCARETLINEBACKALPHA
Get the background alpha of the caret line.
See Scintilla documentation for SCI_GETCARETLINEBACKALPHA
Set the style of the caret to be drawn.
See Scintilla documentation for SCI_SETCARETSTYLE
Returns the current style of the caret.
See Scintilla documentation for SCI_GETCARETSTYLE
Set the indicator used for IndicatorFillRange and IndicatorClearRange
See Scintilla documentation for SCI_SETINDICATORCURRENT
Get the current indicator
See Scintilla documentation for SCI_GETINDICATORCURRENT
Set the value used for IndicatorFillRange
See Scintilla documentation for SCI_SETINDICATORVALUE
Get the current indicator vaue
See Scintilla documentation for SCI_GETINDICATORVALUE
Turn a indicator on over a range.
See Scintilla documentation for SCI_INDICATORFILLRANGE
Turn a indicator off over a range.
See Scintilla documentation for SCI_INDICATORCLEARRANGE
Are any indicators present at position?
See Scintilla documentation for SCI_INDICATORALLONFOR
What value does a particular indicator have at at a position?
See Scintilla documentation for SCI_INDICATORVALUEAT
Where does a particular indicator start?
See Scintilla documentation for SCI_INDICATORSTART
Where does a particular indicator end?
See Scintilla documentation for SCI_INDICATOREND
Set number of entries in position cache
See Scintilla documentation for SCI_SETPOSITIONCACHE
How many entries are allocated to the position cache?
See Scintilla documentation for SCI_GETPOSITIONCACHE
Copy the selection, if selection empty copy the line with the caret
See Scintilla documentation for SCI_COPYALLOWLINE
Always interpret keyboard input as Unicode
See Scintilla documentation for SCI_SETKEYSUNICODE
Are keys always interpreted as Unicode?
See Scintilla documentation for SCI_GETKEYSUNICODE
Set the alpha fill colour of the given indicator.
See Scintilla documentation for SCI_INDICSETALPHA
Get the alpha fill colour of the given indicator.
See Scintilla documentation for SCI_INDICGETALPHA
Set extra ascent for each line
See Scintilla documentation for SCI_SETEXTRAASCENT
Get extra ascent for each line
See Scintilla documentation for SCI_GETEXTRAASCENT
Set extra descent for each line
See Scintilla documentation for SCI_SETEXTRADESCENT
Get extra descent for each line
See Scintilla documentation for SCI_GETEXTRADESCENT
Which symbol was defined for markerNumber with MarkerDefine
See Scintilla documentation for SCI_MARKERSYMBOLDEFINED
Set the text in the text margin for a line
See Scintilla documentation for SCI_MARGINSETTEXT
Get the text in the text margin for a line
See Scintilla documentation for SCI_MARGINGETTEXT
Set the style number for the text margin for a line
See Scintilla documentation for SCI_MARGINSETSTYLE
Get the style number for the text margin for a line
See Scintilla documentation for SCI_MARGINGETSTYLE
Set the style in the text margin for a line
See Scintilla documentation for SCI_MARGINSETSTYLES
Get the styles in the text margin for a line
See Scintilla documentation for SCI_MARGINGETSTYLES
Clear the margin text on all lines
See Scintilla documentation for SCI_MARGINTEXTCLEARALL
Get the start of the range of style numbers used for margin text
See Scintilla documentation for SCI_MARGINSETSTYLEOFFSET
Get the start of the range of style numbers used for margin text
See Scintilla documentation for SCI_MARGINGETSTYLEOFFSET
Set the annotation text for a line
See Scintilla documentation for SCI_ANNOTATIONSETTEXT
Get the annotation text for a line
See Scintilla documentation for SCI_ANNOTATIONGETTEXT
Set the style number for the annotations for a line
See Scintilla documentation for SCI_ANNOTATIONSETSTYLE
Get the style number for the annotations for a line
See Scintilla documentation for SCI_ANNOTATIONGETSTYLE
Set the annotation styles for a line
See Scintilla documentation for SCI_ANNOTATIONSETSTYLES
Get the annotation styles for a line
See Scintilla documentation for SCI_ANNOTATIONGETSTYLES
Get the number of annotation lines for a line
See Scintilla documentation for SCI_ANNOTATIONGETLINES
Clear the annotations from all lines
See Scintilla documentation for SCI_ANNOTATIONCLEARALL
Set the visibility for the annotations for a view
See Scintilla documentation for SCI_ANNOTATIONSETVISIBLE
Get the visibility for the annotations for a view
See Scintilla documentation for SCI_ANNOTATIONGETVISIBLE
Get the start of the range of style numbers used for annotations
See Scintilla documentation for SCI_ANNOTATIONSETSTYLEOFFSET
Get the start of the range of style numbers used for annotations
See Scintilla documentation for SCI_ANNOTATIONGETSTYLEOFFSET
Add a container action to the undo stack
See Scintilla documentation for SCI_ADDUNDOACTION
Find the position of a character from a point within the window.
See Scintilla documentation for SCI_CHARPOSITIONFROMPOINT
Find the position of a character from a point within the window. Return INVALID_POSITION if not close to text.
See Scintilla documentation for SCI_CHARPOSITIONFROMPOINTCLOSE
Set whether multiple selections can be made
See Scintilla documentation for SCI_SETMULTIPLESELECTION
Whether multiple selections can be made
See Scintilla documentation for SCI_GETMULTIPLESELECTION
Set whether typing can be performed into multiple selections
See Scintilla documentation for SCI_SETADDITIONALSELECTIONTYPING
Whether typing can be performed into multiple selections
See Scintilla documentation for SCI_GETADDITIONALSELECTIONTYPING
Set whether additional carets will blink
See Scintilla documentation for SCI_SETADDITIONALCARETSBLINK
Whether additional carets will blink
See Scintilla documentation for SCI_GETADDITIONALCARETSBLINK
Set whether additional carets are visible
See Scintilla documentation for SCI_SETADDITIONALCARETSVISIBLE
Whether additional carets are visible
See Scintilla documentation for SCI_GETADDITIONALCARETSVISIBLE
How many selections are there?
See Scintilla documentation for SCI_GETSELECTIONS
Clear selections to a single empty stream selection
See Scintilla documentation for SCI_CLEARSELECTIONS
Set a simple selection
See Scintilla documentation for SCI_SETSELECTION
Add a selection
See Scintilla documentation for SCI_ADDSELECTION
Set the main selection
See Scintilla documentation for SCI_SETMAINSELECTION
Which selection is the main selection
See Scintilla documentation for SCI_GETMAINSELECTION
Which selection is the main selection
See Scintilla documentation for SCI_SETSELECTIONNCARET
Which selection is the main selection
See Scintilla documentation for SCI_GETSELECTIONNCARET
Which selection is the main selection
See Scintilla documentation for SCI_SETSELECTIONNANCHOR
Which selection is the main selection
See Scintilla documentation for SCI_GETSELECTIONNANCHOR
Which selection is the main selection
See Scintilla documentation for SCI_SETSELECTIONNCARETVIRTUALSPACE
Which selection is the main selection
See Scintilla documentation for SCI_GETSELECTIONNCARETVIRTUALSPACE
Which selection is the main selection
See Scintilla documentation for SCI_SETSELECTIONNANCHORVIRTUALSPACE
Which selection is the main selection
See Scintilla documentation for SCI_GETSELECTIONNANCHORVIRTUALSPACE
Sets the position that starts the selection - this becomes the anchor.
See Scintilla documentation for SCI_SETSELECTIONNSTART
Returns the position at the start of the selection.
See Scintilla documentation for SCI_GETSELECTIONNSTART
Sets the position that ends the selection - this becomes the currentPosition.
See Scintilla documentation for SCI_SETSELECTIONNEND
Returns the position at the end of the selection.
See Scintilla documentation for SCI_GETSELECTIONNEND
Returns the position at the end of the selection.
See Scintilla documentation for SCI_SETRECTANGULARSELECTIONCARET
Returns the position at the end of the selection.
See Scintilla documentation for SCI_GETRECTANGULARSELECTIONCARET
Returns the position at the end of the selection.
See Scintilla documentation for SCI_SETRECTANGULARSELECTIONANCHOR
Returns the position at the end of the selection.
See Scintilla documentation for SCI_GETRECTANGULARSELECTIONANCHOR
Returns the position at the end of the selection.
See Scintilla documentation for SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE
Returns the position at the end of the selection.
See Scintilla documentation for SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE
Returns the position at the end of the selection.
See Scintilla documentation for SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE
Returns the position at the end of the selection.
See Scintilla documentation for SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE
Returns the position at the end of the selection.
See Scintilla documentation for SCI_SETVIRTUALSPACEOPTIONS
Returns the position at the end of the selection.
See Scintilla documentation for SCI_GETVIRTUALSPACEOPTIONS
On GTK+, allow selecting the modifier key to use for mouse-based rectangular selection. Often the window manager requires Alt+Mouse Drag for moving windows. Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER.
See Scintilla documentation for SCI_SETRECTANGULARSELECTIONMODIFIER
Get the modifier key used for rectangular selection.
See Scintilla documentation for SCI_GETRECTANGULARSELECTIONMODIFIER
Set the foreground colour of additional selections. Must have previously called SetSelFore with non-zero first argument for this to have an effect.
See Scintilla documentation for SCI_SETADDITIONALSELFORE
Set the background colour of additional selections. Must have previously called SetSelBack with non-zero first argument for this to have an effect.
See Scintilla documentation for SCI_SETADDITIONALSELBACK
Set the alpha of the selection.
See Scintilla documentation for SCI_SETADDITIONALSELALPHA
Get the alpha of the selection.
See Scintilla documentation for SCI_GETADDITIONALSELALPHA
Set the foreground colour of additional carets.
See Scintilla documentation for SCI_SETADDITIONALCARETFORE
Get the foreground colour of additional carets.
See Scintilla documentation for SCI_GETADDITIONALCARETFORE
Set the main selection to the next selection.
See Scintilla documentation for SCI_ROTATESELECTION
Swap that caret and anchor of the main selection.
See Scintilla documentation for SCI_SWAPMAINANCHORCARET
Indicate that the internal state of a lexer has changed over a range and therefore there may be a need to redraw.
See Scintilla documentation for SCI_CHANGELEXERSTATE
Find the next line at or after lineStart that is a contracted fold header line. Return -1 when no more lines.
See Scintilla documentation for SCI_CONTRACTEDFOLDNEXT
Centre current line in window.
See Scintilla documentation for SCI_VERTICALCENTRECARET
Start notifying the container of all key presses and commands.
See Scintilla documentation for SCI_STARTRECORD
Stop notifying the container of all key presses and commands.
See Scintilla documentation for SCI_STOPRECORD
Set the lexing language of the document.
See Scintilla documentation for SCI_SETLEXER
Retrieve the lexing language of the document.
See Scintilla documentation for SCI_GETLEXER
Colourise a segment of the document using the current lexing language.
See Scintilla documentation for SCI_COLOURISE
Set up a value that may be used by a lexer for some optional feature.
See Scintilla documentation for SCI_SETPROPERTY
Set up the key words used by the lexer.
See Scintilla documentation for SCI_SETKEYWORDS
Set the lexing language of the document based on string name.
See Scintilla documentation for SCI_SETLEXERLANGUAGE
Load a lexer library (dll / so).
See Scintilla documentation for SCI_LOADLEXERLIBRARY
Retrieve a “property” value previously set with SetProperty.
See Scintilla documentation for SCI_GETPROPERTY
Retrieve a “property” value previously set with SetProperty, with “$()” variable replacement on returned buffer.
See Scintilla documentation for SCI_GETPROPERTYEXPANDED
Retrieve a “property” value previously set with SetProperty, interpreted as an int AFTER any “$()” variable replacement.
See Scintilla documentation for SCI_GETPROPERTYINT
Retrieve the number of bits the current lexer needs for styling.
See Scintilla documentation for SCI_GETSTYLEBITSNEEDED
Retrieve the name of the lexer. Return the length of the text.
See Scintilla documentation for SCI_GETLEXERLANGUAGE
For private communication between an application and a known lexer.
See Scintilla documentation for SCI_PRIVATELEXERCALL
Retrieve a ‘n’ separated list of properties understood by the current lexer.
See Scintilla documentation for SCI_PROPERTYNAMES
Retrieve the type of a property.
See Scintilla documentation for SCI_PROPERTYTYPE
Describe a property.
See Scintilla documentation for SCI_DESCRIBEPROPERTY
Retrieve a ‘n’ separated list of descriptions of the keyword sets understood by the current lexer.
See Scintilla documentation for SCI_DESCRIBEKEYWORDSETS
Runs the function passed for each line in the current document. The function gets passed 3 arguments, the contents of the line, the line number (starting from zero), and the total number of lines. If the function returns a number, that number is added to the current line number for the next iteration.
That way, if you delete the current line, you should return 0, so as to stay on the current physical line.
Under normal circumstances, you do not need to return anything from the function (i.e. None)
e.g.:
def testContents(contents, lineNumber, totalLines):
if contents.strip() == "rubbish":
editor.deleteLine(lineNumber)
# As we've deleted the line, the "next" line to process
# is actually the current line, so we return 0 to advance zero lines
# and hence stay on the same line
return 0
elif contents.strip() == "something old":
editor.replaceLine(lineNumber, "something new")
elif contents.strip() == "little something":
editor.replaceLine(lineNumber, "BIG\nSOMETHING"
# Here we return 2, as we've inserted a newline,
# and we don't want to test the "SOMETHING" line again
return 2
# if you wanted, you could optionally return 1 here, to move the next line
# but that's the default, so you don't need to bother.
editor.forEachLine(testContents)
Deletes the given (zero indexed) line number.
Replaces the given (zero indexed) line number with the given contents. e.g.:
editor.replaceLine(3, "New contents")
Replaces the given (zero indexed) line number with the given contents, including the line break (ie. the line break from the old line is removed, no line break on the replacement will result in joining lines).
e.g.:
editor.replaceWholeLine(3, "New contents")
Sets the target start and end in one call. See Editor.setTargetStart and Editor.setTargetEnd
Gets the start and end (zero indexed) line numbers of the user selection, or the whole document if nothing is selected.
Useful if you want to run your script over a number of lines - using this allows the user to select nothing, and have the script run for the whole document, or select just the section they want to run the script over.
Gets the start and end (zero indexed) byte numbers of the user selection, or the whole document if nothing is selected.
Clears all callbacks
Clears all callbacks for a given function
Clears all callbacks for the given list of events
Clears the callback for the given callback function for the list of events
Simple search and replace.
Simple regular expression search and replace (using Notepad++/Scintilla regular expressions).
Python regular expression search and replace. Full support for Python regular expressions. Works line-by-line, so does not require significant memory overhead, however multiline regular expressions won’t work (see pymlreplace).
flags are from the re module (e.g. re.IGNORECASE), so import re if you use the flags. A maximum of count replacements are made, if zero or not given, then all replacements are made.
startLine and endLine are optional, and if provided refer the first and last (zero indexed) lines to perform the replace on.
Note that as ``$`` only matches ``n``, for Windows line ending files (i.e. ``rn``) if you want to match the end of the line, you need to use ``r$`` - see note about ``Editor.INCLUDELINEENDINGS``
As each line is searched individually, if you want to remove the line breaks, for instance to join lines together, you need to add a flag Editor.INCLUDELINEENDINGS. This includes the line endings in the search string, and also in the replacement.
To just add a star (*) to the end of every line, you’d just use:
editor.pyreplace("$", "*")
However, to join lines together, and put a pipe character (|) in between each one:
editor.pyreplace(r"\r$\n", "|", 0, Editor.INCLUDELINEENDINGS)
Would result in:
this is line 1
this is line 2
this is line 3
Becoming:
this is line 1|this is line 2|this is line 3
Python Multiline regular expression search and replace - works for multiline regular expressions, but makes at least 2 copies of the entire document, so is unsuitable for large documents. Note that re.MULTILINE is specified in the flags automatically.
flags are from the re module (e.g. re.IGNORECASE), so import re if you use the flags. A maximum of count replacements are made, if zero or not given, then all replacements are made.
startPosition and endPosition are optional, if provided they refer to the section of text, in offset bytes, to perform the search and replace in.
Note that as ``$`` only matches ``n``, for Windows line ending files (i.e. ``rn``) if you want to match the end of the line, you need to use ``r$``
Python regular expression search, calling a function for each match found. The function gets called with the (zero indexed) line number, and the match object.
startLine and endLine are optional, and if provided refer the first and last (zero indexed) lines to perform the replace on.
Note that the match object start and end refer to the positions **within the line* and not the entire document. Use editor.positionFromLine to find the location in the document*
Python multiline regular expression search, calling a function for each match found. The function gets called with the (zero indexed) line number, and the match object.
Note that this runs the search on the entire text, and therefore makes at least 2 copies of the entire document, therefore it may not be suitable for large documents.
startPosition and endPosition are optional, if provided they refer to the section of text, in offset bytes, to perform the search in.
Note that the match object start and end refer to the positions within the entire document, unlike :ref:`editor.pysearch`