ace

package module
v0.0.0-...-4ca2d59 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2017 License: MIT Imports: 1 Imported by: 5

README

gopher-ace

Ace bindings for GopherJS.

The documentation is (almost) directly from the Ace API reference

Use go get -u maunium.net/go/gopher-ace to get this package.

Documentation

Index

Constants

View Source
const (
	Ace = "ace"
)

Function and variable names

Variables

This section is empty.

Functions

This section is empty.

Types

type EditSession

type EditSession struct {
	*js.Object
}

EditSession is a wrapper for the Ace EditSession type.

func (EditSession) AddDynamicMarker

func (session EditSession) AddDynamicMarker(marker interface{}, inFront bool) *js.Object

AddDynamicMarker adds a dynamic marker to the session.

func (EditSession) AddGutterDecoration

func (session EditSession) AddGutterDecoration(row int, className string)

AddGutterDecoration adds `className` to the `row`, to be used for CSS stylings and whatnot.

func (EditSession) AddMarker

func (session EditSession) AddMarker(rangee Range, class string, typee interface{}, inFront bool) int

AddMarker adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `changeFrontMarker` event fires; otherwise, the `changeBackMarker` event fires.

func (EditSession) ClearAnnotations

func (session EditSession) ClearAnnotations()

ClearAnnotations clears all the annotations for this session. This function also triggers the `changeAnnotation` event.

func (EditSession) ClearBreakpoint

func (session EditSession) ClearBreakpoint(row int)

ClearBreakpoint removes a breakpoint on the row number given by rows. This function also emits the `changeBreakpoint` event.

func (EditSession) ClearBreakpoints

func (session EditSession) ClearBreakpoints()

ClearBreakpoints removes all breakpoints on the rows. This function also emits the `changeBreakpoint` event.

func (EditSession) DocumentToScreenColumn

func (session EditSession) DocumentToScreenColumn(row, docColumn int) int

DocumentToScreenColumn for the given document row and column, returns the screen column.

func (EditSession) DocumentToScreenRow

func (session EditSession) DocumentToScreenRow(docRow, docColumn int)

DocumentToScreenRow for the given document row and column, returns the screen row.

func (EditSession) DocumentToScrenPosition

func (session EditSession) DocumentToScrenPosition(docRow, docColumn int) *js.Object

DocumentToScrenPosition converts document coordinates to screen coordinates. This takes into account code folding, word wrap, tab size, and any other visual modifications.

func (EditSession) DuplicateLines

func (session EditSession) DuplicateLines(firstRow, lastRow int) int

DuplicateLines duplicates all the text between `firstRow` and `lastRow`.

func (EditSession) GetAWordRange

func (session EditSession) GetAWordRange(row, column int) Range

GetAWordRange gets the range of a word, including its right whitespace.

func (EditSession) GetAnnotations

func (session EditSession) GetAnnotations() *js.Object

GetAnnotations returns the annotations for the `EditSession`.

func (EditSession) GetBreakpoints

func (session EditSession) GetBreakpoints() int

GetBreakpoints returns an array of numbers, indicating which rows have breakpoints.

func (EditSession) GetDocument

func (session EditSession) GetDocument() *js.Object

GetDocument returns the `Document` associated with this session.

func (EditSession) GetDocumentLastRowColumn

func (session EditSession) GetDocumentLastRowColumn(docRow, docColumn int) *js.Object

GetDocumentLastRowColumn returns the column position of the last screen row for the given document row and column.

func (EditSession) GetDocumentLastRowColumnPosition

func (session EditSession) GetDocumentLastRowColumnPosition(docRow, docColumn int) *js.Object

GetDocumentLastRowColumnPosition returns the document position of the last row for the given document row and column.

func (EditSession) GetLength

func (session EditSession) GetLength() int

GetLength returns the number of rows in the document.

func (EditSession) GetLine

func (session EditSession) GetLine(row int) string

GetLine returns a verbatim copy of the given line as it is in the document.

func (EditSession) GetLines

func (session EditSession) GetLines(firstRow, lastRow int) string

