Class Editor

Scintilla wrapper.

This is a straight forward API to directly control Scintilla. This documentation is not intended to fully describe the Scintilla API, but only to give a brief description. The official Scintilla documentation should be consulted for more details. All constants from the official documentation are exposed as Lua globals variables.

Some Scintilla messages, such as "SCI_SETxxx" and "SCI_GETxxx", are implemented in LuaScript as a single property. For example Editor.CurrentPos is a read/write property that calls both "SCI_GETCURRENTPOS" and "SCI_SETCURRENTPOS". The automatically generated documentation below may only refer to one or the other.

This class cannot be instantiated, rather predefined globals are available to use.

  • editor - the currently selected editor
  • editor1 - the first editor (usually on the left)
  • editor2 - the second editor (usually on the right)
  • console - the console's output editor used by LuaScript. Note that since this editor is "read-only" some functionality may not work as expected, e.g. manually adding or removing text.
  • input - the console's input editor used by LuaScript.

Note: Although the entire Scintilla API is available, a few parts of it should not be used since it would either have unexpected results, or does not make sense to use from Lua.

Helper Methods

Editor:textrange(startPos, endPos) Gets the text within a range.
Editor:findtext(search[, flags[, startPos[, endPos]]]) Finds the next match within the document.
Editor:match(search[, flags[, startPos]]) Creates a generator to iterate matches.
Editor:append(text) Appends text to the end of the document.
Editor:remove(startPos, endPos) Removes the text in the range.
Editor:set_text_direction(direction) Sets the text direction.

Text retrieval and modification

Editor:GetText() Retrieve all the text in the document.
Editor:SetText(text) Replace the contents of the document with the argument text.
Editor:SetSavePoint() Remember the current position in the undo history as the position at which the document was saved.
Editor:GetLine(line) Retrieve the contents of a line.
Editor:ReplaceSel(text) Replace the selected text with the argument text.
Editor.ReadOnly Set to read only or read write.
Editor:Allocate(bytes) Enlarge the document to a particular size of text bytes.
Editor:AddText(text) Add text to the document at current position.
Editor:AppendText(text) Append a string to the end of the document without changing the selection.
Editor:InsertText(pos, text) Insert string at a position.
Editor:ChangeInsertion(text) Change the text that is being inserted in response to SC_MOD_INSERTCHECK
Editor:ClearAll() Delete all text in the document.
Editor:DeleteRange(start, lengthDelete) Delete a range of text in the document.
Editor:ClearDocumentStyle() Set all style bytes to 0, remove all folding information.
Editor.CharAt[pos] read-only
Editor.StyleAt[pos] read-only
Editor:ReleaseAllExtendedStyles() Release all extended (>255) style numbers
Editor:AllocateExtendedStyles(numberStyles) Allocate some extended (>255) style numbers and return the start of the range
Editor:TargetAsUTF8() Returns the target converted to UTF8.
Editor:EncodedFromUTF8(utf8) Translates a UTF8 string into the document encoding.
Editor:SetLengthForEncode(bytes) Set the length of the utf8 argument for calling EncodedFromUTF8.

Searching

Editor.TargetStart Sets the position that starts the target which is used for updating the document without affecting the scroll position.
Editor.TargetEnd Sets the position that ends the target which is used for updating the document without affecting the scroll position.
Editor:SetTargetRange(start, end) Sets both the start and end of the target in one call.
Editor:TargetFromSelection() Make the target range start and end be the same as the selection range start and end.
Editor:TargetWholeDocument() Sets the target to the whole document.
Editor.SearchFlags Set the search flags used by SearchInTarget.
Editor:SearchInTarget(text) Search for a counted string in the target and set the target to the found range.
Editor.TargetText read-only
Editor:ReplaceTarget(text) Replace the target text with the argument text.
Editor:ReplaceTargetRE(text) Replace the target text with the argument text after \d processing.
Editor.Tag[tagNumber] read-only
Editor:SearchAnchor() Sets the current caret position to be the search anchor.
Editor:SearchNext(searchFlags, text) Find some text starting at the search anchor.
Editor:SearchPrev(searchFlags, text) Find some text starting at the search anchor and moving backwards.

Overtype

Editor.Overtype Set to overtype (true) or insert mode.

Cut, copy and paste

Editor:Cut() Cut the selection to the clipboard.
Editor:Copy() Copy the selection to the clipboard.
Editor:Paste() Paste the contents of the clipboard into the document replacing the selection.
Editor:Clear() Clear the selection.
Editor:CanPaste() Will a paste succeed?
Editor:CopyAllowLine() Copy the selection, if selection empty copy the line with the caret
Editor:CopyRange(start, end) Copy a range of text to the clipboard.
Editor:CopyText(text) Copy argument text to the clipboard.
Editor.PasteConvertEndings Enable/Disable convert-on-paste for line endings

Error handling

Editor.Status Change error status - 0 = OK.

Undo and Redo

Editor:Undo() Undo one action in the undo history.
Editor:CanUndo() Are there any undoable actions in the undo history?
Editor:Redo() Redoes the next action on the undo history.
Editor:CanRedo() Are there any redoable actions in the undo history?
Editor:EmptyUndoBuffer() Delete the undo history.
Editor.UndoCollection Choose between collecting actions into the undo history and discarding them.
Editor:BeginUndoAction() Start a sequence of actions that is undone and redone as a unit.
Editor:EndUndoAction() End a sequence of actions that is undone and redone as a unit.
Editor:AddUndoAction(token, flags) Add a container action to the undo stack

Selection and information

Editor.TextLength read-only
Editor.Length read-only
Editor.LineCount read-only
Editor.LinesOnScreen read-only
Editor.Modify read-only
Editor:SetSel(anchor, caret) Select a range of text.
Editor:GotoPos(caret) Set caret to a position and ensure it is visible.
Editor:GotoLine(line) Set caret to start of a line and ensure it is visible.
Editor.CurrentPos Sets the position of the caret.
Editor.Anchor Set the selection anchor to a position.
Editor.SelectionStart Sets the position that starts the selection - this becomes the anchor.
Editor.SelectionEnd Sets the position that ends the selection - this becomes the caret.
Editor:SetEmptySelection(caret) Set caret to a position, while removing any existing selection.
Editor:SelectAll() Select all the text in the document.
Editor:LineFromPosition(pos) Retrieve the line containing a position.
Editor:PositionFromLine(line) Retrieve the position at the start of a line.
Editor.LineEndPosition[line] read-only
Editor:LineLength(line) How many characters are on a line, including end of line characters?
Editor:GetSelText() Retrieve the selected text.
Editor:GetCurLine() Retrieve the text of the line containing the caret.
Editor.SelectionIsRectangle read-only
Editor.SelectionMode Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or by lines (SC_SEL_LINES).
Editor.MoveExtendsSelection read-only
Editor:GetLineSelStartPosition(line) Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line).
Editor:GetLineSelEndPosition(line) Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line).
Editor:MoveCaretInsideView() Move the caret inside current view if it's not there already.
Editor:PositionBefore(pos) Given a valid document position, return the previous position taking code page into account.
Editor:PositionAfter(pos) Given a valid document position, return the next position taking code page into account.
Editor:TextWidth(style, text) Measure the pixel width of some text in a particular style.
Editor:TextHeight(line) Retrieve the height of a particular line of text in pixels.
Editor.Column[pos] read-only
Editor:FindColumn(line, column) Find the position of a column on a line taking into account tabs and multi-byte characters.
Editor:PositionFromPoint(x, y) Find the position from a point within the window.
Editor:PositionFromPointClose(x, y) Find the position from a point within the window but return INVALID_POSITION if not close to text.
Editor:CharPositionFromPoint(x, y) Find the position of a character from a point within the window.
Editor:CharPositionFromPointClose(x, y) Find the position of a character from a point within the window.
Editor:PointXFromPosition(pos) Retrieve the x value of the point in the window where a position is displayed.
Editor:PointYFromPosition(pos) Retrieve the y value of the point in the window where a position is displayed.
Editor:HideSelection(hide) Draw the selection either highlighted or in normal (non-highlighted) style.
Editor:ChooseCaretX() Set the last x chosen value to be the caret x position.
Editor:MoveSelectedLinesUp() Move the selected lines up one line, shifting the line above after the selection
Editor:MoveSelectedLinesDown() Move the selected lines down one line, shifting the line below before the selection
Editor.MouseSelectionRectangularSwitch Set whether switching to rectangular mode while selecting with the mouse is allowed.

By character or UTF-16 code unit

Editor:PositionRelative(pos, relative) Given a valid document position, return a position that differs in a number of characters.
Editor:CountCharacters(start, end) Count characters between two positions.
Editor:PositionRelativeCodeUnits(pos, relative) Given a valid document position, return a position that differs in a number of UTF-16 code units.
Editor:CountCodeUnits(start, end) Count code units between two positions.
Editor.LineCharacterIndex read-only
Editor:AllocateLineCharacterIndex(lineCharacterIndex) Request line character index be created or its use count increased.
Editor:ReleaseLineCharacterIndex(lineCharacterIndex) Decrease use count of line character index and remove if 0.
Editor:LineFromIndexPosition(pos, lineCharacterIndex) Retrieve the document line containing a position measured in index units.
Editor:IndexPositionFromLine(line, lineCharacterIndex) Retrieve the position measured in index units at the start of a document line.

Multiple Selection and Virtual Space

Editor.MultipleSelection Set whether multiple selections can be made
Editor.AdditionalSelectionTyping Set whether typing can be performed into multiple selections
Editor.MultiPaste Change the effect of pasting when there are multiple selections.
Editor.VirtualSpaceOptions Set options for virtual space behaviour.
Editor.RectangularSelectionModifier On GTK+, allow selecting the modifier key to use for mouse-based rectangular selection.
Editor.Selections read-only
Editor.SelectionEmpty read-only
Editor:ClearSelections() Clear selections to a single empty stream selection
Editor:SetSelection(caret, anchor) Set a simple selection
Editor:AddSelection(caret, anchor) Add a selection
Editor:DropSelectionN(selection) Drop one selection
Editor.MainSelection Set the main selection
Editor.SelectionNCaret[selection] Set the caret position of the nth selection.
Editor.SelectionNCaretVirtualSpace[selection] Set the virtual space of the caret of the nth selection.
Editor.SelectionNAnchor[selection] Set the anchor position of the nth selection.
Editor.SelectionNAnchorVirtualSpace[selection] Set the virtual space of the anchor of the nth selection.
Editor.SelectionNStart[selection] Sets the position that starts the selection - this becomes the anchor.
Editor.SelectionNEnd[selection] Sets the position that ends the selection - this becomes the currentPosition.
Editor.RectangularSelectionCaret Set the caret position of the rectangular selection.
Editor.RectangularSelectionCaretVirtualSpace Set the virtual space of the caret of the rectangular selection.
Editor.RectangularSelectionAnchor Set the anchor position of the rectangular selection.
Editor.RectangularSelectionAnchorVirtualSpace Set the virtual space of the anchor of the rectangular selection.
Editor.AdditionalSelAlpha Set the alpha of the selection.
Editor.AdditionalSelFore Set the foreground colour of additional selections.
Editor.AdditionalSelBack Set the background colour of additional selections.
Editor.AdditionalCaretFore Set the foreground colour of additional carets.
Editor.AdditionalCaretsBlink Set whether additional carets will blink
Editor.AdditionalCaretsVisible Set whether additional carets are visible
Editor:SwapMainAnchorCaret() Swap that caret and anchor of the main selection.
Editor:RotateSelection() Set the main selection to the next selection.
Editor:MultipleSelectAddNext() Add the next occurrence of the main selection to the set of selections as main.
Editor:MultipleSelectAddEach() Add each occurrence of the main selection in the target to the set of selections.

Scrolling and automatic scrolling

Editor.FirstVisibleLine Scroll so that a display line is at the top of the display.
Editor.XOffset Set the xOffset (ie, horizontal scroll position).
Editor:LineScroll(columns, lines) Scroll horizontally and vertically.
Editor:ScrollCaret() Ensure the caret is visible.
Editor:ScrollRange(secondary, primary) Scroll the argument positions and the range between them into view giving priority to the primary position then the secondary position.
Editor:SetXCaretPolicy(caretPolicy, caretSlop) Set the way the caret is kept visible when going sideways.
Editor:SetYCaretPolicy(caretPolicy, caretSlop) Set the way the line the caret is on is kept visible.
Editor:SetVisiblePolicy(visiblePolicy, visibleSlop) Set the way the display area is determined when a particular line is to be moved to by Find, FindNext, GotoLine, etc.
Editor.HScrollBar Show or hide the horizontal scroll bar.
Editor.VScrollBar Show or hide the vertical scroll bar.
Editor.ScrollWidth Sets the document width assumed for scrolling.
Editor.ScrollWidthTracking Sets whether the maximum width line displayed is used to set scroll width.
Editor.EndAtLastLine Sets the scroll range so that maximum scroll position has the last line at the bottom of the view (default).

White space

