Documentation ¶
Index ¶
- func AutoIndent(ctx *Ctx) error
- func Backspace(ctx *Ctx) error
- func Comment(ctx *Ctx) error
- func Copy(ctx *Ctx) error
- func Cut(ctx *Ctx) error
- func Delete(ctx *Ctx) error
- func DuplicateLines(ctx *Ctx) error
- func EndOfLine(ctx *Ctx, sel bool) error
- func EndOfString(ctx *Ctx, sel bool)
- func Find(cctx context.Context, ctx *Ctx, str string) (bool, error)
- func HandleInput(ctx *Ctx, ev interface{}) (event.Handled, error)
- func InsertString(ctx *Ctx, s string) error
- func MoveCursorDown(ctx *Ctx, sel bool)
- func MoveCursorJumpLeft(ctx *Ctx, sel bool) error
- func MoveCursorJumpRight(ctx *Ctx, sel bool) error
- func MoveCursorLeft(ctx *Ctx, sel bool) error
- func MoveCursorRight(ctx *Ctx, sel bool) error
- func MoveCursorToPoint(ctx *Ctx, p image.Point, sel bool)
- func MoveCursorUp(ctx *Ctx, sel bool)
- func MoveLineDown(ctx *Ctx) error
- func MoveLineUp(ctx *Ctx) error
- func PageUp(ctx *Ctx, up bool)
- func Paste(ctx *Ctx, ci event.ClipboardIndex)
- func Redo(ctx *Ctx) error
- func RemoveLines(ctx *Ctx) error
- func Replace(ctx *Ctx, old, new string) (bool, error)
- func ScrollUp(ctx *Ctx, up bool)
- func SelectAll(ctx *Ctx) error
- func SelectLine(ctx *Ctx) error
- func SelectWord(ctx *Ctx) error
- func StartOfLine(ctx *Ctx, sel bool) error
- func StartOfString(ctx *Ctx, sel bool)
- func TabLeft(ctx *Ctx) error
- func TabRight(ctx *Ctx) error
- func Uncomment(ctx *Ctx) error
- func Undo(ctx *Ctx) error
- type Ctx
- type CtxFns
- type Cursor
- type Input
- type SimpleCursor
- func (c *SimpleCursor) Get() SimpleCursor
- func (c *SimpleCursor) HaveSelection() bool
- func (c *SimpleCursor) Index() int
- func (c *SimpleCursor) SelectionIndex() int
- func (c *SimpleCursor) SelectionIndexes() (int, int, bool)
- func (c *SimpleCursor) SelectionIndexesUnsorted() (int, int, bool)
- func (c *SimpleCursor) Set(c2 SimpleCursor)
- func (c *SimpleCursor) SetIndex(i int)
- func (c *SimpleCursor) SetIndexSelectionOff(i int)
- func (c *SimpleCursor) SetSelection(si, ci int)
- func (c *SimpleCursor) SetSelectionOff()
- func (c *SimpleCursor) UpdateSelection(on bool, ci int)
- type TriggerCursor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutoIndent ¶
func DuplicateLines ¶
func EndOfString ¶
func InsertString ¶
func MoveCursorDown ¶
func MoveCursorJumpLeft ¶
func MoveCursorJumpRight ¶
func MoveCursorLeft ¶
func MoveCursorRight ¶
func MoveCursorUp ¶
func MoveLineDown ¶
func MoveLineUp ¶
func Paste ¶
func Paste(ctx *Ctx, ci event.ClipboardIndex)
func RemoveLines ¶
func SelectLine ¶
func SelectWord ¶
func StartOfLine ¶
func StartOfString ¶
Types ¶
type Ctx ¶
type Ctx struct { RW iorw.ReadWriterAt C Cursor Fns CtxFns }
func (*Ctx) CursorSelectionLinesIndexes ¶
type CtxFns ¶
type CtxFns struct { Error func(error) GetPoint func(int) image.Point GetIndex func(image.Point) int LineHeight func() int LineCommentStr func() string MakeIndexVisible func(int) PageUp func(up bool) ScrollUp func(up bool) SetClipboardData func(event.ClipboardIndex, string) GetClipboardData func(event.ClipboardIndex, func(string, error)) // setter should wrap fn to run on ui goroutine Undo func() error Redo func() error }
func EmptyCtxFns ¶
func EmptyCtxFns() CtxFns
type Cursor ¶
type Cursor interface { Set(c SimpleCursor) Get() SimpleCursor Index() int SetIndex(int) SelectionIndex() int SetSelection(si, ci int) SetSelectionOff() SetIndexSelectionOff(i int) HaveSelection() bool UpdateSelection(on bool, ci int) SelectionIndexes() (int, int, bool) SelectionIndexesUnsorted() (int, int, bool) }
type SimpleCursor ¶
type SimpleCursor struct {
// contains filtered or unexported fields
}
func (*SimpleCursor) Get ¶
func (c *SimpleCursor) Get() SimpleCursor
func (*SimpleCursor) HaveSelection ¶
func (c *SimpleCursor) HaveSelection() bool
func (*SimpleCursor) Index ¶
func (c *SimpleCursor) Index() int
func (*SimpleCursor) SelectionIndex ¶
func (c *SimpleCursor) SelectionIndex() int
func (*SimpleCursor) SelectionIndexes ¶
func (c *SimpleCursor) SelectionIndexes() (int, int, bool)
Values returned are sorted
func (*SimpleCursor) SelectionIndexesUnsorted ¶
func (c *SimpleCursor) SelectionIndexesUnsorted() (int, int, bool)
func (*SimpleCursor) Set ¶
func (c *SimpleCursor) Set(c2 SimpleCursor)
func (*SimpleCursor) SetIndex ¶
func (c *SimpleCursor) SetIndex(i int)
func (*SimpleCursor) SetIndexSelectionOff ¶
func (c *SimpleCursor) SetIndexSelectionOff(i int)
func (*SimpleCursor) SetSelection ¶
func (c *SimpleCursor) SetSelection(si, ci int)
func (*SimpleCursor) SetSelectionOff ¶
func (c *SimpleCursor) SetSelectionOff()
func (*SimpleCursor) UpdateSelection ¶
func (c *SimpleCursor) UpdateSelection(on bool, ci int)
type TriggerCursor ¶
type TriggerCursor struct { *SimpleCursor // contains filtered or unexported fields }
func NewTriggerCursor ¶
func NewTriggerCursor(onChange func()) *TriggerCursor
func (*TriggerCursor) Set ¶
func (tc *TriggerCursor) Set(c SimpleCursor)
func (*TriggerCursor) SetIndex ¶
func (tc *TriggerCursor) SetIndex(i int)
func (*TriggerCursor) SetIndexSelectionOff ¶
func (tc *TriggerCursor) SetIndexSelectionOff(i int)
func (*TriggerCursor) SetSelection ¶
func (tc *TriggerCursor) SetSelection(si, ci int)
func (*TriggerCursor) SetSelectionOff ¶
func (tc *TriggerCursor) SetSelectionOff()
func (*TriggerCursor) UpdateSelection ¶
func (tc *TriggerCursor) UpdateSelection(on bool, ci int)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.