Documentation ¶
Overview ¶
Package editor implements an editor widget which can also be used as a pager.
Index ¶
- type CursorEvent
- type Editor
- func (a *Editor) Draw()
- func (e *Editor) EnableCursor(on bool)
- func (e *Editor) GetCursor() (int, int)
- func (a *Editor) HandleEvent(e tcell.Event) bool
- func (e *Editor) HideCursor(on bool)
- func (e *Editor) Init()
- func (a *Editor) MakeCursorVisible()
- func (a *Editor) MakeVisible(x, y int)
- func (a *Editor) Resize()
- func (e *Editor) SetContent(b []byte)
- func (a *Editor) SetCursor(x, y int)
- func (a *Editor) SetCursorX(x int)
- func (a *Editor) SetCursorY(y int)
- func (a *Editor) SetModel(model views.CellModel)
- func (e *Editor) SetStyle(style tcell.Style)
- func (a *Editor) SetView(view views.View)
- func (a *Editor) Size() (int, int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CursorEvent ¶
CursorEvent reports a changed cursor event.
func (*CursorEvent) SetWidget ¶
func (cev *CursorEvent) SetWidget(widget views.Widget)
SetWidget set the views.Widget for the CursorEvent.
func (*CursorEvent) Widget ¶
func (cev *CursorEvent) Widget() views.Widget
Widget returns the views.Widget for the CursorEvent.
type Editor ¶
type Editor struct {
// contains filtered or unexported fields
}
Editor is an editor widget.
func (*Editor) EnableCursor ¶
EnableCursor enables a soft cursor in the Editor.
func (*Editor) HandleEvent ¶
HandleEvent handles events. In particular, it handles certain key events to move the cursor or pan the view.
func (*Editor) HideCursor ¶
HideCursor hides or shows the cursor in the Editor. If on is true, the cursor is hidden. Note that a cursor is only shown if it is enabled.
func (*Editor) MakeCursorVisible ¶
func (a *Editor) MakeCursorVisible()
MakeCursorVisible ensures that the cursor is visible, panning the ViewPort as necessary, if the cursor is enabled.
func (*Editor) MakeVisible ¶
func (a *Editor) MakeVisible(x, y int)
MakeVisible makes the given coordinates visible, if they are not already. It does this by moving the ViewPort for the textBufferView.
func (*Editor) Resize ¶
func (a *Editor) Resize()
Resize is called when the View is resized. It will ensure that the cursor is visible, if present.
func (*Editor) SetCursor ¶
func (a *Editor) SetCursor(x, y int)
SetCursor sets the the cursor position.
func (*Editor) SetCursorX ¶
func (a *Editor) SetCursorX(x int)
SetCursorX sets the the cursor column.