Documentation ¶
Index ¶
- Constants
- Variables
- type NeoVim
- func (n *NeoVim) ChangeVisualGridSize(targetRow, targetCol int)
- func (n *NeoVim) ClearGrid()
- func (n *NeoVim) CreateRenderer() fyne.WidgetRenderer
- func (n *NeoVim) FocusGained()
- func (n *NeoVim) FocusLost()
- func (n *NeoVim) HandleNvimEvent(event []interface{})
- func (n *NeoVim) MoveGridCursor(oldRow, oldCol, newRow, newCol int)
- func (n *NeoVim) Resize(s fyne.Size)
- func (n *NeoVim) ScrollGrid(top, bot, left, right, rows int)
- func (n *NeoVim) Tapped(ev *fyne.PointEvent)
- func (n *NeoVim) TypedKey(e *fyne.KeyEvent)
- func (n *NeoVim) TypedRune(r rune)
- func (n *NeoVim) TypedShortcut(s fyne.Shortcut)
- func (n *NeoVim) WriteGridLine(row, col int, cells []interface{})
Constants ¶
const GLOBAL_GRID = 1
As long as multigrid isn't used there will only be one grid
const MIN_COLS = 13
const MIN_ROWS = 1
According to https://neovim.io/doc/user/options.html it seems that neovim is supposed to have at least 12 columns and 1 row In practice the neovim client didn't work with less than 13x1
Variables ¶
var RGBA_SENTINEL = color.RGBA{255, 255, 255, 0}
The sentinel value for Fg, Bg and Special to indicate that the coloris not set i.e. the default color should be used
Functions ¶
This section is empty.
Types ¶
type NeoVim ¶
type NeoVim struct { // Widget requirements widget.BaseWidget // Additional fields // It is standard in a Fyne widget to export the fields which define // behaviour (just like the primitives defined in the canvas package). Engine *nvim.Nvim // contains filtered or unexported fields }
func (*NeoVim) ChangeVisualGridSize ¶
Changes the size of the textgrid, creating or removing rows and columns as needed TODO: One may consider only downsizing rows/cols if the difference is significant
func (*NeoVim) CreateRenderer ¶
func (n *NeoVim) CreateRenderer() fyne.WidgetRenderer
CreateRenderer implements fyne.Widget
func (*NeoVim) FocusGained ¶
func (n *NeoVim) FocusGained()
FocusGained implements fyne.Focusable FocusGained is a hook called by the focus handling logic after this object gained the focus.
func (*NeoVim) FocusLost ¶
func (n *NeoVim) FocusLost()
FocusGained implements fyne.Focusable FocusLost is a hook called by the focus handling logic after this object lost the focus.
func (*NeoVim) HandleNvimEvent ¶
func (n *NeoVim) HandleNvimEvent(event []interface{})
Handles events for the NeoVim instance Currently only the following event groups are handled: - Global Events - Grid Events (line-based) For the documentation of the events see: https://neovim.io/doc/user/ui.html The go client calls this function sequentially for each event, so we don't have to worry about preserving order
func (*NeoVim) MoveGridCursor ¶
Recovers the previous locations colors on horizontal movement and updates the cursor position
func (*NeoVim) ScrollGrid ¶
Moves the displayed text up/down/lef/right
func (*NeoVim) Tapped ¶
func (n *NeoVim) Tapped(ev *fyne.PointEvent)
Tapped implements fyne.Tappable Tapped makes sure we ask for focus if user taps us.
func (*NeoVim) TypedKey ¶
func (n *NeoVim) TypedKey(e *fyne.KeyEvent)
FocusGained implements fyne.Focusable TypedKey is a hook called by the input handling logic on key events if this object is focused.
func (*NeoVim) TypedRune ¶
FocusGained implements fyne.Focusable TypedRune is a hook called by the input handling logic on text input events if this object is focused.
func (*NeoVim) TypedShortcut ¶
func (n *NeoVim) TypedShortcut(s fyne.Shortcut)
TypedShortcut implements fyne.Shortcutable TypedShortcut handle the registered shortcut TODO : There are other shortcuts e.g. SelectAll (Cmd+A)
func (*NeoVim) WriteGridLine ¶
Writes a line of text (as defined by neovims ui events) to the textgrid