textarea

package
v0.0.0-...-99b4a15 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorCmd

func ErrorCmd(err error) tea.Cmd

Return an error. Will be displayed in the statusbar

func Event

func Event(T any) tea.Cmd

Return a message as an event

func StatusCmd

func StatusCmd(status string) tea.Cmd

Return a status string. Will be displayed in the statusbar

Types

type ErrorMsg

type ErrorMsg error

type EvtBufferSwitched

type EvtBufferSwitched string

type Model

type Model struct {
	Buffers       buffer.LinkedList // Linked list containing all buffers as displayed in the bufferline
	CurBuf        *buffer.Buffer    // Currently active buffer
	Focused       bool              // If focused, we react to events
	Height, Width int               // Size of the textarea
	Viewport      viewport.Model    // Scrollable viewport
}

func New

func New() Model

func (*Model) CurBufPath

func (m *Model) CurBufPath() string

CurBufPath returns the path of the currently active buffer

func (Model) Init

func (m Model) Init() tea.Cmd

func (*Model) OpenBuffer

func (m *Model) OpenBuffer(path string) tea.Cmd

OpenBuffer opens a new buffer for editing. If the buffer is already opened in one of our tabs, we just switch to the tab.

func (*Model) SwitchBuffer

func (m *Model) SwitchBuffer(path string) bool

SwitchBuffer tries to switch to the given buffer. Returns false if buffer doesn't exist

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type StatusMsg

type StatusMsg string

These two will be displayed in the status bar

Jump to

Keyboard shortcuts

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