Versions in this module Expand all Collapse all v2 v2.1.3 Sep 12, 2021 v2.1.2 Sep 12, 2021 v2.1.1 Sep 12, 2021 Changes in this version + const DSAdded + const DSDeletedAbove + const DSModified + const DSUnchanged + const FFAuto + const FFDos + const FFUnix + const LargeFileThreshold + const MTError + const MTInfo + const MTWarning + const TextEventInsert + const TextEventRemove + const TextEventReplace + var BTDefault = BufType + var BTHelp = BufType + var BTInfo = BufType + var BTLog = BufType + var BTRaw = BufType + var BTScratch = BufType + var BTStdout = BufType + var BracePairs = [][2]rune + var ErrFileTooLarge = errors.New("File is too large to hash") + func BufferComplete(b *Buffer) ([]string, []string) + func ByteOffset(pos Loc, buf *Buffer) int + func DiffLA(a, b Loc, buf *LineArray) int + func ExecuteTextEvent(t *TextEvent, buf *SharedBuffer) + func FileComplete(b *Buffer) ([]string, []string) + func GetArg(b *Buffer) (string, int) + func GetWord(b *Buffer) ([]byte, int) + func InBounds(pos Loc, buf *Buffer) bool + func SetMessager(m Messager) + func WriteLog(s string) + type BufType struct + Kind int + Readonly bool + Scratch bool + Syntax bool + type Buffer struct + GetVisualX func(loc Loc) int + OptionCallback func(option string, nativeValue interface{}) + StartCursor Loc + var LogBuf *Buffer + var OpenBuffers []*Buffer + func GetLogBuf() *Buffer + func NewBuffer(r io.Reader, size int64, path string, startcursor Loc, btype BufType) *Buffer + func NewBufferFromFile(path string, btype BufType) (*Buffer, error) + func NewBufferFromFileAtLoc(path string, btype BufType, cursorLoc Loc) (*Buffer, error) + func NewBufferFromString(text, path string, btype BufType) *Buffer + func NewBufferFromStringAtLoc(text, path string, btype BufType, cursorLoc Loc) *Buffer + func (b *Buffer) AddCursor(c *Cursor) + func (b *Buffer) AddMessage(m *Message) + func (b *Buffer) ApplyBackup(fsize int64) (bool, bool) + func (b *Buffer) Autocomplete(c Completer) bool + func (b *Buffer) Backup() error + func (b *Buffer) ClearAllMessages() + func (b *Buffer) ClearCursors() + func (b *Buffer) ClearMatches() + func (b *Buffer) ClearMessages(owner string) + func (b *Buffer) Close() + func (b *Buffer) CycleAutocomplete(forward bool) + func (b *Buffer) DiffStatus(lineN int) DiffStatus + func (b *Buffer) ExternallyModified() bool + func (b *Buffer) FileType() string + func (b *Buffer) FindMatchingBrace(braceType [2]rune, start Loc) (Loc, bool, bool) + func (b *Buffer) FindNext(s string, start, end, from Loc, down bool, useRegex bool) ([2]Loc, bool, error) + func (b *Buffer) Fini() + func (b *Buffer) GetActiveCursor() *Cursor + func (b *Buffer) GetCursor(n int) *Cursor + func (b *Buffer) GetCursors() []*Cursor + func (b *Buffer) GetName() string + func (b *Buffer) GetSuggestions() + func (b *Buffer) IndentString(tabsize int) string + func (b *Buffer) Insert(start Loc, text string) + func (b *Buffer) Line(i int) string + func (b *Buffer) MergeCursors() + func (b *Buffer) Modified() bool + func (b *Buffer) MoveLinesDown(start int, end int) + func (b *Buffer) MoveLinesUp(start int, end int) + func (b *Buffer) NumCursors() int + func (b *Buffer) ReOpen() error + func (b *Buffer) RelocateCursors() + func (b *Buffer) Remove(start, end Loc) + func (b *Buffer) RemoveBackup() + func (b *Buffer) RemoveCursor(i int) + func (b *Buffer) ReplaceRegex(start, end Loc, search *regexp.Regexp, replace []byte) (int, int) + func (b *Buffer) RequestBackup() + func (b *Buffer) Retab() + func (b *Buffer) RuneAt(loc Loc) rune + func (b *Buffer) Save() error + func (b *Buffer) SaveAs(filename string) error + func (b *Buffer) SaveAsWithSudo(filename string) error + func (b *Buffer) SaveWithSudo() error + func (b *Buffer) Serialize() error + func (b *Buffer) SetCurCursor(n int) + func (b *Buffer) SetCursors(c []*Cursor) + func (b *Buffer) SetDiffBase(diffBase []byte) + func (b *Buffer) SetName(s string) + func (b *Buffer) SetOption(option, value string) error + func (b *Buffer) SetOptionNative(option string, nativeValue interface{}) error + func (b *Buffer) Size() int + func (b *Buffer) Unserialize() error + func (b *Buffer) UpdateCursors() + func (b *Buffer) UpdateDiff(callback func(bool)) + func (b *Buffer) UpdateModTime() (err error) + func (b *Buffer) UpdateRules() + func (b *Buffer) WordAt(loc Loc) []byte + func (b *Buffer) Write(bytes []byte) (n int, err error) + type Completer func(*Buffer) ([]string, []string) + type Cursor struct + CurSelection [2]Loc + LastVisualX int + Num int + OrigSelection [2]Loc + func NewCursor(b *Buffer, l Loc) *Cursor + func (c *Cursor) AddLineToSelection() + func (c *Cursor) AddWordToSelection() + func (c *Cursor) Buf() *Buffer + func (c *Cursor) CopySelection(target clipboard.Register) + func (c *Cursor) DeleteSelection() + func (c *Cursor) Deselect(start bool) + func (c *Cursor) Down() + func (c *Cursor) DownN(amount int) + func (c *Cursor) End() + func (c *Cursor) GetCharPosInLine(b []byte, visualPos int) int + func (c *Cursor) GetSelection() []byte + func (c *Cursor) GetVisualX() int + func (c *Cursor) Goto(b Cursor) + func (c *Cursor) GotoLoc(l Loc) + func (c *Cursor) HasSelection() bool + func (c *Cursor) IsStartOfText() bool + func (c *Cursor) Left() + func (c *Cursor) Relocate() + func (c *Cursor) ResetSelection() + func (c *Cursor) Right() + func (c *Cursor) RuneUnder(x int) rune + func (c *Cursor) SelectLine() + func (c *Cursor) SelectTo(loc Loc) + func (c *Cursor) SelectWord() + func (c *Cursor) SetBuf(b *Buffer) + func (c *Cursor) SetSelectionEnd(pos Loc) + func (c *Cursor) SetSelectionStart(pos Loc) + func (c *Cursor) Start() + func (c *Cursor) StartOfText() + func (c *Cursor) StoreVisualX() + func (c *Cursor) Up() + func (c *Cursor) UpN(amount int) + func (c *Cursor) WordLeft() + func (c *Cursor) WordRight() + type Delta struct + End Loc + Start Loc + Text []byte + type DiffStatus byte + type Element struct + Next *Element + Value *TextEvent + type EventHandler struct + RedoStack *TEStack + UndoStack *TEStack + func NewEventHandler(buf *SharedBuffer, cursors []*Cursor) *EventHandler + func (eh *EventHandler) ApplyDiff(new string) + func (eh *EventHandler) DoTextEvent(t *TextEvent, useUndo bool) + func (eh *EventHandler) Execute(t *TextEvent) + func (eh *EventHandler) Insert(start Loc, textStr string) + func (eh *EventHandler) InsertBytes(start Loc, text []byte) + func (eh *EventHandler) MultipleReplace(deltas []Delta) + func (eh *EventHandler) Redo() + func (eh *EventHandler) RedoOneEvent() + func (eh *EventHandler) Remove(start, end Loc) + func (eh *EventHandler) Replace(start, end Loc, replace string) + func (eh *EventHandler) Undo() + func (eh *EventHandler) UndoOneEvent() + func (eh *EventHandler) UndoTextEvent(t *TextEvent) + type FileFormat byte + type Line struct + func Append(slice []Line, data ...Line) []Line + type LineArray struct + Endings FileFormat + func NewLineArray(size uint64, endings FileFormat, reader io.Reader) *LineArray + func (la *LineArray) Bytes() []byte + func (la *LineArray) End() Loc + func (la *LineArray) LineBytes(n int) []byte + func (la *LineArray) LinesNum() int + func (la *LineArray) Match(lineN int) highlight.LineMatch + func (la *LineArray) Rehighlight(lineN int) bool + func (la *LineArray) SetMatch(lineN int, m highlight.LineMatch) + func (la *LineArray) SetRehighlight(lineN int, on bool) + func (la *LineArray) SetState(lineN int, s highlight.State) + func (la *LineArray) Start() Loc + func (la *LineArray) State(lineN int) highlight.State + func (la *LineArray) Substr(start, end Loc) []byte + type Loc struct + X int + Y int + func ParseCursorLocation(cursorPositions []string) (Loc, error) + func (l Loc) Diff(b Loc, buf *Buffer) int + func (l Loc) GreaterEqual(b Loc) bool + func (l Loc) GreaterThan(b Loc) bool + func (l Loc) LessEqual(b Loc) bool + func (l Loc) LessThan(b Loc) bool + func (l Loc) Move(n int, buf *Buffer) Loc + func (l Loc) MoveLA(n int, buf *LineArray) Loc + type Message struct + End Loc + Kind MsgType + Msg string + Owner string + Start Loc + func NewMessage(owner string, msg string, start, end Loc, kind MsgType) *Message + func NewMessageAtLine(owner string, msg string, line int, kind MsgType) *Message + func (m *Message) Style() tcell.Style + type Messager interface + Message func(msg ...interface{}) + type MsgType int + type SerializedBuffer struct + Cursor Loc + EventHandler *EventHandler + ModTime time.Time + type SharedBuffer struct + AbsPath string + Completions []string + CurSuggestion int + HasSuggestions bool + Highlighter *highlight.Highlighter + Messages []*Message + ModTime time.Time + ModifiedThisFrame bool + Path string + ReloadDisabled bool + Settings map[string]interface{} + Suggestions []string + SyntaxDef *highlight.Def + Type BufType + func (b *SharedBuffer) DisableReload() + func (b *SharedBuffer) MarkModified(start, end int) + type TEStack struct + Size int + Top *Element + func (s *TEStack) Len() int + func (s *TEStack) Peek() *TextEvent + func (s *TEStack) Pop() (value *TextEvent) + func (s *TEStack) Push(value *TextEvent) + type TextEvent struct + C Cursor + Deltas []Delta + EventType int + Time time.Time