Editor.ViewWS Make white space characters invisible, always visible or visible outside indentation.
Editor:SetWhitespaceFore(useSetting, fore) Set the foreground colour of all whitespace and whether to use this setting.
Editor:SetWhitespaceBack(useSetting, back) Set the background colour of all whitespace and whether to use this setting.
Editor.WhitespaceSize Set the size of the dots used to mark space characters.
Editor.TabDrawMode Set how tabs are drawn when visible.
Editor.ExtraAscent Set extra ascent for each line
Editor.ExtraDescent Set extra descent for each line

Cursor

Editor.Cursor Sets the cursor to one of the SC_CURSOR* values.

Mouse capture

Editor.MouseDownCaptures Set whether the mouse is captured when its button is pressed.
Editor.MouseWheelCaptures Set whether the mouse wheel can be active outside the window.

Line endings

Editor.EOLMode Set the current end of line mode.
Editor:ConvertEOLs(eolMode) Convert all line endings in the document to one mode.
Editor.ViewEOL Make the end of line characters visible or invisible.
Editor.LineEndTypesSupported read-only
Editor.LineEndTypesAllowed Set the line end types that the application wants to use.
Editor.LineEndTypesActive read-only

Words

Editor:WordEndPosition(pos, onlyWordCharacters) Get position of end of word.
Editor:WordStartPosition(pos, onlyWordCharacters) Get position of start of word.
Editor:IsRangeWord(start, end) Is the range start..end considered a word?
Editor.WordChars Set the set of characters making up words for when moving or selecting by word.
Editor.WhitespaceChars Set the set of characters making up whitespace for when moving or selecting by word.
Editor.PunctuationChars Set the set of characters making up punctuation characters Should be called after SetWordChars.
Editor:SetCharsDefault() Reset the set of characters for whitespace and word characters to the defaults.
Editor.CharacterCategoryOptimization Set the number of characters to have directly indexed categories

Styling

Editor.EndStyled read-only
Editor:StartStyling(start, unused) Set the current styling position to start.
Editor:SetStyling(length, style) Change style from current styling position for length characters to a style and move the current styling position to after this newly styled segment.
Editor:SetStylingEx(styles) Set the styles for a segment of the document.
Editor.IdleStyling Sets limits to idle styling.
Editor.LineState[line] Used to hold extra styling information for each line.
Editor.MaxLineState read-only

Style definition

Editor:StyleResetDefault() Reset the default style to its state at startup
Editor:StyleClearAll() Clear all the styles and make equivalent to the global default style.
Editor.StyleFont[style] Set the font of a style.
Editor.StyleSize[style] Set the size of characters of a style.
Editor.StyleSizeFractional[style] Set the size of characters of a style.
Editor.StyleBold[style] Set a style to be bold or not.
Editor.StyleWeight[style] Set the weight of characters of a style.
Editor.StyleItalic[style] Set a style to be italic or not.
Editor.StyleUnderline[style] Set a style to be underlined or not.
Editor.StyleFore[style] Set the foreground colour of a style.
Editor.StyleBack[style] Set the background colour of a style.
Editor.StyleEOLFilled[style] Set a style to have its end of line filled or not.
Editor.StyleCharacterSet[style] Set the character set of the font in a style.
Editor.StyleCase[style] Set a style to be mixed case, or to force upper or lower case.
Editor.StyleVisible[style] Set a style to be visible or not.
Editor.StyleChangeable[style] Set a style to be changeable or not (read only).
Editor.StyleHotSpot[style] Set a style to be a hotspot or not.

Caret, selection, and hotspot styles

Editor:SetSelFore(useSetting, fore) Set the foreground colour of the main and additional selections and whether to use this setting.
Editor:SetSelBack(useSetting, back) Set the background colour of the main and additional selections and whether to use this setting.
Editor.SelAlpha Set the alpha of the selection.
Editor.SelEOLFilled Set the selection to have its end of line filled or not.
Editor.CaretFore Set the foreground colour of the caret.
Editor.CaretLineVisible Display the background of the line containing the caret in a different colour.
Editor.CaretLineBack Set the colour of the background of the line containing the caret.
Editor.CaretLineBackAlpha Set background alpha of the caret line.
Editor.CaretLineFrame Display the caret line framed.
Editor.CaretLineVisibleAlways Sets the caret line to always visible.
Editor.CaretPeriod Get the time in milliseconds that the caret is on and off.
Editor.CaretStyle Set the style of the caret to be drawn.
Editor.CaretWidth Set the width of the insert mode caret.
Editor:SetHotspotActiveFore(useSetting, fore) Set a fore colour for active hotspots.
Editor:GetHotspotActiveFore() Get the fore colour for active hotspots.
Editor:SetHotspotActiveBack(useSetting, back) Set a back colour for active hotspots.
Editor:GetHotspotActiveBack() Get the back colour for active hotspots.
Editor.HotspotActiveUnderline Enable / Disable underlining active hotspots.
Editor.HotspotSingleLine Limit hotspots to single line so hotspots on two lines don't merge.
Editor.CaretSticky Stop the caret preferred x position changing when the user types.
Editor:ToggleCaretSticky() Switch between sticky and non-sticky: meant to be bound to a key.

Character representations

Editor.Representation[encodedCharacter] Set the way a character is drawn.
Editor:ClearRepresentation(encodedCharacter) Remove a character representation.
Editor.ControlCharSymbol Change the way control characters are displayed: If symbol is < 32, keep the drawn way, else, use the given character.

Margins

Editor.Margins Allocate a non-standard number of margins.
Editor.MarginTypeN[margin] Set a margin to be either numeric or symbolic.
Editor.MarginWidthN[margin] Set the width of a margin to a width expressed in pixels.
Editor.MarginMaskN[margin] Set a mask that determines which markers are displayed in a margin.
Editor.MarginSensitiveN[margin] Make a margin sensitive or insensitive to mouse clicks.
Editor.MarginCursorN[margin] Set the cursor shown when the mouse is inside a margin.
Editor.MarginBackN[margin] Set the background colour of a margin.
Editor.MarginLeft Sets the size in pixels of the left margin.
Editor.MarginRight Sets the size in pixels of the right margin.
Editor:SetFoldMarginColour(useSetting, back) Set one of the colours used as a chequerboard pattern in the fold margin
Editor:SetFoldMarginHiColour(useSetting, fore) Set the other colour used as a chequerboard pattern in the fold margin
Editor.MarginText[line] Set the text in the text margin for a line
Editor.MarginStyle[line] Set the style number for the text margin for a line
Editor.MarginStyles[line] Set the style in the text margin for a line
Editor:MarginTextClearAll() Clear the margin text on all lines
Editor.MarginStyleOffset Get the start of the range of style numbers used for margin text
Editor.MarginOptions Set the margin options.

Annotations

Editor.AnnotationText[line] Set the annotation text for a line
Editor.AnnotationStyle[line] Set the style number for the annotations for a line
Editor.AnnotationStyles[line] Set the annotation styles for a line
Editor.AnnotationLines[line] read-only
Editor:AnnotationClearAll() Clear the annotations from all lines
Editor.AnnotationVisible Set the visibility for the annotations for a view
Editor.AnnotationStyleOffset Get the start of the range of style numbers used for annotations

Other settings

Editor.BufferedDraw If drawing is buffered then each line of text is drawn into a bitmap buffer before drawing it to the screen to avoid flicker.
Editor.PhasesDraw In one phase draw, text is drawn in a series of rectangular blocks with no overlap.
Editor.Technology Set the technology used.
Editor.FontQuality Choose the quality level for text from the FontQuality enumeration.
Editor.CodePage Set the code page used to interpret the bytes of the document as characters.
Editor.IMEInteraction Choose to display the the IME in a winow or inline.
Editor.Bidirectional Set bidirectional text display state.
Editor:GrabFocus() Set the focus to this Scintilla widget.
Editor.Focus Change internal focus flag.

Brace highlighting

Editor:BraceHighlight(posA, posB) Highlight the characters at two positions.
Editor:BraceBadLight(pos) Highlight the character at a position indicating there is no matching brace.
Editor:BraceHighlightIndicator(useSetting, indicator) Use specified indicator to highlight matching braces instead of changing their style.
Editor:BraceBadLightIndicator(useSetting, indicator) Use specified indicator to highlight non matching brace instead of changing its style.
Editor:BraceMatch(pos, maxReStyle) Find the position of a matching brace or INVALID_POSITION if no match.

Tabs and Indentation Guides

Editor.TabWidth Change the visible size of a tab to be a multiple of the width of a space character.
Editor:ClearTabStops(line) Clear explicit tabstops on a line.
Editor:AddTabStop(line, x) Add an explicit tab stop for a line.
Editor:GetNextTabStop(line, x) Find the next explicit tab stop position on a line after a position.
Editor.UseTabs Indentation will only use space characters if useTabs is false, otherwise it will use a combination of tabs and spaces.
Editor.Indent Set the number of spaces used for one level of indentation.
Editor.TabIndents Sets whether a tab pressed when caret is within indentation indents.
Editor.BackSpaceUnIndents Sets whether a backspace pressed when caret is within indentation unindents.
Editor.LineIndentation[line] Change the indentation of a line to a number of columns.
Editor.LineIndentPosition[line] read-only
Editor.IndentationGuides Show or hide indentation guides.
Editor.HighlightGuide Set the highlighted indentation guide column.

Markers

Editor:MarkerDefine(markerNumber, markerSymbol) Set the symbol used for a particular marker number.
Editor:MarkerDefinePixmap(markerNumber, pixmap) Define a marker from a pixmap.
Editor.RGBAImageWidth Set the width for future RGBA image data.
Editor.RGBAImageHeight Set the height for future RGBA image data.
Editor.RGBAImageScale Set the scale factor in percent for future RGBA image data.
Editor:MarkerDefineRGBAImage(markerNumber, pixels) Define a marker from RGBA data.
Editor:MarkerSymbolDefined(markerNumber) Which symbol was defined for markerNumber with MarkerDefine
Editor.MarkerFore[markerNumber] Set the foreground colour used for a particular marker number.
Editor.MarkerBack[markerNumber] Set the background colour used for a particular marker number.
Editor.MarkerBackSelected[markerNumber] Set the background colour used for a particular marker number when its folding block is selected.
Editor:MarkerEnableHighlight(enabled) Enable/disable highlight for current folding bloc (smallest one that contains the caret)
Editor.MarkerAlpha[markerNumber] Set the alpha used for a marker that is drawn in the text area, not the margin.
Editor:MarkerAdd(line, markerNumber) Add a marker to a line, returning an ID which can be used to find or delete the marker.
Editor:MarkerAddSet(line, markerSet) Add a set of markers to a line.
Editor:MarkerDelete(line, markerNumber) Delete a marker from a line.
Editor:MarkerDeleteAll(markerNumber) Delete all markers with a particular number from all lines.
Editor:MarkerGet(line) Get a bit mask of all the markers set on a line.
Editor:MarkerNext(lineStart, markerMask) Find the next line at or after lineStart that includes a marker in mask.
Editor:MarkerPrevious(lineStart, markerMask) Find the previous line before lineStart that includes a marker in mask.
Editor:MarkerLineFromHandle(markerHandle) Retrieve the line number at which a particular marker is located.
Editor:MarkerDeleteHandle(markerHandle) Delete a marker.

Indicators

Editor.IndicStyle[indicator] Set an indicator to plain, squiggle or TT.
Editor.IndicFore[indicator] Set the foreground colour of an indicator.
Editor.IndicAlpha[indicator] Set the alpha fill colour of the given indicator.
Editor.IndicOutlineAlpha[indicator] Set the alpha outline colour of the given indicator.
Editor.IndicUnder[indicator] Set an indicator to draw under text or over(default).
Editor.IndicHoverStyle[indicator] Set a hover indicator to plain, squiggle or TT.
Editor.IndicHoverFore[indicator] Set the foreground hover colour of an indicator.
Editor.IndicFlags[indicator] Set the attributes of an indicator.
Editor.IndicatorCurrent Set the indicator used for IndicatorFillRange and IndicatorClearRange
Editor.IndicatorValue Set the value used for IndicatorFillRange
Editor:IndicatorFillRange(start, lengthFill) Turn a indicator on over a range.
Editor:IndicatorClearRange(start, lengthClear) Turn a indicator off over a range.
Editor:IndicatorAllOnFor(pos) Are any indicators present at pos?
Editor:IndicatorValueAt(indicator, pos) What value does a particular indicator have at a position?
Editor:IndicatorStart(indicator, pos) Where does a particular indicator start?
Editor:IndicatorEnd(indicator, pos) Where does a particular indicator end?
Editor:FindIndicatorShow(start, end) On OS X, show a find indicator.
Editor:FindIndicatorFlash(start, end) On OS X, flash a find indicator, then fade out.
Editor:FindIndicatorHide() On OS X, hide the find indicator.

Autocompletion

