editor

package
v0.0.0-...-c88107b Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Editor

type Editor struct {
	vecty.Core

	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

func (ed *Editor) Focus()

Focus sets focus to the control

func (*Editor) GetSelection

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

GetSelection gets text selection

func (*Editor) Highlight

func (ed *Editor) Highlight(on bool)

Highlight applies highlighting to the editor

func (*Editor) InsertText

func (ed *Editor) InsertText(text string)

InsertText inserts text in place of selection

func (*Editor) Mount

func (ed *Editor) Mount()

Mount implements the vecty.Mounter interface.

func (*Editor) Redo

func (ed *Editor) Redo()

Redo does one redo step

func (*Editor) Render

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

Render implements the vecty.Component interface.

func (*Editor) ResizeTextarea

func (ed *Editor) ResizeTextarea()

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

func (*Editor) SetSelection

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

SetSelection sets text selection

func (*Editor) SetState

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

SetState replaces the editor text and sets selection

func (*Editor) SetText

func (ed *Editor) SetText(text string)

SetText replaces the editor text

func (*Editor) Undo

func (ed *Editor) Undo()

Undo does one undo step

func (*Editor) WrapSelection

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

WrapSelection wraps selection with the provided starting and ending text snippets

type Shadow

type Shadow struct {
	*js.Object
}

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

func (*Shadow) GetHeight

func (s *Shadow) GetHeight() int

GetHeight gets the height of the shadow div in pixels

func (*Shadow) SetValue

func (s *Shadow) SetValue(html string)

SetValue sets the inner HTML (highlighted code)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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