GetLines returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`.

func (EditSession) GetMarkers

func (session EditSession) GetMarkers(inFront bool) *js.Object

GetMarkers returns an array containing the IDs of all the markers, either front or back.

func (EditSession) GetMode

func (session EditSession) GetMode() *js.Object

GetMode returns the current text mode.

func (EditSession) GetNewLineMode

func (session EditSession) GetNewLineMode() string

GetNewLineMode returns the current new line mode.

func (EditSession) GetOption

func (session EditSession) GetOption(optionName string) *js.Object

GetOption gets the option with teh given name.

func (EditSession) GetOptions

func (session EditSession) GetOptions() *js.Object

GetOptions gets all options

func (EditSession) GetOverwrite

func (session EditSession) GetOverwrite() bool

GetOverwrite returns `true` if overwrites are enabled; `false` otherwise.

func (EditSession) GetRowLength

func (session EditSession) GetRowLength(row int) int

GetRowLength returns number of screenrows in a wrapped line.

func (EditSession) GetRowSplitData

func (session EditSession) GetRowSplitData(row interface{}) string

GetRowSplitData returns the split data for the given row.

func (EditSession) GetScreenLastRowColumn

func (session EditSession) GetScreenLastRowColumn(screenRow int) int

GetScreenLastRowColumn returns the position (on screen) for the last character in the provided screen row.

func (EditSession) GetScreenLength

func (session EditSession) GetScreenLength() int

GetScreenLength returns the length of the screen.

func (EditSession) GetScreenTabSize

func (session EditSession) GetScreenTabSize(screenColumn int) int

GetScreenTabSize returns the distance to the next tab stop at the specified screen column.

func (EditSession) GetScreenWidth

func (session EditSession) GetScreenWidth() int

GetScreenWidth returns the width of the screen.

func (EditSession) GetScrollLeft

func (session EditSession) GetScrollLeft() int

GetScrollLeft returns the value of the distance between the left of the editor and the leftmost part of the visible content.

func (EditSession) GetScrollTop

func (session EditSession) GetScrollTop() int

GetScrollTop returns the value of the distance between the top of the editor and the topmost part of the visible content.

func (EditSession) GetSelection

func (session EditSession) GetSelection() *js.Object

GetSelection returns the selection object.

func (EditSession) GetState

func (session EditSession) GetState(row int) *js.Object

GetState returns the state of tokenization at the end of a row.

func (EditSession) GetTabSize

func (session EditSession) GetTabSize() int

GetTabSize returns the current tab size.

func (EditSession) GetTabString

func (session EditSession) GetTabString() string

GetTabString returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by getTabSize()); otherwise it's simply '\t'.

func (EditSession) GetTextRange

func (session EditSession) GetTextRange(rangee Range) string

GetTextRange returns all the text within the given range as a single string.

func (EditSession) GetTokenAt

func (session EditSession) GetTokenAt(row, column int) *js.Object

GetTokenAt returns an object indicating the token at the current row. The object has two properties: `index` and `start`.

func (EditSession) GetTokens

func (session EditSession) GetTokens(row int) *js.Object

GetTokens starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows.

func (EditSession) GetUndoManager

func (session EditSession) GetUndoManager() *js.Object

GetUndoManager returns the current undo manager.

func (EditSession) GetUseSoftTabs

func (session EditSession) GetUseSoftTabs() bool

GetUseSoftTabs returns `true` if soft tabs are being used, `false` otherwise.

func (EditSession) GetUseWorker

func (session EditSession) GetUseWorker() bool

GetUseWorker returns `true` if workers are being used.

func (EditSession) GetUseWrapMode

func (session EditSession) GetUseWrapMode() bool

GetUseWrapMode returns `true` if wrap mode is being used; `false` otherwise.

func (EditSession) GetValue

func (session EditSession) GetValue() string

GetValue returns the current `Document` as a string.

func (EditSession) GetWordRange

func (session EditSession) GetWordRange(row, column int) *js.Object

GetWordRange returns the `Range` of the first word boundary it finds after the starting row and column.

func (EditSession) GetWrapLimit

func (session EditSession) GetWrapLimit() int

GetWrapLimit returns the value of wrap limit.

func (EditSession) GetWrapLimitRange

func (session EditSession) GetWrapLimitRange() (int, int)

GetWrapLimitRange returns the minimum and maximum of the wrap limit

func (EditSession) Highlight

func (session EditSession) Highlight(args ...interface{}) *js.Object

Highlight is an undocumented Ace function.

func (EditSession) HighlightLines

func (session EditSession) HighlightLines(args ...interface{}) *js.Object

HighlightLines is an undocumented Ace function.

func (EditSession) IndentRows

func (session EditSession) IndentRows(startRow, endRow int, indentString string)

IndentRows indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in indentString.

func (EditSession) Insert

func (session EditSession) Insert(row, column int, text string) *js.Object

Insert inserts a block of `text` and the indicated position.

func (EditSession) IsTabStop

func (session EditSession) IsTabStop(row, column int) bool

IsTabStop returns `true` if the character at the position is a soft tab.

func (EditSession) MoveLinesDown

func (session EditSession) MoveLinesDown(firstRow, lastRow int) int

MoveLinesDown shifts all the lines in the document down one, starting from `firstRow` and ending at `lastRow`.

func (EditSession) MoveLinesUp

func (session EditSession) MoveLinesUp(firstRow, lastRow int) int

MoveLinesUp shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`.

func (EditSession) MoveText

func (session EditSession) MoveText(fromRange Range, toRow, toColumn int) Range

MoveText moves a range of text from the given range to the given position.

func (EditSession) On

func (session EditSession) On(on string, f interface{})

On binds the given function to the given Ace event.

func (EditSession) OnChange

func (session EditSession) OnChange(f func(obj *js.Object))

OnChange binds the given function to the Ace change event.

func (EditSession) OnChangeAnnotation

func (session EditSession) OnChangeAnnotation(f func())

OnChangeAnnotation binds the given function to the Ace changeAnnotation event.

func (EditSession) OnChangeBackMarker

func (session EditSession) OnChangeBackMarker(f func())

OnChangeBackMarker binds the given function to the Ace changeBackMarker event.

func (EditSession) OnChangeBreakpoint

func (session EditSession) OnChangeBreakpoint(f func())

OnChangeBreakpoint binds the given function to the Ace changeBreakpoint event.

func (EditSession) OnChangeFold

func (session EditSession) OnChangeFold(f func())

OnChangeFold binds the given function to the Ace changeFold event.

func (EditSession) OnChangeFrontMarker

func (session EditSession) OnChangeFrontMarker(f func())

OnChangeFrontMarker binds the given function to the Ace changeFrontMarker event.

func (EditSession) OnChangeMode