Editor:AutoCShow(lengthEntered, itemList) Display a auto-completion list.
Editor:AutoCCancel() Remove the auto-completion list from the screen.
Editor:AutoCActive() Is there an auto-completion list visible?
Editor:AutoCPosStart() Retrieve the position of the caret when the auto-completion list was displayed.
Editor:AutoCComplete() User has selected an item so remove the list and insert the selection.
Editor:AutoCStops(characterSet) Define a set of character that when typed cancel the auto-completion list.
Editor.AutoCSeparator Change the separator character in the string setting up an auto-completion list.
Editor:AutoCSelect(select) Select the item in the auto-completion list that starts with a string.
Editor.AutoCCurrent read-only
Editor.AutoCCurrentText read-only
Editor.AutoCCancelAtStart Should the auto-completion list be cancelled if the user backspaces to a position before where the box was created.
Editor.AutoCFillUps Define a set of characters that when typed will cause the autocompletion to choose the selected item.
Editor.AutoCChooseSingle Should a single item auto-completion list automatically choose the item.
Editor.AutoCIgnoreCase Set whether case is significant when performing auto-completion searches.
Editor.AutoCCaseInsensitiveBehaviour Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference.
Editor.AutoCMulti Change the effect of autocompleting when there are multiple selections.
Editor.AutoCOrder Set the way autocompletion lists are ordered.
Editor.AutoCAutoHide Set whether or not autocompletion is hidden automatically when nothing matches.
Editor.AutoCDropRestOfWord Set whether or not autocompletion deletes any word characters after the inserted text upon completion.
Editor:RegisterImage(type, xpmData) Register an XPM image for use in autocompletion lists.
Editor:RegisterRGBAImage(type, pixels) Register an RGBA image for use in autocompletion lists.
Editor:ClearRegisteredImages() Clear all the registered XPM images.
Editor.AutoCTypeSeparator Change the type-separator character in the string setting up an auto-completion list.
Editor.AutoCMaxHeight Set the maximum height, in rows, of auto-completion and user lists.
Editor.AutoCMaxWidth Set the maximum width, in characters, of auto-completion and user lists.

User lists

Editor:UserListShow(listType, itemList) Display a list of strings and send notification when user chooses one.

Call tips

Editor:CallTipShow(pos, definition) Show a call tip containing a definition near position pos.
Editor:CallTipCancel() Remove the call tip from the screen.
Editor:CallTipActive() Is there an active call tip?
Editor:CallTipPosStart() Retrieve the position where the caret was before displaying the call tip.
Editor.CallTipPosStart Set the start position in order to change when backspacing removes the calltip.
Editor:CallTipSetHlt(highlightStart, highlightEnd) Highlight a segment of the definition.
Editor.CallTipBack Set the background colour for the call tip.
Editor.CallTipFore Set the foreground colour for the call tip.
Editor.CallTipForeHlt Set the foreground colour for the highlighted part of the call tip.
Editor.CallTipUseStyle Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
Editor.CallTipPosition Set position of calltip, above or below text.

Key bindings

Editor:AssignCmdKey(keycode, modifiers, sciCommand) When key+modifier combination keyDefinition is pressed perform sciCommand.
Editor:ClearCmdKey(keycode, modifiers) When key+modifier combination keyDefinition is pressed do nothing.
Editor:ClearAllCmdKeys() Drop all key mappings.
Editor:Null() Null operation.

Keyboard Commands

Editor:LineDown() Move caret down one line.
Editor:LineDownExtend() Move caret down one line extending selection to new caret position.
Editor:LineDownRectExtend() Move caret down one line, extending rectangular selection to new caret position.
Editor:LineScrollDown() Scroll the document down, keeping the caret visible.
Editor:LineUp() Move caret up one line.
Editor:LineUpExtend() Move caret up one line extending selection to new caret position.
Editor:LineUpRectExtend() Move caret up one line, extending rectangular selection to new caret position.
Editor:LineScrollUp() Scroll the document up, keeping the caret visible.
Editor:ParaDown() Move caret between paragraphs (delimited by empty lines).
Editor:ParaDownExtend() Move caret between paragraphs (delimited by empty lines).
Editor:ParaUp() Move caret between paragraphs (delimited by empty lines).
Editor:ParaUpExtend() Move caret between paragraphs (delimited by empty lines).
Editor:CharLeft() Move caret left one character.
Editor:CharLeftExtend() Move caret left one character extending selection to new caret position.
Editor:CharLeftRectExtend() Move caret left one character, extending rectangular selection to new caret position.
Editor:CharRight() Move caret right one character.
Editor:CharRightExtend() Move caret right one character extending selection to new caret position.
Editor:CharRightRectExtend() Move caret right one character, extending rectangular selection to new caret position.
Editor:WordLeft() Move caret left one word.
Editor:WordLeftExtend() Move caret left one word extending selection to new caret position.
Editor:WordRight() Move caret right one word.
Editor:WordRightExtend() Move caret right one word extending selection to new caret position.
Editor:WordLeftEnd() Move caret left one word, position cursor at end of word.
Editor:WordLeftEndExtend() Move caret left one word, position cursor at end of word, extending selection to new caret position.
Editor:WordRightEnd() Move caret right one word, position cursor at end of word.
Editor:WordRightEndExtend() Move caret right one word, position cursor at end of word, extending selection to new caret position.
Editor:WordPartLeft() Move to the previous change in capitalization.
Editor:WordPartLeftExtend() Move to the previous change in capitalization extending selection to new caret position.
Editor:WordPartRight() Move to the change next in capitalization.
Editor:WordPartRightExtend() Move to the next change in capitalization extending selection to new caret position.
Editor:Home() Move caret to first position on line.
Editor:HomeExtend() Move caret to first position on line extending selection to new caret position.
Editor:HomeRectExtend() Move caret to first position on line, extending rectangular selection to new caret position.
Editor:HomeDisplay() Move caret to first position on display line.
Editor:HomeDisplayExtend() Move caret to first position on display line extending selection to new caret position.
Editor:HomeWrap() Similarly Home when word-wrap is enabled.
Editor:HomeWrapExtend() Similarly HomeExtend when word-wrap is enabled.
Editor:VCHome() Move caret to before first visible character on line.
Editor:VCHomeExtend() Like VCHome but extending selection to new caret position.
Editor:VCHomeRectExtend() Move caret to before first visible character on line.
Editor:VCHomeWrap()
Editor:VCHomeWrapExtend()
Editor:VCHomeDisplay()
Editor:VCHomeDisplayExtend()
Editor:LineEnd() Move caret to last position on line.
Editor:LineEndExtend() Move caret to last position on line extending selection to new caret position.
Editor:LineEndRectExtend() Move caret to last position on line, extending rectangular selection to new caret position.
Editor:LineEndDisplay() Move caret to last position on display line.
Editor:LineEndDisplayExtend() Move caret to last position on display line extending selection to new caret position.
Editor:LineEndWrap() Similarly LineEnd when word-wrap is enabled.
Editor:LineEndWrapExtend() Similarly LineEndExtend when word-wrap is enabled.
Editor:DocumentStart() Move caret to first position in document.
Editor:DocumentStartExtend() Move caret to first position in document extending selection to new caret position.
Editor:DocumentEnd() Move caret to last position in document.
Editor:DocumentEndExtend() Move caret to last position in document extending selection to new caret position.
Editor:PageUp() Move caret one page up.
Editor:PageUpExtend() Move caret one page up extending selection to new caret position.
Editor:PageUpRectExtend() Move caret one page up, extending rectangular selection to new caret position.
Editor:PageDown() Move caret one page down.
Editor:PageDownExtend() Move caret one page down extending selection to new caret position.
Editor:PageDownRectExtend() Move caret one page down, extending rectangular selection to new caret position.
Editor:StutteredPageUp() Move caret to top of page, or one page up if already at top of page.
Editor:StutteredPageUpExtend() Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.
Editor:StutteredPageDown() Move caret to bottom of page, or one page down if already at bottom of page.
Editor:StutteredPageDownExtend() Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.
Editor:DeleteBack() Delete the selection or if no selection, the character before the caret.
Editor:DeleteBackNotLine() Delete the selection or if no selection, the character before the caret.
Editor:DelWordLeft() Delete the word to the left of the caret.
Editor:DelWordRight() Delete the word to the right of the caret.
Editor:DelWordRightEnd() Delete the word to the right of the caret, but not the trailing non-word characters.
Editor:DelLineLeft() Delete back from the current position to the start of the line.
Editor:DelLineRight() Delete forwards from the current position to the end of the line.
Editor:LineDelete() Delete the line containing the caret.
Editor:LineCut() Cut the line containing the caret.
Editor:LineCopy() Copy the line containing the caret.
Editor:LineTranspose() Switch the current line with the previous.
Editor:LineDuplicate() Duplicate the current line.
Editor:LowerCase() Transform the selection to lower case.
Editor:UpperCase() Transform the selection to upper case.
Editor:Cancel() Cancel any modes such as call tip or auto-completion list display.
Editor:EditToggleOvertype() Switch from insert to overtype mode or the reverse.
Editor:NewLine() Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
Editor:FormFeed() Insert a Form Feed character.
Editor:Tab() If selection is empty or all on one line replace the selection with a tab character.
Editor:BackTab() Dedent the selected lines.
Editor:SelectionDuplicate() Duplicates the current selection.
Editor:VerticalCentreCaret() Scroll the document so that the caret is in the center of the screen.
Editor:MoveSelectedLinesUp() Move the selected lines up one line, shifting the line above after the selection.
Editor:MoveSelectedLinesDown() Move the selected lines down one line, shifting the line below before the selection.
Editor:ScrollToStart() Scroll the document to the start without changing the selection.
Editor:ScrollToEnd() Scroll the document to the end without changing the selection.

Popup edit menu

Editor:UsePopUp(popUpMode) Set whether a pop up menu is displayed automatically when the user presses the wrong mouse button on certain areas.

Macro recording

Editor:StartRecord() Start notifying the container of all key presses and commands.
Editor:StopRecord() Stop notifying the container of all key presses and commands.

Printing

Editor.PrintMagnification Sets the print magnification added to the point size of each style for printing.
Editor.PrintColourMode Modify colours when printing for clearer printed text.
Editor.PrintWrapMode Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE).

Direct access

Editor.DirectFunction read-only
Editor.DirectPointer read-only
Editor.CharacterPointer read-only
Editor:GetRangePointer(start, lengthRange) Return a read-only pointer to a range of characters in the document.
Editor.GapPosition read-only

Multiple views

Editor.DocPointer Change the document object used.
Editor:CreateDocument(bytes, documentOptions) Create a new document object.
Editor:AddRefDocument(doc) Extend life of document.
Editor:ReleaseDocument(doc) Release a reference to the document, deleting document if it fades to black.
Editor.DocumentOptions read-only

Background loading and saving

Editor:CreateLoader(bytes, documentOptions) Create an ILoader*.

Folding

Editor:VisibleFromDocLine(docLine) Find the display line of a document line taking hidden lines into account.
Editor:DocLineFromVisible(displayLine) Find the document line of a display line taking hidden lines into account.
Editor:ShowLines(lineStart, lineEnd) Make a range of lines visible.
Editor:HideLines(lineStart, lineEnd) Make a range of lines invisible.
Editor.LineVisible[line] read-only
Editor.AllLinesVisible read-only
Editor.FoldLevel[line] Set the fold level of a line.
Editor.FoldFlags Set some style options for folding.
Editor:GetLastChild(line, level) Find the last child line of a header line.
Editor.FoldParent[line] read-only
Editor:ToggleFold(line) Switch a header line between expanded and contracted.
Editor:ToggleFoldShowText(line, text) Switch a header line between expanded and contracted and show some text after the line.
Editor.FoldDisplayTextStyle Set the style of fold display text.
Editor:SetDefaultFoldDisplayText(text) Set the default fold display text.
Editor:GetDefaultFoldDisplayText() Get the default fold display text.
Editor.FoldExpanded[line] Show the children of a header line.
Editor:FoldLine(line, action) Expand or contract a fold header.
Editor:FoldChildren(line, action) Expand or contract a fold header and its children.
Editor:FoldAll(action) Expand or contract all fold headers.
Editor:ExpandChildren(line, level) Expand a fold header and all children.
Editor.AutomaticFold Set automatic folding behaviours.
Editor:ContractedFoldNext(lineStart) Find the next line at or after lineStart that is a contracted fold header line.
Editor:EnsureVisible(line) Ensure a particular line is visible by expanding any header line hiding it.
Editor:EnsureVisibleEnforcePolicy(line) Ensure a particular line is visible by expanding any header line hiding it.

Line wrapping

Editor.WrapMode Sets whether text is word wrapped.
Editor.WrapVisualFlags Set the display mode of visual flags for wrapped lines.
Editor.WrapVisualFlagsLocation Set the location of visual flags for wrapped lines.
Editor.WrapIndentMode Sets how wrapped sublines are placed.
Editor.WrapStartIndent Set the start indent for wrapped lines.
Editor.LayoutCache Sets the degree of caching of layout information.
Editor.PositionCache Set number of entries in position cache
Editor:LinesSplit(pixelWidth) Split the lines in the target into lines that are less wide than pixelWidth where possible.
Editor:LinesJoin() Join the lines in the target.
Editor:WrapCount(docLine) The number of display lines needed to wrap a document line

Zooming

Editor:ZoomIn() Magnify the displayed text by increasing the sizes by 1 point.
Editor:ZoomOut() Make the displayed text smaller by decreasing the sizes by 1 point.
Editor.Zoom Set the zoom level.

Long lines

