Documentation
¶
Overview ¶
Package vi implements a simple vi / vim like editor in Go. Reusable library part of the gvi editor (cli).
Index ¶
- func FilterSpecialChars(str string) string
- type Buffer
- func (b *Buffer) Close() error
- func (b *Buffer) GetLines(start, num int) []string
- func (b *Buffer) InsertChars(v *Vi, lineNum, at int, text string) string
- func (b *Buffer) InsertLine(lineNum int, text string)
- func (b *Buffer) IsDirty() bool
- func (b *Buffer) NumLines() int
- func (b *Buffer) Open(filename string) error
- func (b *Buffer) Save() error
- type Mode
- type Vi
- func (v *Vi) Beep()
- func (v *Vi) CmdResult(msg string, args ...any)
- func (v *Vi) CommandStatus()
- func (v *Vi) HasEsc() int
- func (v *Vi) Insert(str string) (err error)
- func (v *Vi) NextTab(x int) int
- func (v *Vi) Open(filename string)
- func (v *Vi) Process() bool
- func (v *Vi) ProcessOne() bool
- func (v *Vi) ScreenAtToRune(x int, str string) int
- func (v *Vi) ScreenWidth(str string) int
- func (v *Vi) ShowError(msg string, err error)
- func (v *Vi) Update()
- func (v *Vi) UpdateRS() error
- func (v *Vi) UpdateStatus()
- func (v *Vi) UpdateTabs()
- func (v *Vi) VScroll(delta int)
- func (v *Vi) WriteBottom(msg string, args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterSpecialChars ¶ added in v0.4.0
Types ¶
type Buffer ¶ added in v0.2.0
type Buffer struct {
// contains filtered or unexported fields
}
Buffer represents a full buffer (file) in the editor. A view of it is shown in the terminal.
func (*Buffer) GetLines ¶ added in v0.2.0
GetLines returns the lines in the buffer from start to end.
func (*Buffer) InsertChars ¶ added in v0.4.0
Returns the full line if insert is in the middle, empty if that was already at the end. It makes most common typing (at the end/append) faster.
func (*Buffer) InsertLine ¶ added in v0.4.0
type Vi ¶
type Vi struct {
// contains filtered or unexported fields
}
func NewVi ¶
func NewVi(ap *ansipixels.AnsiPixels) *Vi
func (*Vi) CommandStatus ¶
func (v *Vi) CommandStatus()
func (*Vi) ProcessOne ¶ added in v0.5.1
func (*Vi) ScreenAtToRune ¶ added in v0.6.1
Translate a screen position to the byte offset of the rune in the current line.
func (*Vi) ScreenWidth ¶ added in v0.6.1
ScreenWidth calculates the screen width of a string, properly handling tabs, control characters, and multi-rune grapheme clusters.
func (*Vi) UpdateStatus ¶
func (v *Vi) UpdateStatus()
func (*Vi) UpdateTabs ¶ added in v0.6.1
func (v *Vi) UpdateTabs()
func (*Vi) WriteBottom ¶ added in v0.6.1
Click to show internal directories.
Click to hide internal directories.