Documentation
¶
Overview ¶
The Editor provides the interface for navigating/editing the math equation, that an app can then bind controls to such methods
Index ¶
- Constants
- type Direction
- type Editor
- func (e *Editor) DeleteBack()
- func (e *Editor) FocusedTextField() latex.RunesContainer
- func (e *Editor) GetState() editorState
- func (e *Editor) InsertCmd(cmd string)
- func (e *Editor) InsertFrac(detectNumerator bool)
- func (e Editor) LatexSource() string
- func (e *Editor) NavigateDown()
- func (e *Editor) NavigateLeft() bool
- func (e *Editor) NavigateRight() bool
- func (e *Editor) NavigateToBeginning()
- func (e *Editor) NavigateToEnd()
- func (e *Editor) NavigateUp()
- func (e *Editor) Read(latex string)
- func (e *Editor) Renderer() *renderer.Renderer
- func (e *Editor) SetFocus(f bool)
- func (e Editor) Update(msg tea.Msg) (Editor, tea.Cmd)
- func (e Editor) View() string
- type EditorConfig
Constants ¶
const ( DIR_LEFT Direction = iota DIR_RIGHT // TODO rename/use container type? EDIT_EQUATION editorState = iota // equation editing mode (normal) EDIT_TEXT EDIT_COMMAND )
const KeybindsHelp = `` /* 287-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Editor ¶
type Editor struct {
// contains filtered or unexported fields
}
func NewWithConfig ¶
func NewWithConfig(cfg EditorConfig, formula string) *Editor
func (*Editor) DeleteBack ¶
func (e *Editor) DeleteBack()
func (*Editor) FocusedTextField ¶
func (e *Editor) FocusedTextField() latex.RunesContainer
Returns the currently focused text field (RunesContainer) or nil
func (*Editor) GetState ¶
func (e *Editor) GetState() editorState
gets the 'state' of the editor, e.g. inserting a command/text node, or in normal equation node
func (*Editor) InsertFrac ¶
func (Editor) LatexSource ¶
func (*Editor) NavigateDown ¶
func (e *Editor) NavigateDown()
func (*Editor) NavigateLeft ¶
Navigates cursor to the left, exits a parent container if there is no left sibling Enters a Container if left sibling is one that allows entering Does nothing and returns false if we're the first child of the root node
func (*Editor) NavigateRight ¶
Navigates cursor to the right, exits a parent container if there is no right sibling Enters a Container if right sibling is one that allows entering Does nothing and returns false if we're the last child of the root node
func (*Editor) NavigateToBeginning ¶
func (e *Editor) NavigateToBeginning()
func (*Editor) NavigateToEnd ¶
func (e *Editor) NavigateToEnd()
func (*Editor) NavigateUp ¶
func (e *Editor) NavigateUp()
type EditorConfig ¶
type EditorConfig struct {
*log.Logger
LatexCfg render.LatexSourceConfig
}