func (session EditSession) OnChangeMode(f func())

OnChangeMode binds the given function to the Ace changeMode event.

func (EditSession) OnChangeOverwrite

func (session EditSession) OnChangeOverwrite(f func())

OnChangeOverwrite binds the given function to the Ace changeOverwrite event.

func (EditSession) OnChangeScrollLeft

func (session EditSession) OnChangeScrollLeft(f func(scrollTop int))

OnChangeScrollLeft binds the given function to the Ace changeScrollLeft event.

func (EditSession) OnChangeScrollTop

func (session EditSession) OnChangeScrollTop(f func(scrollTop int))

OnChangeScrollTop binds the given function to the Ace changeScrollTop event.

func (EditSession) OnChangeTabSize

func (session EditSession) OnChangeTabSize(f func())

OnChangeTabSize binds the given function to the Ace changeTabSize event.

func (EditSession) OnChangeWrapLimit

func (session EditSession) OnChangeWrapLimit(f func())

OnChangeWrapLimit binds the given function to the Ace changeWrapLimit event.

func (EditSession) OnChangeWrapMode

func (session EditSession) OnChangeWrapMode(f func())

OnChangeWrapMode binds the given function to the Ace changeWrapMode event.

func (EditSession) OnTokenizerUpdate

func (session EditSession) OnTokenizerUpdate(f func(obj *js.Object))

OnTokenizerUpdate binds the given function to the Ace tokenizerUpdate event.

func (EditSession) OutdentRows

func (session EditSession) OutdentRows(rangee Range)

OutdentRows outdents all the rows defined by the `start` and `end` properties of `range`.

func (EditSession) Redo

func (session EditSession) Redo(args ...interface{}) *js.Object

Redo is an undocumented Ace function.

func (EditSession) RedoChanges

func (session EditSession) RedoChanges(deltas []interface{}, dontSelect bool) Range

RedoChanges re-implements a previously undone change to your document.

func (EditSession) Remove

func (session EditSession) Remove(rangee Range) *js.Object

Remove removes the `range` from the document.

func (EditSession) RemoveGutterDecoration

func (session EditSession) RemoveGutterDecoration(row int, className string)

RemoveGutterDecoration removes `className` from the `row`.

func (EditSession) RemoveMarker

func (session EditSession) RemoveMarker(markerID int)

RemoveMarker removes the marker with the specified ID. If this marker was in front, the `changeFrontMarker` event is emitted. If the marker was in the back, the `changeBackMarker` event is emitted.

func (EditSession) Replace

func (session EditSession) Replace(rangee Range, text string) *js.Object

Replace replaces a range in the document with the new `text`.

func (EditSession) Reset

func (session EditSession) Reset(args ...interface{}) *js.Object

Reset is an undocumented Ace function.

func (EditSession) ResetCaches

func (session EditSession) ResetCaches(args ...interface{}) *js.Object

ResetCaches is an undocumented Ace function.

func (EditSession) ScreenToDocumentColumn

func (session EditSession) ScreenToDocumentColumn(args ...interface{}) *js.Object

ScreenToDocumentColumn is an undocumented Ace function.

func (EditSession) ScreenToDocumentPosition

func (session EditSession) ScreenToDocumentPosition(screenRow, screenColumn int) *js.Object

ScreenToDocumentPosition converts characters coordinates on the screen to characters coordinates within the document. This takes into account code folding, word wrap, tab size, and any other visual modifications.

func (EditSession) ScreenToDocumentRow

func (session EditSession) ScreenToDocumentRow(args ...interface{}) *js.Object

ScreenToDocumentRow is an undocumented Ace function.

func (EditSession) SetAnnotations

func (session EditSession) SetAnnotations(annotations []interface{})

SetAnnotations sets annotations for the `EditSession`. This functions emits the `changeAnnotation` event.

func (EditSession) SetBreakpoint

func (session EditSession) SetBreakpoint(row int, className string)

SetBreakpoint sets a breakpoint on the row number given by `rows`. This function also emits the `changeBreakpoint` event.

func (EditSession) SetBreakpoints

func (session EditSession) SetBreakpoints(rows []interface{})

SetBreakpoints sets a breakpoint on every row given by `rows`. This function also emits the `changeBreakpoint` event.

func (EditSession) SetDocument

func (session EditSession) SetDocument(doc interface{})