Editor.EdgeMode The edge may be displayed by a line (EDGE_LINE/EDGE_MULTILINE) or by highlighting text that goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
Editor.EdgeColumn Set the column number of the edge.
Editor.EdgeColour Change the colour used in edge indication.
Editor:MultiEdgeAddLine(column, edgeColour) Add a new vertical edge to the view.
Editor:MultiEdgeClearAll() Clear all vertical edges.

Accessibility

Editor.Accessibility Enable or disable accessibility.

Lexer

Editor.Lexer Set the lexing language of the document.
Editor.LexerLanguage Set the lexing language of the document based on string name.
Editor:LoadLexerLibrary(path) Load a lexer library (dll / so).
Editor:Colourise(start, end) Colourise a segment of the document using the current lexing language.
Editor:ChangeLexerState(start, end) Indicate that the internal state of a lexer has changed over a range and therefore there may be a need to redraw.
Editor:PropertyNames() Retrieve a '\n' separated list of properties understood by the current lexer.
Editor:PropertyType(name) Retrieve the type of a property.
Editor:DescribeProperty(name) Describe a property.
Editor.Property[key] Set up a value that may be used by a lexer for some optional feature.
Editor.PropertyExpanded[key] read-only
Editor:GetPropertyInt(key, defaultValue) Retrieve a "property" value previously set with SetProperty, interpreted as an int AFTER any "$()" variable replacement.
Editor.KeyWords[keyWordSet] Set up the key words used by the lexer.
Editor:DescribeKeyWordSets() Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer.
Editor.SubStyleBases read-only
Editor.DistanceToSecondaryStyles read-only
Editor:AllocateSubStyles(styleBase, numberStyles) Allocate a set of sub styles for a particular base style, returning start of range
Editor:FreeSubStyles() Free allocated sub styles
Editor.SubStylesStart[styleBase] read-only
Editor.SubStylesLength[styleBase] read-only
Editor.StyleFromSubStyle[subStyle] read-only
Editor.PrimaryStyleFromStyle[style] read-only
Editor.Identifiers[style] Set the identifiers that are shown in a particular style
Editor:PrivateLexerCall(operation, pointer) For private communication between an application and a known lexer.
Editor.NamedStyles read-only
Editor:NameOfStyle(style) Retrieve the name of a style.
Editor:TagsOfStyle(style) Retrieve a ' ' separated list of style tags like "literal quoted string".
Editor:DescriptionOfStyle(style) Retrieve a description of a style.

Notifications

Editor.Identifier Set the identifier reported as idFrom in notification messages.
Editor.ModEventMask Set which document modification events are sent to the container.
Editor.CommandEvents Set whether command events are sent to the container.
Editor.MouseDwellTime Sets the time the mouse must sit still to generate a mouse dwell event.


Helper Methods

Editor:textrange(startPos, endPos)
Gets the text within a range.

Parameters:

  • startPos int
  • endPos int

Returns:

    string
Editor:findtext(search[, flags[, startPos[, endPos]]])
Finds the next match within the document. See the Scintilla Documentation for the search flags.

Parameters:

  • search string string
  • flags int either 0 or a combination of SCFIND constants (optional)
  • startPos int start of the range to search (optional)
  • endPos int end of the range to search (optional)

Returns:

    the start and end of the first match, or nil if no match
Editor:match(search[, flags[, startPos]])
Creates a generator to iterate matches. See the Scintilla Documentation for the search flags.

Parameters:

  • search string string
  • flags int either 0 or a combination of SCFIND constants (optional)
  • startPos int start of the range to search (optional)

Returns:

    Match match object generator

See also:

Usage:

    for m in editor:match(text, flags) do
        ...
    end
Editor:append(text)
Appends text to the end of the document.

Parameters:

  • text string
Editor:remove(startPos, endPos)
Removes the text in the range.

Parameters:

  • startPos int
  • endPos int
Editor:set(direction)
Sets the text direction.

Parameters:

  • direction string either "RTL" or "LTR"

Text retrieval and modification

Editor:GetText()
Retrieve all the text in the document. Returns number of characters retrieved. Result is NUL-terminated.

Returns:

    string

See also:

Editor:SetText(text)
Replace the contents of the document with the argument text.

Parameters:

  • text string

See also:

Editor:SetSavePoint()
Remember the current position in the undo history as the position at which the document was saved.

See also:

Editor:GetLine(line)
Retrieve the contents of a line. Returns the length of the line.

Parameters:

  • line int

Returns:

    string

See also:

Editor:ReplaceSel(text)
Replace the selected text with the argument text.

Parameters:

  • text string

See also:

Editor.ReadOnly
Set to read only or read write.
  • ReadOnly bool

See also:

Editor:Allocate(bytes)
Enlarge the document to a particular size of text bytes.

Parameters:

  • bytes int

See also:

Editor:AddText(text)
Add text to the document at current position.

Parameters:

  • text string

See also:

Editor:AppendText(text)
Append a string to the end of the document without changing the selection.

Parameters:

  • text string

See also:

Editor:InsertText(pos, text)
Insert string at a position.

Parameters:

  • pos position
  • text string

See also:

Editor:ChangeInsertion(text)
Change the text that is being inserted in response to SC_MOD_INSERTCHECK

Parameters:

  • text string

See also:

Editor:ClearAll()
Delete all text in the document.

See also:

Editor:DeleteRange(start, lengthDelete)
Delete a range of text in the document.

Parameters:

  • start position
  • lengthDelete int

See also:

Editor:ClearDocumentStyle()
Set all style bytes to 0, remove all folding information.

See also:

Editor.CharAt[pos]
read-only
  • pos position

See also:

Editor.StyleAt[pos]
read-only
  • pos position

See also:

Editor:ReleaseAllExtendedStyles()
Release all extended (>255) style numbers

See also:

Editor:AllocateExtendedStyles(numberStyles)
Allocate some extended (>255) style numbers and return the start of the range

Parameters:

  • numberStyles int

Returns:

    int

See also:

Editor:TargetAsUTF8()
Returns the target converted to UTF8. Return the length in bytes.

Returns:

    string

See also:

Editor:EncodedFromUTF8(utf8)
Translates a UTF8 string into the document encoding. Return the length of the result in bytes. On error return 0.

Parameters:

  • utf8 string

Returns:

    string

See also:

Editor:SetLengthForEncode(bytes)
Set the length of the utf8 argument for calling EncodedFromUTF8. Set to -1 and the string will be measured to the first nul.

Parameters:

  • bytes int

See also:

Searching

Editor.TargetStart
Sets the position that starts the target which is used for updating the document without affecting the scroll position.
  • TargetStart position

See also:

Editor.TargetEnd
Sets the position that ends the target which is used for updating the document without affecting the scroll position.
  • TargetEnd position

See also:

Editor:SetTargetRange(start, end)
Sets both the start and end of the target in one call.

Parameters:

  • start position
  • end position

See also:

Editor:TargetFromSelection()
Make the target range start and end be the same as the selection range start and end.

See also:

Editor:TargetWholeDocument()
Sets the target to the whole document.

See also:

Editor.SearchFlags
Set the search flags used by SearchInTarget.
  • SearchFlags int

See also:

Editor:SearchInTarget(text)
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.

Parameters:

  • text string

Returns:

    int

See also:

Editor.TargetText
read-only
  • TargetText string

See also:

Editor:ReplaceTarget(text)
Replace the target text with the argument text. Text is counted so it can contain NULs. Returns the length of the replacement text.

Parameters:

  • text string

Returns:

    int

See also:

Editor:ReplaceTargetRE(text)
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.

Parameters:

  • text string

Returns:

    int

See also:

Editor.Tag[tagNumber]
read-only
  • tagNumber int

See also:

Editor:SearchAnchor()
Sets the current caret position to be the search anchor.

See also:

Editor:SearchNext(searchFlags, text)
Find some text starting at the search anchor. Does not ensure the selection is visible.

Parameters:

  • searchFlags int
  • text string

Returns:

    int

See also:

Editor:SearchPrev(searchFlags, text)
Find some text starting at the search anchor and moving backwards. Does not ensure the selection is visible.

Parameters:

  • searchFlags int
  • text string

Returns:

    int

See also:

Overtype

Editor.Overtype
Set to overtype (true) or insert mode.
  • Overtype bool

See also:

Cut, copy and paste

Editor:Cut()
Cut the selection to the clipboard.

See also:

Editor:Copy()
Copy the selection to the clipboard.

See also:

Editor:Paste()
Paste the contents of the clipboard into the document replacing the selection.

See also:

Editor:Clear()
Clear the selection.

See also:

Editor:CanPaste()
Will a paste succeed?

Returns:

    bool

See also:

Editor:CopyAllowLine()
Copy the selection, if selection empty copy the line with the caret

See also:

Editor:CopyRange(start, end)
Copy a range of text to the clipboard. Positions are clipped into the document.

Parameters:

  • start position
  • end position

See also:

Editor:CopyText(text)
Copy argument text to the clipboard.

Parameters:

  • text string

See also:

Editor.PasteConvertEndings
Enable/Disable convert-on-paste for line endings
  • PasteConvertEndings bool

See also:

Error handling

Editor.Status
Change error status - 0 = OK.
  • Status int

See also:

Undo and Redo

Editor:Undo()
Undo one action in the undo history.

See also:

Editor:CanUndo()
Are there any undoable actions in the undo history?

Returns:

    bool

See also:

Editor:Redo()
Redoes the next action on the undo history.

See also:

Editor:CanRedo()
Are there any redoable actions in the undo history?

Returns:

    bool

See also:

Editor:EmptyUndoBuffer()
Delete the undo history.

See also:

Editor.UndoCollection
Choose between collecting actions into the undo history and discarding them.
  • UndoCollection bool

See also:

Editor:BeginUndoAction()
Start a sequence of actions that is undone and redone as a unit. May be nested.

See also:

Editor:EndUndoAction()
End a sequence of actions that is undone and redone as a unit.

See also:

Editor:AddUndoAction(token, flags)
Add a container action to the undo stack

Parameters:

  • token int
  • flags int

See also:

Selection and information

Editor.TextLength
read-only
  • TextLength int

See also:

Editor.Length
read-only
  • Length int

See also:

Editor.LineCount
read-only
  • LineCount int

See also:

Editor.LinesOnScreen
read-only
  • LinesOnScreen int

See also:

Editor.Modify
read-only
  • Modify bool

See also:

Editor:SetSel(anchor, caret)
Select a range of text.

Parameters:

  • anchor position
  • caret position

See also:

Editor:GotoPos(caret)
Set caret to a position and ensure it is visible.

Parameters:

  • caret position

See also:

Editor:GotoLine(line)
Set caret to start of a line and ensure it is visible.

Parameters:

  • line int

See also:

Editor.CurrentPos
Sets the position of the caret.
  • CurrentPos position

See also:

Editor.Anchor
Set the selection anchor to a position. The anchor is the opposite end of the selection from the caret.
  • Anchor position

See also:

Editor.SelectionStart
Sets the position that starts the selection - this becomes the anchor.
  • SelectionStart position

See also:

Editor.SelectionEnd
Sets the position that ends the selection - this becomes the caret.
  • SelectionEnd position

See also:

Editor:SetEmptySelection(caret)
Set caret to a position, while removing any existing selection.

Parameters:

  • caret position

See also:

Editor:SelectAll()
Select all the text in the document.

See also:

Editor:LineFromPosition(pos)
Retrieve the line containing a position.

Parameters:

  • pos position

Returns:

    int

See also:

Editor:PositionFromLine(line)
Retrieve the position at the start of a line.

Parameters:

  • line int

Returns:

    position

See also:

Editor.LineEndPosition[line]
read-only
  • line int

See also:

Editor:LineLength(line)
How many characters are on a line, including end of line characters?

Parameters:

  • line int

Returns:

    int

See also:

Editor:GetSelText()
Retrieve the selected text. Return the length of the text. Result is NUL-terminated.

Returns:

    string

See also:

Editor:GetCurLine()
Retrieve the text of the line containing the caret. Returns the index of the caret on the line. Result is NUL-terminated.

Returns:

    string

See also:

Editor.SelectionIsRectangle
read-only
  • SelectionIsRectangle bool

See also:

Editor.SelectionMode
Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or by lines (SC_SEL_LINES).
  • SelectionMode int

See also:

Editor.MoveExtendsSelection
read-only
  • MoveExtendsSelection bool

See also:

Editor:GetLineSelStartPosition(line)
Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line).

Parameters:

  • line int

Returns:

    position

See also:

Editor:GetLineSelEndPosition(line)
Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line).

Parameters:

  • line int

Returns:

    position

See also:

Editor:MoveCaretInsideView()
Move the caret inside current view if it's not there already.

See also:

Editor:PositionBefore(pos)
Given a valid document position, return the previous position taking code page into account. Returns 0 if passed 0.

Parameters:

  • pos position

Returns:

    position

See also:

Editor:PositionAfter(pos)
Given a valid document position, return the next position taking code page into account. Maximum value returned is the last position in the document.

Parameters:

  • pos position

Returns:

    position

See also:

Editor:TextWidth(style, text)
Measure the pixel width of some text in a particular style. NUL terminated text argument. Does not handle tab or control characters.

Parameters:

  • style int
  • text string

