# Functions
Append efficiently appends lines together It allocates an additional 10000 lines if the original estimate is incorrect.
BufferComplete autocompletes based on previous words in the buffer.
ByteOffset is just like ToCharPos except it counts bytes instead of runes.
CloseOpenBuffers removes all open buffers.
Diff returns the distance between two locations.
ExecuteTextEvent runs a text event.
FileComplete autocompletes filenames.
GetLogBuf returns the log buffer.
InBounds returns whether the given location is a valid character position in the given buffer.
NewBuffer creates a new buffer from a given reader with a given path Ensure that ReadSettings and InitGlobalSettings have been called before creating a new buffer Places the cursor at startcursor.
NewBufferFromFile opens a new buffer using the given path It will also automatically handle `~`, and line/column with filename:l:c It will return an empty buffer if the path does not exist and an error if the file is a directory.
NewBufferFromFileAtLoc opens a new buffer with a given cursor location If cursorLoc is {-1, -1} the location does not overwrite what the cursor location would otherwise be (start of file, or saved cursor position if `savecursor` is enabled).
NewBufferFromString creates a new buffer containing the given string.
NewBufferFromStringAtLoc creates a new buffer containing the given string with a cursor loc.
No description provided by the author
NewEventHandler returns a new EventHandler.
NewLineArray returns a new line array from an array of bytes.
NewMessage creates a new gutter message.
NewMessageAtLine creates a new gutter message at a given line.
ParseCursorLocation turns a cursor location like 10:5 (LINE:COL) into a loc.
No description provided by the author
WriteLog writes a string to the log buffer.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Autodetect format.
CRLF line endings (dos style '\r\n').
LF line endings (unix style '\n').
LargeFileThreshold is the number of bytes when fastdirty is forced because hashing is too slow.
No description provided by the author
No description provided by the author
No description provided by the author
TextEventInsert represents an insertion event.
TextEventRemove represents a deletion event.
TextEventReplace represents a replace event.
# Variables
No description provided by the author
BTDefault is a default buffer.
BTHelp is a help buffer.
BTInfo is a buffer for inputting information.
BTLog is a log buffer.
BTRaw is a buffer that shows raw terminal events.
BTScratch is a buffer that cannot be saved (for scratch work).
BTStdout is a buffer that only writes to stdout when closed.
LogBuf is a reference to the log buffer which can be opened with the `> log` command.
OpenBuffers is a list of the currently open buffers.
# Structs
Buffer stores the main information about a currently open file including the actual text (in a LineArray), the undo/redo stack (in an EventHandler) all the cursors, the syntax highlighting info, the settings for the buffer and some misc info about modification time and path location.
The BufType defines what kind of buffer this is.
The Cursor struct stores the location of the cursor in the buffer as well as the selection.
A Delta is a change to the buffer.
An Element which is stored in the Stack.
EventHandler executes text manipulations and allows undoing and redoing.
A Line contains the data in bytes as well as a highlight state, match and a flag for whether the highlighting needs to be updated.
A LineArray simply stores and array of lines and makes it easy to insert and delete in it.
Loc stores a location.
Message represents the information for a gutter message.
The SerializedBuffer holds the types that get serialized when a buffer is saved These are used for the savecursor and saveundo options.
SharedBuffer is a struct containing info that is shared among buffers that have the same file open.
TEStack is a simple implementation of a LIFO stack for text events.
TextEvent holds data for a manipulation on some text that can be undone.
# Interfaces
No description provided by the author
# Type aliases
A Completer is a function that takes a buffer and returns info describing what autocompletions should be inserted at the current cursor location It returns a list of string suggestions which will be inserted at the current cursor location if selected as well as a list of suggestion names which can be displayed in an autocomplete box or other UI element.
No description provided by the author
No description provided by the author
No description provided by the author