# README
Resto body editor
The body editor is a simple text editor that can be used to edit the body of a resto. built on top of micro editor.
# Packages
No description provided by the author
# Functions
Abs is a simple absolute value function for ints.
Append efficiently appends lines together It allocates an additional 10000 lines if the original estimate is incorrect.
ByteOffset is just like ToCharPos except it counts bytes instead of runes.
CommonSubstring gets a common substring among the inputs.
Contains returns whether or not a string array contains a given string.
Count returns the length of a string in runes This is exactly equivalent to utf8.RuneCountInString(), just less characters.
DefaultLocalSettings returns the default local settings Note that filetype is a local only option.
Diff returns the distance between two locations.
EscapePath replaces every path separator in a given path with a %.
ExecuteTextEvent runs a text event.
FromCharPos converts from a character position to an x, y position.
FSize gets the size of a file.
FuncName returns the full name of a given function object.
GetColor takes in a syntax group and returns the colorscheme's style for that group.
GetColor256 returns the tcell color for a number between 0 and 255.
GetLeadingWhitespace returns the leading whitespace of the given string.
GetModTime returns the last modification time for a given file It also returns a boolean if there was a problem accessing the file.
GetPathAndCursorPosition returns a filename without everything following a `:` This is used for opening files like util.go:10:5 to specify a line and column Special cases like Windows Absolute path (C:\myfile.txt:10:5) are handled correctly.
InBounds returns whether the given location is a valid character position in the given buffer.
Insert makes a simple insert into a string at the given position.
IsSpaces checks if a given string is only spaces.
IsSpacesOrTabs checks if a given string contains only spaces and tabs.
IsStrWhitespace returns true if the given string is all whitespace.
IsWhitespace returns true if the given rune is a space, tab, or newline.
IsWordChar returns whether or not the string is a 'word character' If it is a unicode character, then it does not match Word characters are defined as [A-Za-z0-9_].
MakeRelative will attempt to make a relative path between path and base.
Max takes the max of two ints.
Min takes the min of two ints.
NewBuffer creates a new buffer from a given reader.
NewBufferFromString creates a new buffer containing the given string.
NewEventHandler returns a new EventHandler.
NewKeyBindings returns a new set of keybindings from the given set of binding descriptions.
NewLineArray returns a new line array from an array of bytes.
NewRuntimeFiles creates a new set of runtime files from the colorscheme and syntax files present in the given http.Filesystme.
NewView returns a new view with the specified buffer.
NumOccurrences counts the number of occurrences of a byte in a string.
ParseBool is almost exactly like strconv.ParseBool, except it also accepts 'on' and 'off' as 'true' and 'false' respectively.
ParseColorscheme parses the text definition for a colorscheme and returns the corresponding object Colorschemes are made up of color-link statements linking a color group to a list of colors For example, color-link keyword (blue,red) makes all keywords have a blue foreground and red background.
SetDefaultColorscheme sets the current default colorscheme for new Views.
ShortFuncName returns the name only of a given function object.
ShowMultiCursor will display a cursor at a location If i == 0 then the terminal cursor will be used Otherwise a fake cursor will be drawn at the position.
Spaces returns a string with n spaces.
StringToColor returns a tcell color from a string representation of a color We accept either bright..
StringToStyle returns a style from a string The strings must be in the format "extra foregroundcolor,backgroundcolor" The 'extra' can be bold, reverse, or underline.
StringWidth returns the width of a string where tabs count as `tabsize` width.
ToCharPos converts from an x, y position to a character position.
UndoTextEvent undoes a text event.
WidthOfLargeRunes searches all the runes in a string and counts up all the widths of runes that have a width larger than 1 (this also counts tabs as `tabsize` width).
# Constants
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
Actions.
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
# Structs
Buffer stores the text for files that are loaded into the text editor It uses a rope to efficiently store the string and contains some simple functions for saving and wrapper functions for modifying the rope.
No description provided by the author
No description provided by the author
The Cursor struct stores the location of the cursor in the view The complicated part about the cursor is storing its location.
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.
RuntimeFiles tracks a set of runtime files.
ScrollBar represents an optional scrollbar that can be used.
Stack is a simple implementation of a LIFO stack for text events.
TextEvent holds data for a manipulation on some text that can be undone.
The View struct stores information about a view into a buffer.
# Interfaces
RuntimeFile allows the program to read runtime data like colorschemes or syntax files.
# Type aliases
Colorscheme is a map from string to style -- it represents a colorscheme.
KeyBindings associates key presses with view actions.