Returns:

    int

See also:

Editor:TextHeight(line)
Retrieve the height of a particular line of text in pixels.

Parameters:

  • line int

Returns:

    int

See also:

Editor.Column[pos]
read-only
  • pos position

See also:

Editor:FindColumn(line, column)
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.

Parameters:

  • line int
  • column int

Returns:

    int

See also:

Editor:PositionFromPoint(x, y)
Find the position from a point within the window.

Parameters:

  • x int
  • y int

Returns:

    position

See also:

Editor:PositionFromPointClose(x, y)
Find the position from a point within the window but return INVALID_POSITION if not close to text.

Parameters:

  • x int
  • y int

Returns:

    position

See also:

Editor:CharPositionFromPoint(x, y)
Find the position of a character from a point within the window.

Parameters:

  • x int
  • y int

Returns:

    position

See also:

Editor:CharPositionFromPointClose(x, y)
Find the position of a character from a point within the window. Return INVALID_POSITION if not close to text.

Parameters:

  • x int
  • y int

Returns:

    position

See also:

Editor:PointXFromPosition(pos)
Retrieve the x value of the point in the window where a position is displayed.

Parameters:

  • pos position

Returns:

    int

See also:

Editor:PointYFromPosition(pos)
Retrieve the y value of the point in the window where a position is displayed.

Parameters:

  • pos position

Returns:

    int

See also:

Editor:HideSelection(hide)
Draw the selection either highlighted or in normal (non-highlighted) style.

Parameters:

  • hide bool

See also:

Editor:ChooseCaretX()
Set the last x chosen value to be the caret x position.

See also:

Editor:MoveSelectedLinesUp()
Move the selected lines up one line, shifting the line above after the selection

See also:

Editor:MoveSelectedLinesDown()
Move the selected lines down one line, shifting the line below before the selection

See also:

Editor.MouseSelectionRectangularSwitch
Set whether switching to rectangular mode while selecting with the mouse is allowed.
  • MouseSelectionRectangularSwitch bool

See also:

By character or UTF-16 code unit

Editor:PositionRelative(pos, relative)
Given a valid document position, return a position that differs in a number of characters. Returned value is always between 0 and last position in document.

Parameters:

  • pos position
  • relative int

Returns:

    position

See also:

Editor:CountCharacters(start, end)
Count characters between two positions.

Parameters:

  • start position
  • end position

Returns:

    int

See also:

Editor:PositionRelativeCodeUnits(pos, relative)
Given a valid document position, return a position that differs in a number of UTF-16 code units. Returned value is always between 0 and last position in document. The result may point half way (2 bytes) inside a non-BMP character.

Parameters:

  • pos position
  • relative int

Returns:

    position

See also:

Editor:CountCodeUnits(start, end)
Count code units between two positions.

Parameters:

  • start position
  • end position

Returns:

    int

See also:

Editor.LineCharacterIndex
read-only
  • LineCharacterIndex int

See also:

Editor:AllocateLineCharacterIndex(lineCharacterIndex)
Request line character index be created or its use count increased.

Parameters:

  • lineCharacterIndex int

See also:

Editor:ReleaseLineCharacterIndex(lineCharacterIndex)
Decrease use count of line character index and remove if 0.

Parameters:

  • lineCharacterIndex int

See also:

Editor:LineFromIndexPosition(pos, lineCharacterIndex)
Retrieve the document line containing a position measured in index units.

Parameters:

  • pos position
  • lineCharacterIndex int

Returns:

    int

See also:

Editor:IndexPositionFromLine(line, lineCharacterIndex)
Retrieve the position measured in index units at the start of a document line.

Parameters:

  • line int
  • lineCharacterIndex int

Returns:

    position

See also:

Multiple Selection and Virtual Space

Editor.MultipleSelection
Set whether multiple selections can be made
  • MultipleSelection bool

See also:

Editor.AdditionalSelectionTyping
Set whether typing can be performed into multiple selections
  • AdditionalSelectionTyping bool

See also:

Editor.MultiPaste
Change the effect of pasting when there are multiple selections.
  • MultiPaste int

See also:

Editor.VirtualSpaceOptions
Set options for virtual space behaviour.
  • VirtualSpaceOptions int

See also:

Editor.RectangularSelectionModifier
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.
  • RectangularSelectionModifier int

See also:

Editor.Selections
read-only
  • Selections int

See also:

Editor.SelectionEmpty
read-only
  • SelectionEmpty bool

See also:

Editor:ClearSelections()
Clear selections to a single empty stream selection

See also:

Editor:SetSelection(caret, anchor)
Set a simple selection

Parameters:

  • caret position
  • anchor position

See also:

Editor:AddSelection(caret, anchor)
Add a selection

Parameters:

  • caret position
  • anchor position

See also:

Editor:DropSelectionN(selection)
Drop one selection

Parameters:

  • selection int

See also:

Editor.MainSelection
Set the main selection
  • MainSelection int

See also:

Editor.SelectionNCaret[selection]
Set the caret position of the nth selection.
  • selection int

See also:

Editor.SelectionNCaretVirtualSpace[selection]
Set the virtual space of the caret of the nth selection.
  • selection int

See also:

Editor.SelectionNAnchor[selection]
Set the anchor position of the nth selection.
  • selection int

See also:

Editor.SelectionNAnchorVirtualSpace[selection]
Set the virtual space of the anchor of the nth selection.
  • selection int

See also:

Editor.SelectionNStart[selection]
Sets the position that starts the selection - this becomes the anchor.
  • selection int

See also:

Editor.SelectionNEnd[selection]
Sets the position that ends the selection - this becomes the currentPosition.
  • selection int

See also:

Editor.RectangularSelectionCaret
Set the caret position of the rectangular selection.
  • RectangularSelectionCaret position

See also:

Editor.RectangularSelectionCaretVirtualSpace
Set the virtual space of the caret of the rectangular selection.
  • RectangularSelectionCaretVirtualSpace int

See also:

Editor.RectangularSelectionAnchor
Set the anchor position of the rectangular selection.
  • RectangularSelectionAnchor position

See also:

Editor.RectangularSelectionAnchorVirtualSpace
Set the virtual space of the anchor of the rectangular selection.
  • RectangularSelectionAnchorVirtualSpace int

See also:

Editor.AdditionalSelAlpha
Set the alpha of the selection.
  • AdditionalSelAlpha int

See also:

Editor.AdditionalSelFore
Set the foreground colour of additional selections. Must have previously called SetSelFore with non-zero first argument for this to have an effect.
  • AdditionalSelFore colour

See also:

Editor.AdditionalSelBack
Set the background colour of additional selections. Must have previously called SetSelBack with non-zero first argument for this to have an effect.
  • AdditionalSelBack colour

See also:

Editor.AdditionalCaretFore
Set the foreground colour of additional carets.
  • AdditionalCaretFore colour

See also:

Editor.AdditionalCaretsBlink
Set whether additional carets will blink
  • AdditionalCaretsBlink bool

See also:

Editor.AdditionalCaretsVisible
Set whether additional carets are visible
  • AdditionalCaretsVisible bool

See also:

Editor:SwapMainAnchorCaret()
Swap that caret and anchor of the main selection.

See also:

Editor:RotateSelection()
Set the main selection to the next selection.

See also:

Editor:MultipleSelectAddNext()
Add the next occurrence of the main selection to the set of selections as main. If the current selection is empty then select word around caret.

See also:

Editor:MultipleSelectAddEach()
Add each occurrence of the main selection in the target to the set of selections. If the current selection is empty then select word around caret.

See also:

Scrolling and automatic scrolling

Editor.FirstVisibleLine
Scroll so that a display line is at the top of the display.
  • FirstVisibleLine int

See also:

Editor.XOffset
Set the xOffset (ie, horizontal scroll position).
  • XOffset int

See also:

Editor:LineScroll(columns, lines)
Scroll horizontally and vertically.

Parameters:

  • columns int
  • lines int

See also:

Editor:ScrollCaret()
Ensure the caret is visible.

See also:

Editor:ScrollRange(secondary, primary)
Scroll the argument positions and the range between them into view giving priority to the primary position then the secondary position. This may be used to make a search match visible.

Parameters:

  • secondary position
  • primary position

See also:

Editor:SetXCaretPolicy(caretPolicy, caretSlop)
Set the way the caret is kept visible when going sideways. The exclusion zone is given in pixels.

Parameters:

  • caretPolicy int
  • caretSlop int

See also:

Editor:SetYCaretPolicy(caretPolicy, caretSlop)
Set the way the line the caret is on is kept visible. The exclusion zone is given in lines.

Parameters:

  • caretPolicy int
  • caretSlop int

See also:

Editor:SetVisiblePolicy(visiblePolicy, visibleSlop)
Set the way the display area is determined when a particular line is to be moved to by Find, FindNext, GotoLine, etc.

Parameters:

  • visiblePolicy int
  • visibleSlop int

See also:

Editor.HScrollBar
Show or hide the horizontal scroll bar.
  • HScrollBar bool

See also:

Editor.VScrollBar
Show or hide the vertical scroll bar.
  • VScrollBar bool

See also:

Editor.ScrollWidth
Sets the document width assumed for scrolling.
  • ScrollWidth int

See also:

Editor.ScrollWidthTracking
Sets whether the maximum width line displayed is used to set scroll width.
  • ScrollWidthTracking bool

See also:

Editor.EndAtLastLine
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.
  • EndAtLastLine bool

See also:

White space

Editor.ViewWS
Make white space characters invisible, always visible or visible outside indentation.
  • ViewWS int

See also:

Editor:SetWhitespaceFore(useSetting, fore)
Set the foreground colour of all whitespace and whether to use this setting.

Parameters:

  • useSetting bool
  • fore colour

See also:

Editor:SetWhitespaceBack(useSetting, back)
Set the background colour of all whitespace and whether to use this setting.

Parameters:

  • useSetting bool
  • back colour

See also:

Editor.WhitespaceSize
Set the size of the dots used to mark space characters.
  • WhitespaceSize int

See also:

Editor.TabDrawMode
Set how tabs are drawn when visible.
  • TabDrawMode int

See also:

Editor.ExtraAscent
Set extra ascent for each line
  • ExtraAscent int

See also:

Editor.ExtraDescent
Set extra descent for each line
  • ExtraDescent int

See also:

Cursor

Editor.Cursor
Sets the cursor to one of the SC_CURSOR* values.
  • Cursor int

See also:

Mouse capture

Editor.MouseDownCaptures
Set whether the mouse is captured when its button is pressed.
  • MouseDownCaptures bool

See also:

Editor.MouseWheelCaptures
Set whether the mouse wheel can be active outside the window.
  • MouseWheelCaptures bool

See also:

Line endings

Editor.EOLMode
Set the current end of line mode.
  • EOLMode int

See also:

Editor:ConvertEOLs(eolMode)
Convert all line endings in the document to one mode.

Parameters:

  • eolMode int

See also:

Editor.ViewEOL
Make the end of line characters visible or invisible.
  • ViewEOL bool

See also:

Editor.LineEndTypesSupported
read-only
  • LineEndTypesSupported int

See also:

Editor.LineEndTypesAllowed
Set the line end types that the application wants to use. May not be used if incompatible with lexer or encoding.
  • LineEndTypesAllowed int

See also:

Editor.LineEndTypesActive
read-only
  • LineEndTypesActive int

See also:

Words

Editor:WordEndPosition(pos, onlyWordCharacters)
Get position of end of word.

Parameters:

  • pos position
  • onlyWordCharacters bool

Returns:

    int

See also:

Editor:WordStartPosition(pos, onlyWordCharacters)
Get position of start of word.

Parameters:

  • pos position
  • onlyWordCharacters bool

Returns:

    int

See also:

Editor:IsRangeWord(start, end)
Is the range start..end considered a word?

Parameters:

  • start position
  • end position

Returns:

    bool

See also:

Editor.WordChars
Set the set of characters making up words for when moving or selecting by word. First sets defaults like SetCharsDefault.
  • WordChars string

See also:

Editor.WhitespaceChars
Set the set of characters making up whitespace for when moving or selecting by word. Should be called after SetWordChars.
  • WhitespaceChars string

See also:

Editor.PunctuationChars
Set the set of characters making up punctuation characters Should be called after SetWordChars.
  • PunctuationChars string

See also:

Editor:SetCharsDefault()
Reset the set of characters for whitespace and word characters to the defaults.

See also:

Editor.CharacterCategoryOptimization
Set the number of characters to have directly indexed categories
  • CharacterCategoryOptimization int

See also:

Styling

Editor.EndStyled
read-only
  • EndStyled position

See also:

Editor:StartStyling(start, unused)
Set the current styling position to start. The unused parameter is no longer used and should be set to 0.

Parameters:

  • start position
  • unused int

See also:

Editor:SetStyling(length, style)
Change style from current styling position for length characters to a style and move the current styling position to after this newly styled segment.

Parameters:

  • length int
  • style int

See also:

Editor:SetStylingEx(styles)
Set the styles for a segment of the document.

Parameters:

  • styles string

See also:

Editor.IdleStyling
Sets limits to idle styling.
  • IdleStyling int

See also:

Editor.LineState[line]
Used to hold extra styling information for each line.
  • line int

See also:

Editor.MaxLineState
read-only
  • MaxLineState int

See also:

Style definition

Editor:StyleResetDefault()
Reset the default style to its state at startup

See also:

Editor:StyleClearAll()
Clear all the styles and make equivalent to the global default style.

See also:

Editor.StyleFont[style]
Set the font of a style.
  • style int

See also:

Editor.StyleSize[style]
Set the size of characters of a style.
  • style int

See also:

Editor.StyleSizeFractional[style]
Set the size of characters of a style. Size is in points multiplied by 100.
  • style int

See also:

Editor.StyleBold[style]
Set a style to be bold or not.
  • style int

See also:

Editor.StyleWeight[style]
Set the weight of characters of a style.
  • style int

See also:

Editor.StyleItalic[style]
Set a style to be italic or not.
  • style int

See also:

Editor.StyleUnderline[style]
Set a style to be underlined or not.
  • style int

See also:

Editor.StyleFore[style]
Set the foreground colour of a style.
  • style int

See also:

Editor.StyleBack[style]
Set the background colour of a style.
  • style int

See also:

Editor.StyleEOLFilled[style]
Set a style to have its end of line filled or not.
  • style int

See also:

Editor.StyleCharacterSet[style]
Set the character set of the font in a style.
  • style int

See also:

Editor.StyleCase[style]
Set a style to be mixed case, or to force upper or lower case.
  • style int

See also:

Editor.StyleVisible[style]
Set a style to be visible or not.
  • style int

See also:

Editor.StyleChangeable[style]
Set a style to be changeable or not (read only). Experimental feature, currently buggy.
  • style int

See also:

Editor.StyleHotSpot[style]
Set a style to be a hotspot or not.
  • style int

See also:

Caret, selection, and hotspot styles

Editor:SetSelFore(useSetting, fore)
Set the foreground colour of the main and additional selections and whether to use this setting.

Parameters:

  • useSetting bool
  • fore colour

See also:

Editor:SetSelBack(useSetting, back)
Set the background colour of the main and additional selections and whether to use this setting.

Parameters:

  • useSetting bool
  • back colour

See also:

Editor.SelAlpha
Set the alpha of the selection.
  • SelAlpha int

See also:

Editor.SelEOLFilled
Set the selection to have its end of line filled or not.
  • SelEOLFilled bool

See also:

Editor.CaretFore
Set the foreground colour of the caret.
  • CaretFore colour

See also:

Editor.CaretLineVisible
Display the background of the line containing the caret in a different colour.
  • CaretLineVisible bool

See also:

Editor.CaretLineBack
Set the colour of the background of the line containing the caret.
  • CaretLineBack colour

See also:

Editor.CaretLineBackAlpha
Set background alpha of the caret line.
  • CaretLineBackAlpha int

See also:

Editor.CaretLineFrame
Display the caret line framed. Set width != 0 to enable this option and width = 0 to disable it.
  • CaretLineFrame int

See also:

Editor.CaretLineVisibleAlways
Sets the caret line to always visible.
  • CaretLineVisibleAlways bool

See also:

Editor.CaretPeriod
Get the time in milliseconds that the caret is on and off. 0 = steady on.
  • CaretPeriod int

See also:

Editor.CaretStyle
Set the style of the caret to be drawn.
  • CaretStyle int

See also:

Editor.CaretWidth
Set the width of the insert mode caret.
  • CaretWidth int

See also:

Editor:SetHotspotActiveFore(useSetting, fore)
Set a fore colour for active hotspots.

Parameters:

  • useSetting bool
  • fore colour

See also:

Editor:GetHotspotActiveFore()
Get the fore colour for active hotspots.

Returns:

    colour

See also:

Editor:SetHotspotActiveBack(useSetting, back)
Set a back colour for active hotspots.

Parameters:

  • useSetting bool
  • back colour

See also:

Editor:GetHotspotActiveBack()
Get the back colour for active hotspots.

Returns:

    colour

See also:

Editor.HotspotActiveUnderline
Enable / Disable underlining active hotspots.
  • HotspotActiveUnderline bool

See also:

Editor.HotspotSingleLine
Limit hotspots to single line so hotspots on two lines don't merge.
  • HotspotSingleLine bool

See also:

Editor.CaretSticky
Stop the caret preferred x position changing when the user types.
  • CaretSticky int

See also:

Editor:ToggleCaretSticky()
Switch between sticky and non-sticky: meant to be bound to a key.

See also:

Character representations

Editor.Representation[encodedCharacter]
Set the way a character is drawn.
  • encodedCharacter string

See also:

Editor:ClearRepresentation(encodedCharacter)
Remove a character representation.

Parameters:

  • encodedCharacter string

See also:

Editor.ControlCharSymbol
Change the way control characters are displayed: If symbol is < 32, keep the drawn way, else, use the given character.
  • ControlCharSymbol int

See also:

Margins

Editor.Margins
Allocate a non-standard number of margins.
  • Margins int

See also:

Editor.MarginTypeN[margin]
Set a margin to be either numeric or symbolic.
  • margin int

See also:

Editor.MarginWidthN[margin]
Set the width of a margin to a width expressed in pixels.
  • margin int

See also:

Editor.MarginMaskN[margin]
Set a mask that determines which markers are displayed in a margin.
  • margin int

See also:

Editor.MarginSensitiveN[margin]
Make a margin sensitive or insensitive to mouse clicks.
  • margin int

See also:

Editor.MarginCursorN[margin]
Set the cursor shown when the mouse is inside a margin.
  • margin int

See also:

Editor.MarginBackN[margin]
Set the background colour of a margin. Only visible for SC_MARGIN_COLOUR.
  • margin int

See also:

Editor.MarginLeft
Sets the size in pixels of the left margin.
  • MarginLeft int

See also:

Editor.MarginRight
Sets the size in pixels of the right margin.
  • MarginRight int

See also:

Editor:SetFoldMarginColour(useSetting, back)
Set one of the colours used as a chequerboard pattern in the fold margin

Parameters:

  • useSetting bool
  • back colour

See also:

Editor:SetFoldMarginHiColour(useSetting, fore)
Set the other colour used as a chequerboard pattern in the fold margin

Parameters:

  • useSetting bool
  • fore colour

See also:

Editor.MarginText[line]
Set the text in the text margin for a line
  • line int

See also:

Editor.MarginStyle[line]
Set the style number for the text margin for a line
  • line int

See also:

Editor.MarginStyles[line]
Set the style in the text margin for a line
  • line int

See also:

Editor:MarginTextClearAll()
Clear the margin text on all lines

See also:

Editor.MarginStyleOffset
Get the start of the range of style numbers used for margin text
  • MarginStyleOffset int

See also:

Editor.MarginOptions
Set the margin options.
  • MarginOptions int

See also:

Annotations

Editor.AnnotationText[line]
Set the annotation text for a line
  • line int

See also:

Editor.AnnotationStyle[line]
Set the style number for the annotations for a line
  • line int

See also:

Editor.AnnotationStyles[line]
Set the annotation styles for a line
  • line int

See also:

Editor.AnnotationLines[line]
read-only
  • line int

See also:

Editor:AnnotationClearAll()
Clear the annotations from all lines

See also:

Editor.AnnotationVisible
Set the visibility for the annotations for a view
  • AnnotationVisible int

See also:

Editor.AnnotationStyleOffset
Get the start of the range of style numbers used for annotations
  • AnnotationStyleOffset int

See also:

Other settings

Editor.BufferedDraw
If drawing is buffered then each line of text is drawn into a bitmap buffer before drawing it to the screen to avoid flicker.
  • BufferedDraw bool

See also:

Editor.PhasesDraw
In one phase draw, text is drawn in a series of rectangular blocks with no overlap. In two phase draw, text is drawn in a series of lines allowing runs to overlap horizontally. In multiple phase draw, each element is drawn over the whole drawing area, allowing text to overlap from one line to the next.
  • PhasesDraw int

See also:

Editor.Technology
Set the technology used.
  • Technology int

See also:

Editor.FontQuality
Choose the quality level for text from the FontQuality enumeration.
  • FontQuality int

See also:

Editor.CodePage
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.
  • CodePage int

See also:

Editor.IMEInteraction
Choose to display the the IME in a winow or inline.
  • IMEInteraction int

See also:

Editor.Bidirectional
Set bidirectional text display state.
  • Bidirectional int

See also:

Editor:GrabFocus()
Set the focus to this Scintilla widget.

See also:

Editor.Focus
Change internal focus flag.
  • Focus bool

See also:

Brace highlighting

Editor:BraceHighlight(posA, posB)
Highlight the characters at two positions.

Parameters:

  • posA position
  • posB position

See also:

Editor:BraceBadLight(pos)
Highlight the character at a position indicating there is no matching brace.

Parameters:

  • pos position

See also:

Editor:BraceHighlightIndicator(useSetting, indicator)
Use specified indicator to highlight matching braces instead of changing their style.

Parameters:

  • useSetting bool
  • indicator int

See also:

Editor:BraceBadLightIndicator(useSetting, indicator)
Use specified indicator to highlight non matching brace instead of changing its style.

Parameters:

  • useSetting bool
  • indicator int

See also:

Editor:BraceMatch(pos, maxReStyle)
Find the position of a matching brace or INVALID_POSITION if no match. The maxReStyle must be 0 for now. It may be defined in a future release.

Parameters:

  • pos position
  • maxReStyle int

Returns:

    position

See also:

Tabs and Indentation Guides

Editor.TabWidth
Change the visible size of a tab to be a multiple of the width of a space character.
  • TabWidth int

See also:

Editor:ClearTabStops(line)
Clear explicit tabstops on a line.

Parameters:

  • line int

See also:

Editor:AddTabStop(line, x)
Add an explicit tab stop for a line.

Parameters:

  • line int
  • x int

See also:

Editor:GetNextTabStop(line, x)
Find the next explicit tab stop position on a line after a position.

Parameters:

  • line int
  • x int

Returns:

    int

See also:

Editor.UseTabs
Indentation will only use space characters if useTabs is false, otherwise it will use a combination of tabs and spaces.
  • UseTabs bool

See also:

Editor.Indent
Set the number of spaces used for one level of indentation.
  • Indent int

See also:

Editor.TabIndents
Sets whether a tab pressed when caret is within indentation indents.
  • TabIndents bool

See also:

Editor.BackSpaceUnIndents
Sets whether a backspace pressed when caret is within indentation unindents.
  • BackSpaceUnIndents bool

See also:

Editor.LineIndentation[line]
Change the indentation of a line to a number of columns.
  • line int

See also:

Editor.LineIndentPosition[line]
read-only
  • line int

See also:

Editor.IndentationGuides
Show or hide indentation guides.
  • IndentationGuides int

See also:

Editor.HighlightGuide
Set the highlighted indentation guide column. 0 = no highlighted guide.
  • HighlightGuide int

See also:

Markers

Editor:MarkerDefine(markerNumber, markerSymbol)
Set the symbol used for a particular marker number.

Parameters:

  • markerNumber int
  • markerSymbol int

See also:

Editor:MarkerDefinePixmap(markerNumber, pixmap)
Define a marker from a pixmap.

Parameters:

  • markerNumber int
  • pixmap string

See also:

Editor.RGBAImageWidth
Set the width for future RGBA image data.
  • RGBAImageWidth int

See also:

Editor.RGBAImageHeight
Set the height for future RGBA image data.
  • RGBAImageHeight int

See also:

Editor.RGBAImageScale
Set the scale factor in percent for future RGBA image data.
  • RGBAImageScale int

See also:

Editor:MarkerDefineRGBAImage(markerNumber, pixels)
Define a marker from RGBA data. It has the width and height from RGBAImageSetWidth/Height

Parameters:

  • markerNumber int
  • pixels string

See also:

Editor:MarkerSymbolDefined(markerNumber)
Which symbol was defined for markerNumber with MarkerDefine

Parameters:

  • markerNumber int

Returns:

    int

See also:

Editor.MarkerFore[markerNumber]
Set the foreground colour used for a particular marker number.
  • markerNumber int

See also:

Editor.MarkerBack[markerNumber]
Set the background colour used for a particular marker number.
  • markerNumber int

See also:

Editor.MarkerBackSelected[markerNumber]
Set the background colour used for a particular marker number when its folding block is selected.
  • markerNumber int

See also:

Editor:MarkerEnableHighlight(enabled)
Enable/disable highlight for current folding bloc (smallest one that contains the caret)

Parameters:

  • enabled bool

See also:

Editor.MarkerAlpha[markerNumber]
Set the alpha used for a marker that is drawn in the text area, not the margin.
  • markerNumber int

See also:

Editor:MarkerAdd(line, markerNumber)
Add a marker to a line, returning an ID which can be used to find or delete the marker.

Parameters:

  • line int
  • markerNumber int

Returns:

    int

See also:

Editor:MarkerAddSet(line, markerSet)
Add a set of markers to a line.

Parameters:

  • line int
  • markerSet int

See also:

Editor:MarkerDelete(line, markerNumber)
Delete a marker from a line.

Parameters:

  • line int
  • markerNumber int

See also:

Editor:MarkerDeleteAll(markerNumber)
Delete all markers with a particular number from all lines.

Parameters:

  • markerNumber int

See also:

Editor:MarkerGet(line)
Get a bit mask of all the markers set on a line.

Parameters:

  • line int

Returns:

    int

See also:

Editor:MarkerNext(lineStart, markerMask)
Find the next line at or after lineStart that includes a marker in mask. Return -1 when no more lines.

Parameters:

  • lineStart int
  • markerMask int

Returns:

    int

See also:

Editor:MarkerPrevious(lineStart, markerMask)
Find the previous line before lineStart that includes a marker in mask.

Parameters:

  • lineStart int
  • markerMask int

Returns:

    int

See also:

Editor:MarkerLineFromHandle(markerHandle)
Retrieve the line number at which a particular marker is located.

Parameters:

  • markerHandle int

Returns:

    int

See also:

Editor:MarkerDeleteHandle(markerHandle)
Delete a marker.

Parameters:

  • markerHandle int

See also:

Indicators

Editor.IndicStyle[indicator]
Set an indicator to plain, squiggle or TT.
  • indicator int

See also:

Editor.IndicFore[indicator]
Set the foreground colour of an indicator.
  • indicator int

See also:

Editor.IndicAlpha[indicator]
Set the alpha fill colour of the given indicator.
  • indicator int

See also:

Editor.IndicOutlineAlpha[indicator]
Set the alpha outline colour of the given indicator.
  • indicator int

See also:

Editor.IndicUnder[indicator]
Set an indicator to draw under text or over(default).
  • indicator int

See also:

Editor.IndicHoverStyle[indicator]
Set a hover indicator to plain, squiggle or TT.
  • indicator int

See also:

Editor.IndicHoverFore[indicator]
Set the foreground hover colour of an indicator.
  • indicator int

See also:

Editor.IndicFlags[indicator]
Set the attributes of an indicator.
  • indicator int

See also:

Editor.IndicatorCurrent
Set the indicator used for IndicatorFillRange and IndicatorClearRange
  • IndicatorCurrent int

See also:

Editor.IndicatorValue
Set the value used for IndicatorFillRange
  • IndicatorValue int

See also:

Editor:IndicatorFillRange(start, lengthFill)
Turn a indicator on over a range.

Parameters:

  • start position
  • lengthFill int

See also:

Editor:IndicatorClearRange(start, lengthClear)
Turn a indicator off over a range.

Parameters:

  • start position
  • lengthClear int

See also:

Editor:IndicatorAllOnFor(pos)
Are any indicators present at pos?

Parameters:

  • pos position

Returns:

    int

See also:

Editor:IndicatorValueAt(indicator, pos)
What value does a particular indicator have at a position?

Parameters:

  • indicator int
  • pos position

Returns:

    int

See also:

Editor:IndicatorStart(indicator, pos)
Where does a particular indicator start?

Parameters:

  • indicator int
  • pos position

Returns:

    int

See also:

Editor:IndicatorEnd(indicator, pos)
Where does a particular indicator end?

Parameters:

  • indicator int
  • pos position

Returns:

    int

See also:

Editor:FindIndicatorShow(start, end)
On OS X, show a find indicator.

Parameters:

  • start position
  • end position

See also:

Editor:FindIndicatorFlash(start, end)
On OS X, flash a find indicator, then fade out.

Parameters:

  • start position
  • end position

See also:

Editor:FindIndicatorHide()
On OS X, hide the find indicator.

See also:

Autocompletion

Editor:AutoCShow(lengthEntered, itemList)
Display a auto-completion list. The lengthEntered parameter indicates how many characters before the caret should be used to provide context.

Parameters:

  • lengthEntered int
  • itemList string

See also:

Editor:AutoCCancel()
Remove the auto-completion list from the screen.

See also:

Editor:AutoCActive()
Is there an auto-completion list visible?

Returns:

    bool

See also:

Editor:AutoCPosStart()
Retrieve the position of the caret when the auto-completion list was displayed.

Returns:

    position

See also:

Editor:AutoCComplete()
User has selected an item so remove the list and insert the selection.

See also:

Editor:AutoCStops(characterSet)
Define a set of character that when typed cancel the auto-completion list.

Parameters:

  • characterSet string

See also:

Editor.AutoCSeparator
Change the separator character in the string setting up an auto-completion list. Default is space but can be changed if items contain space.
  • AutoCSeparator int

See also:

Editor:AutoCSelect(select)
Select the item in the auto-completion list that starts with a string.

Parameters:

  • select string

See also:

Editor.AutoCCurrent
read-only
  • AutoCCurrent int

See also:

Editor.AutoCCurrentText
read-only
  • AutoCCurrentText string

See also:

Editor.AutoCCancelAtStart
Should the auto-completion list be cancelled if the user backspaces to a position before where the box was created.
  • AutoCCancelAtStart bool

See also:

Editor.AutoCFillUps
Define a set of characters that when typed will cause the autocompletion to choose the selected item.
  • AutoCFillUps string

See also:

Editor.AutoCChooseSingle
Should a single item auto-completion list automatically choose the item.
  • AutoCChooseSingle bool

See also:

Editor.AutoCIgnoreCase
Set whether case is significant when performing auto-completion searches.
  • AutoCIgnoreCase bool

See also:

Editor.AutoCCaseInsensitiveBehaviour
Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference.
  • AutoCCaseInsensitiveBehaviour int

See also:

Editor.AutoCMulti
Change the effect of autocompleting when there are multiple selections.
  • AutoCMulti int

See also:

Editor.AutoCOrder
Set the way autocompletion lists are ordered.
  • AutoCOrder int

See also:

Editor.AutoCAutoHide
Set whether or not autocompletion is hidden automatically when nothing matches.
  • AutoCAutoHide bool

See also:

Editor.AutoCDropRestOfWord
Set whether or not autocompletion deletes any word characters after the inserted text upon completion.
  • AutoCDropRestOfWord bool

See also:

Editor:RegisterImage(type, xpmData)
Register an XPM image for use in autocompletion lists.

Parameters:

  • type int
  • xpmData string

See also:

Editor:RegisterRGBAImage(type, pixels)
Register an RGBA image for use in autocompletion lists. It has the width and height from RGBAImageSetWidth/Height

Parameters:

  • type int
  • pixels string

See also:

Editor:ClearRegisteredImages()
Clear all the registered XPM images.

See also:

Editor.AutoCTypeSeparator
Change the type-separator character in the string setting up an auto-completion list. Default is '?' but can be changed if items contain '?'.
  • AutoCTypeSeparator int

See also:

Editor.AutoCMaxHeight
Set the maximum height, in rows, of auto-completion and user lists. The default is 5 rows.
  • AutoCMaxHeight int

See also:

Editor.AutoCMaxWidth
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.
  • AutoCMaxWidth int

See also:

User lists

Editor:UserListShow(listType, itemList)
Display a list of strings and send notification when user chooses one.

Parameters:

  • listType int
  • itemList string

See also:

Call tips

Editor:CallTipShow(pos, definition)
Show a call tip containing a definition near position pos.

Parameters:

  • pos position
  • definition string

See also:

Editor:CallTipCancel()
Remove the call tip from the screen.

See also:

Editor:CallTipActive()
Is there an active call tip?

Returns:

    bool

See also:

Editor:CallTipPosStart()
Retrieve the position where the caret was before displaying the call tip.

Returns:

    position

See also:

Editor.CallTipPosStart
Set the start position in order to change when backspacing removes the calltip.
  • CallTipPosStart int

See also:

Editor:CallTipSetHlt(highlightStart, highlightEnd)
Highlight a segment of the definition.

Parameters:

  • highlightStart int
  • highlightEnd int

See also:

Editor.CallTipBack
Set the background colour for the call tip.
  • CallTipBack colour

See also:

Editor.CallTipFore
Set the foreground colour for the call tip.
  • CallTipFore colour

See also:

Editor.CallTipForeHlt
Set the foreground colour for the highlighted part of the call tip.
  • CallTipForeHlt colour

See also:

Editor.CallTipUseStyle
Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
  • CallTipUseStyle int

See also:

Editor.CallTipPosition
Set position of calltip, above or below text.
  • CallTipPosition bool

See also:

Key bindings

Editor:AssignCmdKey(keycode, modifiers, sciCommand)
When key+modifier combination keyDefinition is pressed perform sciCommand.

Parameters:

  • keycode int e.g. SCK_LEFT or string.byte("A")
  • modifiers int e.g. SCMOD_CTRL | SCMOD_SHIFT
  • sciCommand int

See also:

Editor:ClearCmdKey(keycode, modifiers)
When key+modifier combination keyDefinition is pressed do nothing.

Parameters:

  • keycode int e.g. SCK_LEFT or string.byte("A")
  • modifiers int e.g. SCMOD_CTRL | SCMOD_SHIFT

See also:

Editor:ClearAllCmdKeys()
Drop all key mappings.

See also:

Editor:Null()
Null operation.

See also:

Keyboard Commands

Editor:LineDown()
Move caret down one line.
Editor:LineDownExtend()
Move caret down one line extending selection to new caret position.
Editor:LineDownRectExtend()
Move caret down one line, extending rectangular selection to new caret position.
Editor:LineScrollDown()
Scroll the document down, keeping the caret visible.
Editor:LineUp()
Move caret up one line.
Editor:LineUpExtend()
Move caret up one line extending selection to new caret position.
Editor:LineUpRectExtend()
Move caret up one line, extending rectangular selection to new caret position.
Editor:LineScrollUp()
Scroll the document up, keeping the caret visible.
Editor:ParaDown()
Move caret between paragraphs (delimited by empty lines).
Editor:ParaDownExtend()
Move caret between paragraphs (delimited by empty lines).
Editor:ParaUp()
Move caret between paragraphs (delimited by empty lines).
Editor:ParaUpExtend()
Move caret between paragraphs (delimited by empty lines).
Editor:CharLeft()
Move caret left one character.
Editor:CharLeftExtend()
Move caret left one character extending selection to new caret position.
Editor:CharLeftRectExtend()
Move caret left one character, extending rectangular selection to new caret position.
Editor:CharRight()
Move caret right one character.
Editor:CharRightExtend()
Move caret right one character extending selection to new caret position.
Editor:CharRightRectExtend()
Move caret right one character, extending rectangular selection to new caret position.
Editor:WordLeft()
Move caret left one word.
Editor:WordLeftExtend()
Move caret left one word extending selection to new caret position.
Editor:WordRight()
Move caret right one word.
Editor:WordRightExtend()
Move caret right one word extending selection to new caret position.
Editor:WordLeftEnd()
Move caret left one word, position cursor at end of word.
Editor:WordLeftEndExtend()
Move caret left one word, position cursor at end of word, extending selection to new caret position.
Editor:WordRightEnd()
Move caret right one word, position cursor at end of word.
Editor:WordRightEndExtend()
Move caret right one word, position cursor at end of word, extending selection to new caret position.
Editor:WordPartLeft()
Move to the previous change in capitalization.
Editor:WordPartLeftExtend()
Move to the previous change in capitalization extending selection to new caret position.
Editor:WordPartRight()
Move to the change next in capitalization.
Editor:WordPartRightExtend()
Move to the next change in capitalization extending selection to new caret position.
Editor:Home()
Move caret to first position on line.
Editor:HomeExtend()
Move caret to first position on line extending selection to new caret position.
Editor:HomeRectExtend()
Move caret to first position on line, extending rectangular selection to new caret position.
Editor:HomeDisplay()
Move caret to first position on display line.
Editor:HomeDisplayExtend()
Move caret to first position on display line extending selection to new caret position.
Editor:HomeWrap()
Similarly Home when word-wrap is enabled.
Editor:HomeWrapExtend()
Similarly HomeExtend when word-wrap is enabled.
Editor:VCHome()
Move caret to before first visible character on line. If already there move to first character on line.
Editor:VCHomeExtend()
Like VCHome but extending selection to new caret position.
Editor:VCHomeRectExtend()
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.
Editor:VCHomeWrap()
Editor:VCHomeWrapExtend()
Editor:VCHomeDisplay()
Editor:VCHomeDisplayExtend()
Editor:LineEnd()
Move caret to last position on line.
Editor:LineEndExtend()
Move caret to last position on line extending selection to new caret position.
Editor:LineEndRectExtend()
Move caret to last position on line, extending rectangular selection to new caret position.
Editor:LineEndDisplay()
Move caret to last position on display line.
Editor:LineEndDisplayExtend()
Move caret to last position on display line extending selection to new caret position.
Editor:LineEndWrap()
Similarly LineEnd when word-wrap is enabled.
Editor:LineEndWrapExtend()
Similarly LineEndExtend when word-wrap is enabled.
Editor:DocumentStart()
Move caret to first position in document.
Editor:DocumentStartExtend()
Move caret to first position in document extending selection to new caret position.
Editor:DocumentEnd()
Move caret to last position in document.
Editor:DocumentEndExtend()
Move caret to last position in document extending selection to new caret position.
Editor:PageUp()
Move caret one page up.
Editor:PageUpExtend()
Move caret one page up extending selection to new caret position.
Editor:PageUpRectExtend()
Move caret one page up, extending rectangular selection to new caret position.
Editor:PageDown()
Move caret one page down.
Editor:PageDownExtend()
Move caret one page down extending selection to new caret position.
Editor:PageDownRectExtend()
Move caret one page down, extending rectangular selection to new caret position.
Editor:StutteredPageUp()
Move caret to top of page, or one page up if already at top of page.
Editor:StutteredPageUpExtend()
Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.
Editor:StutteredPageDown()
Move caret to bottom of page, or one page down if already at bottom of page.
Editor:StutteredPageDownExtend()
Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.
Editor:DeleteBack()
Delete the selection or if no selection, the character before the caret.
Editor:DeleteBackNotLine()
Delete the selection or if no selection, the character before the caret. Will not delete the character before at the start of a line.
Editor:DelWordLeft()
Delete the word to the left of the caret.
Editor:DelWordRight()
Delete the word to the right of the caret.
Editor:DelWordRightEnd()
Delete the word to the right of the caret, but not the trailing non-word characters.
Editor:DelLineLeft()
Delete back from the current position to the start of the line.
Editor:DelLineRight()
Delete forwards from the current position to the end of the line.
Editor:LineDelete()
Delete the line containing the caret.
Editor:LineCut()
Cut the line containing the caret.
Editor:LineCopy()
Copy the line containing the caret.
Editor:LineTranspose()
Switch the current line with the previous.
Editor:LineDuplicate()
Duplicate the current line.
Editor:LowerCase()
Transform the selection to lower case.
Editor:UpperCase()
Transform the selection to upper case.
Editor:Cancel()
Cancel any modes such as call tip or auto-completion list display.
Editor:EditToggleOvertype()
Switch from insert to overtype mode or the reverse.
Editor:NewLine()
Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
Editor:FormFeed()
Insert a Form Feed character.
Editor:Tab()
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.
Editor:BackTab()
Dedent the selected lines.
Editor:SelectionDuplicate()
Duplicates the current selection.
Editor:VerticalCentreCaret()
Scroll the document so that the caret is in the center of the screen.
Editor:MoveSelectedLinesUp()
Move the selected lines up one line, shifting the line above after the selection.
Editor:MoveSelectedLinesDown()
Move the selected lines down one line, shifting the line below before the selection.
Editor:ScrollToStart()
Scroll the document to the start without changing the selection.
Editor:ScrollToEnd()
Scroll the document to the end without changing the selection.