SetDocument sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`.

func (EditSession) SetMode

func (session EditSession) SetMode(args ...interface{}) *js.Object

SetMode is an undocumented Ace function.

func (EditSession) SetNewLineMode

func (session EditSession) SetNewLineMode(newLineMode string)

SetNewLineMode sets the new line mode.

func (EditSession) SetOption

func (session EditSession) SetOption(optionName string, optionValue interface{})

SetOption sets an option.

func (EditSession) SetOptions

func (session EditSession) SetOptions(options map[string]interface{})

SetOptions sets all options.

func (EditSession) SetOverwrite

func (session EditSession) SetOverwrite(overwrite bool)

SetOverwrite - Pass in `true` to enable overwrites in your session, or `false` to disable

func (EditSession) SetScrollLeft

func (session EditSession) SetScrollLeft(scrollLeft interface{})

SetScrollLeft sets the value of the distance between the left of the editor and the leftmost part of the visible content.

func (EditSession) SetScrollTop

func (session EditSession) SetScrollTop(scrollTop int)

SetScrollTop sets the scroll top value. This function also emits the `changeScrollTop` event.

func (EditSession) SetTabSize

func (session EditSession) SetTabSize(tabSize int)

SetTabSize set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event.

func (EditSession) SetUndoManager

func (session EditSession) SetUndoManager(undoManager interface{})

SetUndoManager sets the undo manager.

func (EditSession) SetUndoSelect

func (session EditSession) SetUndoSelect(enable bool)

SetUndoSelect enables or disables highlighting of the range where an undo occured.

func (EditSession) SetUseSoftTabs

func (session EditSession) SetUseSoftTabs(useSoftTabs bool)

SetUseSoftTabs - pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`\t`).

func (EditSession) SetUseWorker

func (session EditSession) SetUseWorker(useWorker bool)

SetUseWorker identifies if you want to use a worker for the `EditSession`.

func (EditSession) SetUseWrapMode

func (session EditSession) SetUseWrapMode(useWrapMode bool)

SetUseWrapMode sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `changeWrapMode` event is emitted.

func (EditSession) SetValue

func (session EditSession) SetValue(text string)

SetValue sets the session text.

func (EditSession) SetWrapLimitRange

func (session EditSession) SetWrapLimitRange(min, max int)

SetWrapLimitRange sets the boundaries of wrap. Either value can be null to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for min or max are different, this method also emits the `changeWrapMode` event.

func (EditSession) ToString

func (session EditSession) ToString() string

ToString returns the current `Document` as a string.

func (EditSession) ToggleOverwrite

func (session EditSession) ToggleOverwrite()

ToggleOverwrite sets the value of overwrite to the opposite of whatever it currently is.

func (EditSession) Undo

func (session EditSession) Undo(args ...interface{}) *js.Object

Undo is an undocumented Ace function.

func (EditSession) UndoChanges

func (session EditSession) UndoChanges(deltas []interface{}, dontSelect bool) Range

UndoChanges reverts previous changes to your document.

type Editor

type Editor struct {
	*js.Object
}

Editor is a wrapper for the Ace Editor type.

func Edit

func Edit(id string) Editor

Edit turns the object with the given ID into an Ace editor

func EditDOM

func EditDOM(obj interface{}) Editor

EditDOM turns the given object into an Ace editor

func (Editor) AddSelectionMarker

func (edit Editor) AddSelectionMarker(obj Range) Range

AddSelectionMarker adds the selection and cursor.

func (Editor) AlignCursors

func (edit Editor) AlignCursors()

AlignCursors aligns the cursors or selected text.

func (Editor) BlockOutdent

func (edit Editor) BlockOutdent()

BlockOutdent outdents the current line.

func (Editor) Blur

func (edit Editor) Blur()

Blur blurs the current `textInput`

func (Editor) CenterSelection

func (edit Editor) CenterSelection()

CenterSelection attempts to center the current selection on the screen.

func (Editor) ClearSelection

func (edit Editor) ClearSelection()

ClearSelection empties the selection (by de-selecting it). This function also emits the `change-selection` event

func (Editor) CopyLinesDown

func (edit Editor) CopyLinesDown() int

CopyLinesDown copies all the selected lines down one row.

func (Editor) CopyLinesUp

func (edit Editor) CopyLinesUp() int

CopyLinesUp copies all the selected lines up one row.

func (Editor) Destroy

func (edit Editor) Destroy()

Destroy cleans up the entire editor.

func (Editor) DuplicateSelection

func (edit Editor) DuplicateSelection(args ...interface{}) *js.Object

DuplicateSelection is an undocumented Ace function.

func (Editor) ExecCommand

func (edit Editor) ExecCommand(args ...interface{}) *js.Object

ExecCommand is an undocumented Ace function.

func (Editor) ExitMultiSelectMode

func (edit Editor) ExitMultiSelectMode()

ExitMultiSelectMode removes all selections except the last added one.

func (Editor) Find

func (edit Editor) Find(needle string, options interface{}, animate bool)

Find attempts to find `needle` within the document. For more information on `options`, see `Search`

func (Editor) FindAll

func (edit Editor) FindAll(needle string, the interface{}, keeps bool) int

FindAll finds and selects all the occurences of `needle`

func (Editor) FindNext

func (edit Editor) FindNext(options interface{}, animate bool)

FindNext performs another search for `needle` in the document. For more information on `options`, see `Search`.

func (Editor) FindPrevious

func (edit Editor) FindPrevious(options interface{}, animate bool)

FindPrevious performs a search for `needle` backwards. For more information on `options`, see `Search`.

func (Editor) Focus

func (edit Editor) Focus()

Focus brings the current `textInput` into focus.

func (Editor) ForEachSelection

func (edit Editor) ForEachSelection(cmd, args string)

ForEachSelection executes a command for each selection range

func (Editor) GetAnimatedScroll

func (edit Editor) GetAnimatedScroll(args ...interface{}) *js.Object

GetAnimatedScroll is an undocumented Ace function.

func (Editor) GetBehavioursEnabled

func (edit Editor) GetBehavioursEnabled() bool

GetBehavioursEnabled returns `true` if the behaviors are currently enabled. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.

func (Editor) GetCopyText

func (edit Editor) GetCopyText() string

GetCopyText returns the string of text currently highlighted.

func (Editor) GetCursorPosition

func (edit Editor) GetCursorPosition() *js.Object

GetCursorPosition get sthe current position of the cursor

func (Editor) GetCursorPositionScreen

func (edit Editor) GetCursorPositionScreen() int

GetCursorPositionScreen returns the screen position of the cursor

func (Editor) GetDisplayIndentGuides

func (edit Editor) GetDisplayIndentGuides(args ...interface{}) *js.Object

GetDisplayIndentGuides is an undocumented Ace function.

func (Editor) GetDragDelay

func (edit Editor) GetDragDelay() int

GetDragDelay returns the current mouse drag delay.

func (Editor) GetFadeFoldWidgets

func (edit Editor) GetFadeFoldWidgets(args ...interface{}) *js.Object

GetFadeFoldWidgets is an undocumented Ace function.

func (Editor) GetFirstVisibleRow

func (edit Editor) GetFirstVisibleRow() int

GetFirstVisibleRow returns the index of the first visible row.

func (Editor) GetHighlightActiveLine

func (edit Editor) GetHighlightActiveLine() bool

GetHighlightActiveLine returns `true` if the current lines are always highlighted.

func (Editor) GetHighlightGutterLine

func (edit Editor) GetHighlightGutterLine(args ...interface{}) *js.Object

GetHighlightGutterLine is an undocumented Ace function.

func (Editor) GetHighlightSelectedWord

func (edit Editor) GetHighlightSelectedWord() bool

GetHighlightSelectedWord returns `true` if currently highlighted words are to be highlighted.

func (Editor) GetKeyboardHandler

func (edit Editor) GetKeyboardHandler() string

GetKeyboardHandler returns the keyboard handler, such as "vim" or "windows"

func (Editor) GetLastSearchOptions

func (edit Editor) GetLastSearchOptions() *js.Object

GetLastSearchOptions returns an object containing all the search options. For more information on `options`, see `Search`.

func (Editor) GetLastVisibleRow

func (edit Editor) GetLastVisibleRow() int

GetLastVisibleRow returns the index of the last visible row.

func (Editor) GetNumberAt

func (edit Editor) GetNumberAt(row, column interface{}) int

GetNumberAt works like `EditSession.GetTokenAt()`, except it returns an integer.

func (Editor) GetOption

func (edit Editor) GetOption(optionName string) *js.Object

GetOption gets the option with teh given name.

func (Editor) GetOptions

func (edit Editor) GetOptions() *js.Object

GetOptions gets all options

func (Editor) GetOverwrite

func (edit Editor) GetOverwrite() bool

GetOverwrite returns `true` if overwrites are enabled; `false` otherwise.

func (Editor) GetPrintMarginColumn

func (edit Editor) GetPrintMarginColumn() int

GetPrintMarginColumn returns the column number of where the print margin is.

func (Editor) GetReadOnly

func (edit Editor) GetReadOnly() bool

GetReadOnly returns `true` if the editor is set to read-only mode.

func (Editor) GetScrollSpeed

func (edit Editor) GetScrollSpeed() int

GetScrollSpeed returns the value indicating how fast the mouse scroll speed is (in milliseconds).

func (Editor) GetSelection

func (edit Editor) GetSelection() *js.Object

GetSelection returns the selection object.

func (Editor) GetSelectionRange

func (edit Editor) GetSelectionRange() Range

GetSelectionRange returns the `Range` for the selected text.

func (Editor) GetSelectionStyle

func (edit Editor) GetSelectionStyle() string

GetSelectionStyle returns the current selection style.

func (Editor) GetSession

func (edit Editor) GetSession() EditSession

GetSession returns the EditSession object for the Editor

func (Editor) GetShowFoldWidgets

func (edit Editor) GetShowFoldWidgets() bool

GetShowFoldWidgets returns `true` if the fold widgets are shown.

func (Editor) GetShowInvisibles

func (edit Editor) GetShowInvisibles() bool

GetShowInvisibles returns `true` if invisible characters are being shown.

func (Editor) GetShowPrintMargin

func (edit Editor) GetShowPrintMargin() bool

GetShowPrintMargin returns `true` if the print margin is being shown.

func (Editor) GetTheme

func (edit Editor) GetTheme() string

GetTheme returns the content in the editor.

func (Editor) GetValue

func (edit Editor) GetValue() string

GetValue returns the path of the current theme.

func (Editor) GetWrapBehavioursEnabled

func (edit Editor) GetWrapBehavioursEnabled() bool

GetWrapBehavioursEnabled returns `true` if the wrapping behaviors are currently enabled.

func (Editor) GotoLine

func (edit Editor) GotoLine(lineNumber, column int, animate bool)

GotoLine moves the cursor to the specified line number, and also into the indiciated column.

func (Editor) GotoPageDown

func (edit Editor) GotoPageDown()

GotoPageDown shifts the document to wherever "page down" is, as well as moving the cursor position.

func (Editor) GotoPageUp

func (edit Editor) GotoPageUp()

GotoPageUp shifts the document to wherever "page up" is, as well as moving the cursor position.

func (Editor) Indent

func (edit Editor) Indent()

Indent indents the current line,

func (Editor) Insert

func (edit Editor) Insert(text string)

Insert inserts `text` into wherever the cursor is pointing.

func (Editor) IsFocused

func (edit Editor) IsFocused() bool

IsFocused returns `true` if the current `textInput` is in focus.

func (Editor) IsRowFullyVisible

func (edit Editor) IsRowFullyVisible(row int) bool

IsRowFullyVisible indicates if the entire row is currently visible on the screen.

func (Editor) IsRowVisible

func (edit Editor) IsRowVisible(row int) bool

IsRowVisible indicates if the row is currently visible on the screen.

func (Editor) JumpToMatching

func (edit Editor) JumpToMatching(sel interface{})

JumpToMatching moves the cursor's row and column to the next matching bracket.

func (Editor) ModifyNumber

func (edit Editor) ModifyNumber(amount int)

ModifyNumber - change the value of the character before the cursor by `amount` if it is a number.

func (Editor) MoveCursorTo

func (edit Editor) MoveCursorTo(row, column int)

MoveCursorTo moves the cursor to the specified row and column. Note that this does not de-select the current selection.

func (Editor) MoveCursorToPosition

func (edit Editor) MoveCursorToPosition(pos map[string]interface{})

MoveCursorToPosition moves the cursor to the position indicated by `pos.row` and `pos.column`.

func (Editor) MoveLinesDown

func (edit Editor) MoveLinesDown() int

MoveLinesDown shifts all the selected lines down one row.

func (Editor) MoveLinesUp

func (edit Editor) MoveLinesUp() int

MoveLinesUp shifts all the selected lines up one row.

func (Editor) MoveText

func (edit Editor) MoveText(args ...interface{}) *js.Object

MoveText is an undocumented Ace function.

func (Editor) NavigateDown

func (edit Editor) NavigateDown(times int)

NavigateDown moves the cursor down in the document the specified number of times. Note that this does de-select the current selection.

func (Editor) NavigateFileEnd

func (edit Editor) NavigateFileEnd()

NavigateFileEnd moves the cursor to the end of the current file. Note that this does de-select the current selection.

func (Editor) NavigateFileStart

func (edit Editor) NavigateFileStart()

NavigateFileStart moves the cursor to the start of the current file. Note that this does de-select the current selection.

func (Editor) NavigateLeft

func (edit Editor) NavigateLeft(times int)

NavigateLeft moves the cursor left in the document the specified number of times. Note that this does de-select the current selection.

func (Editor) NavigateLineEnd

func (edit Editor) NavigateLineEnd()

NavigateLineEnd moves the cursor to the end of the current line. Note that this does de-select the current selection.

func (Editor) NavigateLineStart

func (edit Editor) NavigateLineStart()

NavigateLineStart moves the cursor to the start of the current line. Note that this does de-select the current selection.

func (Editor) NavigateRight

func (edit Editor) NavigateRight(times int)

NavigateRight moves the cursor right in the document the specified number of times. Note that this does de-select the current selection.

func (Editor) NavigateTo

func (edit Editor) NavigateTo(row, column int)

NavigateTo moves the cursor to the specified row and column. Note that this does de-select the current selection.

func (Editor) NavigateUp

func (edit Editor) NavigateUp(times int)

NavigateUp moves the cursor up in the document the specified number of times. Note that this does de-select the current selection.

func (Editor) NavigateWordLeft

func (edit Editor) NavigateWordLeft()

NavigateWordLeft moves the cursor to the word immediately to the left of the current position. Note that this does de-select the current selection.

func (Editor) NavigateWordRight

func (edit Editor) NavigateWordRight()

NavigateWordRight moves the cursor to the word immediately to the right of the current position. Note that this does de-select the current selection.

func (Editor) On

func (edit Editor) On(on string, f interface{})

On binds the given function to the given Ace event.

func (Editor) OnBlur

func (edit Editor) OnBlur(f func())

OnBlur binds the given function to the Ace blur event.

func (Editor) OnChange

func (edit Editor) OnChange(f func(e *js.Object))

OnChange binds the given function to the Ace change event.

func (Editor) OnChangeSelectionStyle

func (edit Editor) OnChangeSelectionStyle(f func(data *js.Object))

OnChangeSelectionStyle binds the given function to the Ace changeSelectionStyle event.

func (Editor) OnChangeSession

func (edit Editor) OnChangeSession(f func(oldSession, session EditSession))

OnChangeSession binds the given function to the Ace changeSession event.

func (Editor) OnCopy

func (edit Editor) OnCopy(f func(text string))

OnCopy binds the given function to the Ace copy event.

func (Editor) OnFocus

func (edit Editor) OnFocus(f func())

OnFocus binds the given function to the Ace focus event.

func (Editor) OnPaste

func (edit Editor) OnPaste(f func(pasted string) string)

OnPaste binds the given function to the Ace paste event.

func (Editor) Redo

func (edit Editor) Redo()

Redo performs a redo operation on the document, reimplementing the last change.

func (Editor) Remove

func (edit Editor) Remove(dir string)

Remove removes words of text from the editor. A "word" is defined as a string of characters bookended by whitespace.

func (Editor) RemoveLines

func (edit Editor) RemoveLines()

RemoveLines removes all the lines in the current selection.

func (Editor) RemoveSelectionMarker

func (edit Editor) RemoveSelectionMarker(rangee Range)

RemoveSelectionMarker removes the selection marker.

func (Editor) RemoveToLineEnd

func (edit Editor) RemoveToLineEnd()

RemoveToLineEnd removes all the words to the right of the current selection, until the end of the line.

func (Editor) RemoveToLineLeft

func (edit Editor) RemoveToLineLeft()

RemoveToLineLeft removes the word directly to the left of the current selection.

func (Editor) RemoveToLineRight

func (edit Editor) RemoveToLineRight()

RemoveToLineRight removes the word directly to the right of the current selection.

func (Editor) RemoveToLineStart

func (edit Editor) RemoveToLineStart()

RemoveToLineStart removes all the words to the left of the current selection, until the start of the line.

func (Editor) Replace

func (edit Editor) Replace(replacement string, options interface{})

Replace replaces the first occurance of `options.needle` with the value in `replacement`.

func (Editor) ReplaceAll

func (edit Editor) ReplaceAll(replacement string, options interface{})

ReplaceAll replaces all occurances of `options.needle` with the value in `replacement`.

func (Editor) RevealRange

func (edit Editor) RevealRange(args ...interface{}) *js.Object

RevealRange is an undocumented Ace function.

func (Editor) ScrollPageDown

func (edit Editor) ScrollPageDown()

ScrollPageDown scrolls the document to wherever "page down" is, without changing the cursor position.

func (Editor) ScrollPageUp

func (edit Editor) ScrollPageUp()

ScrollPageUp scrolls the document to wherever "page up" is, without changing the cursor position.

func (Editor) ScrollToLine

func (edit Editor) ScrollToLine(line int, center, animate bool, callback func())

ScrollToLine scrolls to a line. If center is true, it puts the line in middle of screen (or attempts to).

func (Editor) ScrollToRow

func (edit Editor) ScrollToRow(row interface{})

ScrollToRow moves the editor to the specified row.

func (Editor) SelectAll

func (edit Editor) SelectAll()

SelectAll Selects all the text in editor.

func (Editor) SelectMore

func (edit Editor) SelectMore(dir int, skip bool)

SelectMore finds the next occurence of text in an active selection and adds it to the selections.

func (Editor) SelectMoreLines

func (edit Editor) SelectMoreLines(dir int, skip bool)

SelectMoreLines adds a cursor above or below the active cursor.

func (Editor) SelectPageDown

func (edit Editor) SelectPageDown()

SelectPageDown selects the text from the current position of the document until where a "page down" finishes.

func (Editor) SelectPageUp

func (edit Editor) SelectPageUp()

SelectPageUp selects the text from the current position of the document until where a "page up" finishes.

func (Editor) SetAnimatedScroll

func (edit Editor) SetAnimatedScroll(args ...interface{}) *js.Object

SetAnimatedScroll is an undocumented Ace function.

func (Editor) SetBehavioursEnabled

func (edit Editor) SetBehavioursEnabled(enabled bool)

SetBehavioursEnabled specifies whether to use behaviors or not. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.

func (Editor) SetDisplayIndentGuides

func (edit Editor) SetDisplayIndentGuides(args ...interface{}) *js.Object

SetDisplayIndentGuides is an undocumented Ace function.

func (Editor) SetDragDelay

func (edit Editor) SetDragDelay(dragDelay int)

SetDragDelay sets the delay (in milliseconds) of the mouse drag.

func (Editor) SetFadeFoldWidgets

func (edit Editor) SetFadeFoldWidgets(args ...interface{}) *js.Object

SetFadeFoldWidgets is an undocumented Ace function.

func (Editor) SetFontSize

func (edit Editor) SetFontSize(fontSize int)

SetFontSize sets a new font size (in pixels) for the text editor

func (Editor) SetHighlightActiveLine

func (edit Editor) SetHighlightActiveLine(shouldHighlight bool)

SetHighlightActiveLine determines whether or not the current line should be highlighted.

func (Editor) SetHighlightGutterLine

func (edit Editor) SetHighlightGutterLine()

SetHighlightGutterLine is an undocumented Ace function.

func (Editor) SetHighlightSelectedWord

func (edit Editor) SetHighlightSelectedWord(shouldHighlight bool)

SetHighlightSelectedWord determines if the currently selected word should be highlighted.

func (Editor) SetKeyboardHandler

func (edit Editor) SetKeyboardHandler(keyboardHandler string)

SetKeyboardHandler determines if the currently selected word should be highlighted.

func (Editor) SetOption

func (edit Editor) SetOption(optionName string, optionValue interface{})

SetOption sets an option.

func (Editor) SetOptions

func (edit Editor) SetOptions(options map[string]interface{})

SetOptions sets all options.

func (Editor) SetOverwrite

func (edit Editor) SetOverwrite(overwrite bool)

SetOverwrite - Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emits the `changeOverwrite` event.

func (Editor) SetPrintMarginColumn

func (edit Editor) SetPrintMarginColumn(showPrintMargin int)

SetPrintMarginColumn sets the column defining where the print margin should be.

func (Editor) SetReadOnly

func (edit Editor) SetReadOnly(readOnly bool)

SetReadOnly - If `readOnly` is true, then the editor is set to read-only mode, and none of the content can change.

func (Editor) SetScrollSpeed

func (edit Editor) SetScrollSpeed(speed int)

SetScrollSpeed sets how fast the mouse scrolling should do.

func (Editor) SetSelectionStyle

func (edit Editor) SetSelectionStyle(style string)

SetSelectionStyle indicates how selections should occur.

func (Editor) SetSession

func (edit Editor) SetSession(session EditSession)

SetSession sets a new editsession to use. This method also emits the `changeSession` event.

func (Editor) SetShowFoldWidgets

func (edit Editor) SetShowFoldWidgets(show bool)

SetShowFoldWidgets indicates whether the fold widgets are shown or not.

func (Editor) SetShowInvisibles

func (edit Editor) SetShowInvisibles(showInvisibles bool)

SetShowInvisibles - If `showInvisibles` is set to `true`, invisible characters—like spaces or new lines—are show in the editor.

func (Editor) SetShowPrintMargin

func (edit Editor) SetShowPrintMargin(showPrintMargin bool)

SetShowPrintMargin - If `showPrintMargin` is set to `true`, the print margin is shown in the editor.

func (Editor) SetStyle

func (edit Editor) SetStyle(style string)

SetStyle adds a new class, `style`, to the editor.

func (Editor) SetTheme

func (edit Editor) SetTheme(theme string)

SetTheme sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.

func (Editor) SetValue

func (edit Editor) SetValue(val string) string

SetValue sets the current document to `val`.

func (Editor) SetValuePos

func (edit Editor) SetValuePos(val string, pos int) string

SetValuePos sets the current document to `val`.

func (Editor) SetWrapBehavioursEnabled

func (edit Editor) SetWrapBehavioursEnabled(enabled bool)

SetWrapBehavioursEnabled specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets when such a character is typed in.

func (Editor) SortLines

func (edit Editor) SortLines(args ...interface{}) *js.Object

SortLines is an undocumented Ace function.

func (Editor) SplitLine

func (edit Editor) SplitLine()

SplitLine splits the line at the current selection (by inserting an `\n`).

func (Editor) ToLowerCase

func (edit Editor) ToLowerCase()

ToLowerCase converts the current selection entirely into lowercase.

func (Editor) ToUpperCase

func (edit Editor) ToUpperCase()

ToUpperCase converts the current selection entirely into uppercase.

func (Editor) ToggleCommentLines

func (edit Editor) ToggleCommentLines()

ToggleCommentLines either comments all the lines or uncomments all of them depending on the currently selected range.

func (Editor) ToggleOverwrite

func (edit Editor) ToggleOverwrite()

ToggleOverwrite sets the value of overwrite to the opposite of whatever it currently is.

func (Editor) TransposeLetters

func (edit Editor) TransposeLetters()

TransposeLetters transposes the current line.

func (Editor) TransposeSelections

func (edit Editor) TransposeSelections(dir int)

TransposeSelections transposes the selected ranges.

func (Editor) Undo

func (edit Editor) Undo()

Undo performs an undo operation on the document, reverting the last change.

func (Editor) UnsetStyle

func (edit Editor) UnsetStyle(style interface{})

UnsetStyle removes the class `style` from the editor.

func (Editor) UpdateSelectionMarkers

func (edit Editor) UpdateSelectionMarkers()

UpdateSelectionMarkers updates the cursor and marker layers.

type OptionProvider

type OptionProvider interface {
	SetOption(optionName string, optionValue interface{})
	SetOptions(map[string]interface{})
	GetOption(optionName string) *js.Object
	GetOptions() *js.Object
}

OptionProvider is the Ace optionProvider interface

type Range

type Range struct {
	*js.Object
}

Range is a wrapper for the Ace Range type.

func NewRange

func NewRange(startRow, startColumn, endRow, endColumn int) Range

NewRange returns a newly created Range object.

func (Range) ClipRows

func (r Range) ClipRows(firstRow, lastRow int) Range

ClipRows returns the part of the current `Range` that occurs within the boundaries of `firstRow` and `lastRow` as a new `Range` object.

func (Range) Clone

func (r Range) Clone() Range

Clone returns a duplicate of the calling range.

func (Range) CollapseRows

func (r Range) CollapseRows() Range

CollapseRows returns a range containing the starting and ending rows of the original range, but with a column value of `0`.

func (Range) Compare

func (r Range) Compare(row, column int) int

Compare checks the row and column points with the row and column points of the calling range.

func (Range) CompareEnd

func (r Range) CompareEnd(row, column int) int

CompareEnd checks the row and column points with the row and column points of the calling range.

func (Range) CompareInside

func (r Range) CompareInside(row, column int) int

CompareInside checks the row and column points with the row and column points of the calling range.

func (Range) ComparePoint

func (r Range) ComparePoint(p Range) int

ComparePoint checks the row and column points of `p` with the row and column points of the calling range.

func (Range) CompareRange

func (r Range) CompareRange(r2 Range) int

CompareRange compares this range with the given range.

func (Range) CompareStart

func (r Range) CompareStart(row, column int) int

CompareStart checks the row and column points with the row and column points of the calling range.

func (Range) Contains

func (r Range) Contains(row, column int) bool

Contains returns `true` if the `row` and `column` provided are within the given range. This can better be expressed as returning `true` if:

range.StartRow()    <= row    <= range.EndRow() &&
range.StartColumn() <= column <= range.EndColumn()

func (Range) ContainsRange

func (r Range) ContainsRange(r2 Range) bool

ContainsRange checks the start and end points of `range` and compares them to the calling range. Returns `true` if the `range` is contained within the caller's range.

func (Range) EndColumn

func (r Range) EndColumn() int

EndColumn returns the ending column of this Range object.

func (Range) EndRow

func (r Range) EndRow() int

EndRow returns the ending row of this Range object.

func (Range) Extend

func (r Range) Extend(row, column int) Range

Extend changes the row and column points for the calling range for both the starting and ending points.

func (Range) StartColumn

func (r Range) StartColumn() int

StartColumn returns the starting column of this Range object.

func (Range) StartRow

func (r Range) StartRow() int

StartRow returns the starting row of this Range object.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL