goplayspace: Index | Files | Directories

package editor

import ""


Package Files

editor.go shadow.go state.go

type Editor Uses

type Editor struct {

    Range            *ranges.Range   `vecty:"prop"`
    HighlightingMode bool            `vecty:"prop"`
    ReadonlyMode     bool            `vecty:"prop"`
    ErrorLines       map[string]bool `vecty:"prop"`
    WarningLines     map[string]bool `vecty:"prop"`
    UndoStack        *undo.Stack     `vecty:"prop"`
    ChangeTimer      **time.Timer    // note this is a pointer to a pointer

    Highlighter     func(s string) string `vecty:"prop"`
    OnTopicChange   func(topic string)
    OnChange        func(value string)
    OnLineSelChange func(value string)
    OnKeyDown       func(e *vecty.Event)
    // contains filtered or unexported fields

Editor implements editor logic

func (*Editor) Focus Uses

func (ed *Editor) Focus()

Focus sets focus to the control

func (*Editor) GetSelection Uses

func (ed *Editor) GetSelection() (start, end int)

GetSelection gets text selection

func (*Editor) Highlight Uses

func (ed *Editor) Highlight(on bool)

Highlight applies highlighting to the editor

func (*Editor) InsertText Uses

func (ed *Editor) InsertText(text string)

InsertText inserts text in place of selection

func (*Editor) Mount Uses

func (ed *Editor) Mount()

Mount implements the vecty.Mounter interface.

func (*Editor) Redo Uses

func (ed *Editor) Redo()

Redo does one redo step

func (*Editor) Render Uses

func (ed *Editor) Render() vecty.ComponentOrHTML

Render implements the vecty.Component interface.

func (*Editor) ResizeTextarea Uses

func (ed *Editor) ResizeTextarea()

ResizeTextarea resizes the height of the textarea to match the computed height of the shadow

func (*Editor) SetSelection Uses

func (ed *Editor) SetSelection(start, end int)

SetSelection sets text selection

func (*Editor) SetState Uses

func (ed *Editor) SetState(text string, selStart, selEnd int)

SetState replaces the editor text and sets selection

func (*Editor) SetText Uses

func (ed *Editor) SetText(text string)

SetText replaces the editor text

func (*Editor) Undo Uses

func (ed *Editor) Undo()

Undo does one undo step

func (*Editor) WrapSelection Uses

func (ed *Editor) WrapSelection(begin, end string)

WrapSelection wraps selection with the provided starting and ending text snippets

type Shadow Uses

type Shadow struct {

Shadow contains the logic behind the shadow syntax highlighter exposed on the application page under '.shadow' class

func (*Shadow) GetHeight Uses

func (s *Shadow) GetHeight() int

GetHeight gets the height of the shadow div in pixels

func (*Shadow) SetValue Uses

func (s *Shadow) SetValue(html string)

SetValue sets the inner HTML (highlighted code)



Package editor imports 14 packages (graph) and is imported by 1 packages. Updated 2018-01-01. Refresh now. Tools for package owners.