Popup edit menu

Editor:UsePopUp(popUpMode)
Set whether a pop up menu is displayed automatically when the user presses the wrong mouse button on certain areas.

Parameters:

  • popUpMode int

See also:

Macro recording

Editor:StartRecord()
Start notifying the container of all key presses and commands.

See also:

Editor:StopRecord()
Stop notifying the container of all key presses and commands.

See also:

Printing

Editor.PrintMagnification
Sets the print magnification added to the point size of each style for printing.
  • PrintMagnification int

See also:

Editor.PrintColourMode
Modify colours when printing for clearer printed text.
  • PrintColourMode int

See also:

Editor.PrintWrapMode
Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE).
  • PrintWrapMode int

See also:

Direct access

Editor.DirectFunction
read-only
  • DirectFunction int

See also:

Editor.DirectPointer
read-only
  • DirectPointer int

See also:

Editor.CharacterPointer
read-only
  • CharacterPointer int

See also:

Editor:GetRangePointer(start, lengthRange)
Return a read-only pointer to a range of characters in the document. May move the gap so that the range is contiguous, but will only move up to lengthRange bytes.

Parameters:

  • start position
  • lengthRange int

Returns:

    int

See also:

Editor.GapPosition
read-only
  • GapPosition position

See also:

Multiple views

Editor.DocPointer
Change the document object used.
  • DocPointer int

See also:

Editor:CreateDocument(bytes, documentOptions)
Create a new document object. Starts with reference count of 1 and not selected into editor.

Parameters:

  • bytes int
  • documentOptions int

Returns:

    int

See also:

Editor:AddRefDocument(doc)
Extend life of document.

Parameters:

  • doc int

See also:

Editor:ReleaseDocument(doc)
Release a reference to the document, deleting document if it fades to black.

Parameters:

  • doc int

See also:

Editor.DocumentOptions
read-only
  • DocumentOptions int

See also:

Background loading and saving

Editor:CreateLoader(bytes, documentOptions)
Create an ILoader*.

Parameters:

  • bytes int
  • documentOptions int

Returns:

    int

See also:

Folding

Editor:VisibleFromDocLine(docLine)
Find the display line of a document line taking hidden lines into account.

Parameters:

  • docLine int

Returns:

    int

See also:

Editor:DocLineFromVisible(displayLine)
Find the document line of a display line taking hidden lines into account.

Parameters:

  • displayLine int

Returns:

    int

See also:

Editor:ShowLines(lineStart, lineEnd)
Make a range of lines visible.

Parameters:

  • lineStart int
  • lineEnd int

See also:

Editor:HideLines(lineStart, lineEnd)
Make a range of lines invisible.

Parameters:

  • lineStart int
  • lineEnd int

See also:

Editor.LineVisible[line]
read-only
  • line int

See also:

Editor.AllLinesVisible
read-only
  • AllLinesVisible bool

See also:

Editor.FoldLevel[line]
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.
  • line int

See also:

Editor.FoldFlags
Set some style options for folding.
  • FoldFlags int

See also:

Editor:GetLastChild(line, level)
Find the last child line of a header line.

Parameters:

  • line int
  • level int

Returns:

    int

See also:

Editor.FoldParent[line]
read-only
  • line int

See also:

Editor:ToggleFold(line)
Switch a header line between expanded and contracted.

Parameters:

  • line int

See also:

Editor:ToggleFoldShowText(line, text)
Switch a header line between expanded and contracted and show some text after the line.

Parameters:

  • line int
  • text string

See also:

Editor.FoldDisplayTextStyle
Set the style of fold display text.
  • FoldDisplayTextStyle int

See also:

Editor:SetDefaultFoldDisplayText(text)
Set the default fold display text.

Parameters:

  • text string

See also:

Editor:GetDefaultFoldDisplayText()
Get the default fold display text.

Returns:

    string

See also:

Editor.FoldExpanded[line]
Show the children of a header line.
  • line int

See also:

Editor:FoldLine(line, action)
Expand or contract a fold header.

Parameters:

  • line int
  • action int

See also:

Editor:FoldChildren(line, action)
Expand or contract a fold header and its children.

Parameters:

  • line int
  • action int

See also:

Editor:FoldAll(action)
Expand or contract all fold headers.

Parameters:

  • action int

See also:

Editor:ExpandChildren(line, level)
Expand a fold header and all children. Use the level argument instead of the line's current level.

Parameters:

  • line int
  • level int

See also:

Editor.AutomaticFold
Set automatic folding behaviours.
  • AutomaticFold int

See also:

Editor:ContractedFoldNext(lineStart)
Find the next line at or after lineStart that is a contracted fold header line. Return -1 when no more lines.

Parameters:

  • lineStart int

Returns:

    int

See also:

Editor:EnsureVisible(line)
Ensure a particular line is visible by expanding any header line hiding it.

Parameters:

  • line int

See also:

Editor:EnsureVisibleEnforcePolicy(line)
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.

Parameters:

  • line int

See also:

Line wrapping

Editor.WrapMode
Sets whether text is word wrapped.
  • WrapMode int

See also:

Editor.WrapVisualFlags
Set the display mode of visual flags for wrapped lines.
  • WrapVisualFlags int

See also:

Editor.WrapVisualFlagsLocation
Set the location of visual flags for wrapped lines.
  • WrapVisualFlagsLocation int

See also:

Editor.WrapIndentMode
Sets how wrapped sublines are placed. Default is fixed.
  • WrapIndentMode int

See also:

Editor.WrapStartIndent
Set the start indent for wrapped lines.
  • WrapStartIndent int

See also:

Editor.LayoutCache
Sets the degree of caching of layout information.
  • LayoutCache int

See also:

Editor.PositionCache
Set number of entries in position cache
  • PositionCache int

See also:

Editor:LinesSplit(pixelWidth)
Split the lines in the target into lines that are less wide than pixelWidth where possible.

Parameters:

  • pixelWidth int

See also:

Editor:LinesJoin()
Join the lines in the target.

See also:

Editor:WrapCount(docLine)
The number of display lines needed to wrap a document line

Parameters:

  • docLine int

Returns:

    int

See also:

Zooming

Editor:ZoomIn()
Magnify the displayed text by increasing the sizes by 1 point.

See also:

Editor:ZoomOut()
Make the displayed text smaller by decreasing the sizes by 1 point.

See also:

Editor.Zoom
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.
  • Zoom int

See also:

Long lines

Editor.EdgeMode
The edge may be displayed by a line (EDGE_LINE/EDGE_MULTILINE) or by highlighting text that goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
  • EdgeMode int

See also:

Editor.EdgeColumn
Set the column number of the edge. If text goes past the edge then it is highlighted.
  • EdgeColumn int

See also:

Editor.EdgeColour
Change the colour used in edge indication.
  • EdgeColour colour

See also:

Editor:MultiEdgeAddLine(column, edgeColour)
Add a new vertical edge to the view.

Parameters:

  • column int
  • edgeColour colour

See also:

Editor:MultiEdgeClearAll()
Clear all vertical edges.

See also:

Accessibility

Editor.Accessibility
Enable or disable accessibility.
  • Accessibility int

See also:

Lexer

Editor.Lexer
Set the lexing language of the document.
  • Lexer int

See also:

Editor.LexerLanguage
Set the lexing language of the document based on string name.
  • LexerLanguage string

See also:

Editor:LoadLexerLibrary(path)
Load a lexer library (dll / so).

Parameters:

  • path string

See also:

Editor:Colourise(start, end)
Colourise a segment of the document using the current lexing language.

Parameters:

  • start position
  • end position

See also:

Editor:ChangeLexerState(start, end)
Indicate that the internal state of a lexer has changed over a range and therefore there may be a need to redraw.

Parameters:

  • start position
  • end position

Returns:

    int

See also:

Editor:PropertyNames()
Retrieve a '\n' separated list of properties understood by the current lexer. Result is NUL-terminated.

Returns:

    string

See also:

Editor:PropertyType(name)
Retrieve the type of a property.

Parameters:

  • name string

Returns:

    int

See also:

Editor:DescribeProperty(name)
Describe a property. Result is NUL-terminated.

Parameters:

  • name string

Returns:

    string

See also:

Editor.Property[key]
Set up a value that may be used by a lexer for some optional feature.
  • key string

See also:

Editor.PropertyExpanded[key]
read-only
  • key string

See also:

Editor:GetPropertyInt(key, defaultValue)
Retrieve a "property" value previously set with SetProperty, interpreted as an int AFTER any "$()" variable replacement.

Parameters:

  • key string
  • defaultValue int

Returns:

    int

See also:

Editor.KeyWords[keyWordSet]
Set up the key words used by the lexer.
  • keyWordSet int

See also:

Editor:DescribeKeyWordSets()
Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer. Result is NUL-terminated.

Returns:

    string

See also:

Editor.SubStyleBases
read-only
  • SubStyleBases string

See also:

Editor.DistanceToSecondaryStyles
read-only
  • DistanceToSecondaryStyles int

See also:

Editor:AllocateSubStyles(styleBase, numberStyles)
Allocate a set of sub styles for a particular base style, returning start of range

Parameters:

  • styleBase int
  • numberStyles int

Returns:

    int

See also:

Editor:FreeSubStyles()
Free allocated sub styles

See also:

Editor.SubStylesStart[styleBase]
read-only
  • styleBase int

See also:

Editor.SubStylesLength[styleBase]
read-only
  • styleBase int

See also:

Editor.StyleFromSubStyle[subStyle]
read-only
  • subStyle int

See also:

Editor.PrimaryStyleFromStyle[style]
read-only
  • style int

See also:

Editor.Identifiers[style]
Set the identifiers that are shown in a particular style
  • style int

See also:

Editor:PrivateLexerCall(operation, pointer)
For private communication between an application and a known lexer.

Parameters:

  • operation int
  • pointer int

Returns:

    int

See also:

Editor.NamedStyles
read-only
  • NamedStyles int

See also:

Editor:NameOfStyle(style)
Retrieve the name of a style. Result is NUL-terminated.

Parameters:

  • style int

Returns:

    string

See also:

Editor:TagsOfStyle(style)
Retrieve a ' ' separated list of style tags like "literal quoted string". Result is NUL-terminated.

Parameters:

  • style int

Returns:

    string

See also:

Editor:DescriptionOfStyle(style)
Retrieve a description of a style. Result is NUL-terminated.

Parameters:

  • style int

Returns:

    string

See also:

Notifications

Editor.Identifier
Set the identifier reported as idFrom in notification messages.
  • Identifier int

See also:

Editor.ModEventMask
Set which document modification events are sent to the container.
  • ModEventMask int

See also:

Editor.CommandEvents
Set whether command events are sent to the container.
  • CommandEvents bool

See also:

Editor.MouseDwellTime
Sets the time the mouse must sit still to generate a mouse dwell event.
  • MouseDwellTime int

See also:

generated by LDoc 1.4.6