jim

package
v0.0.0-...-053aaa4 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewLine = "\n"

NewLine is the string sequence to be inserted when hitting the Enter key in a TextArea. The default is "\n" but you may change it to "\r\n" if required.

View Source
var Styles = Theme{
	PrimitiveBackgroundColor:    tcell.ColorBlack,
	ContrastBackgroundColor:     tcell.ColorBlue,
	MoreContrastBackgroundColor: tcell.ColorGreen,
	BorderColor:                 tcell.ColorWhite,
	TitleColor:                  tcell.ColorWhite,
	GraphicsColor:               tcell.ColorWhite,
	PrimaryTextColor:            tcell.ColorWhite,
	SecondaryTextColor:          tcell.ColorYellow,
	TertiaryTextColor:           tcell.ColorGreen,
	InverseTextColor:            tcell.ColorBlue,
	ContrastSecondaryTextColor:  tcell.ColorNavy,
}

Styles defines the theme for applications. The default is for a black background and some basic colors: black, white, yellow, green, cyan, and blue.

Functions

func Escape

func Escape(text string) string

Escape escapes the given text such that color and/or region tags are not recognized and substituted by the print functions of this package. For example, to include a tag-like string in a box title or in a TextView:

box.SetTitle(tview.Escape("[squarebrackets]"))
fmt.Fprint(textView, tview.Escape(`["quoted"]`))

func TaggedStringWidth

func TaggedStringWidth(text string) (width int)

TaggedStringWidth returns the width of the given string needed to print it on screen. The text may contain style tags which are not counted.

func WordWrap

func WordWrap(text string, width int) (lines []string)

WordWrap splits a text such that each resulting line does not exceed the given screen width. Split points are determined using the algorithm described in Unicode Standard Annex #14.

This function considers style tags to have no width.

Types

type Box

type Box struct {
	// contains filtered or unexported fields
}

Box implements the Primitive interface with an empty background and optional elements such as a border and a title. Box itself does not hold any content but serves as the superclass of all other primitives. Subclasses add their own content, typically (but not necessarily) keeping their content within the box's rectangle.

Box provides a number of utility functions available to all primitives.

See https://github.com/rivo/tview/wiki/Box for an example.

func NewBox

func NewBox() *Box

NewBox returns a Box without a border.

func (*Box) Blur

func (b *Box) Blur()

Blur is called when this primitive loses focus.

func (*Box) Draw

func (b *Box) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*Box) DrawForSubclass

func (b *Box) DrawForSubclass(screen tcell.Screen, p tview.Primitive)

DrawForSubclass draws this box under the assumption that primitive p is a subclass of this box. This is needed e.g. to draw proper box frames which depend on the subclass's focus.

Only call this function from your own custom primitives. It is not needed in applications that have no custom primitives.

func (*Box) Focus

func (b *Box) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (*Box) GetBackgroundColor

func (b *Box) GetBackgroundColor() tcell.Color

GetBackgroundColor returns the box's background color.

func (*Box) GetBorderAttributes

func (b *Box) GetBorderAttributes() tcell.AttrMask

GetBorderAttributes returns the border's style attributes.

func (*Box) GetBorderColor

func (b *Box) GetBorderColor() tcell.Color

GetBorderColor returns the box's border color.

func (*Box) GetDrawFunc

func (b *Box) GetDrawFunc() func(screen tcell.Screen, x, y, width, height int) (int, int, int, int)

GetDrawFunc returns the callback function which was installed with SetDrawFunc() or nil if no such function has been installed.

func (*Box) GetInnerRect

func (b *Box) GetInnerRect() (int, int, int, int)

GetInnerRect returns the position of the inner rectangle (x, y, width, height), without the border and without any padding. Width and height values will clamp to 0 and thus never be negative.

func (*Box) GetInputCapture

func (b *Box) GetInputCapture() func(event *tcell.EventKey) *tcell.EventKey

GetInputCapture returns the function installed with SetInputCapture() or nil if no such function has been installed.

func (*Box) GetMouseCapture

func (b *Box) GetMouseCapture() func(action tview.MouseAction, event *tcell.EventMouse) (tview.MouseAction, *tcell.EventMouse)

GetMouseCapture returns the function installed with SetMouseCapture() or nil if no such function has been installed.

func (*Box) GetRect

func (b *Box) GetRect() (int, int, int, int)

GetRect returns the current position of the rectangle, x, y, width, and height.

func (*Box) GetTitle

func (b *Box) GetTitle() string

GetTitle returns the box's current title.

func (*Box) HasFocus

func (b *Box) HasFocus() bool

HasFocus returns whether or not this primitive has focus.

func (*Box) InRect

func (b *Box) InRect(x, y int) bool

InRect returns true if the given coordinate is within the bounds of the box's rectangle.

func (*Box) InputHandler

func (b *Box) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns nil.

func (*Box) MouseHandler

func (b *Box) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

MouseHandler returns nil.

func (*Box) SetBackgroundColor

func (b *Box) SetBackgroundColor(color tcell.Color) *Box

SetBackgroundColor sets the box's background color.

func (*Box) SetBlurFunc

func (b *Box) SetBlurFunc(callback func()) *Box

SetBlurFunc sets a callback function which is invoked when this primitive loses focus. This does not apply to container primitives such as Flex or Grid.

Set to nil to remove the callback function.

func (*Box) SetBorder

func (b *Box) SetBorder(show bool) *Box

SetBorder sets the flag indicating whether or not the box should have a border.

func (*Box) SetBorderAttributes

func (b *Box) SetBorderAttributes(attr tcell.AttrMask) *Box

SetBorderAttributes sets the border's style attributes. You can combine different attributes using bitmask operations:

box.SetBorderAttributes(tcell.AttrUnderline | tcell.AttrBold)

func (*Box) SetBorderColor

func (b *Box) SetBorderColor(color tcell.Color) *Box

SetBorderColor sets the box's border color.

func (*Box) SetBorderPadding

func (b *Box) SetBorderPadding(top, bottom, left, right int) *Box

SetBorderPadding sets the size of the borders around the box content.

func (*Box) SetBorderStyle

func (b *Box) SetBorderStyle(style tcell.Style) *Box

SetBorderStyle sets the box's border style.

func (*Box) SetDrawFunc

func (b *Box) SetDrawFunc(handler func(screen tcell.Screen, x, y, width, height int) (int, int, int, int)) *Box

SetDrawFunc sets a callback function which is invoked after the box primitive has been drawn. This allows you to add a more individual style to the box (and all primitives which extend it).

The function is provided with the box's dimensions (set via SetRect()). It must return the box's inner dimensions (x, y, width, height) which will be returned by GetInnerRect(), used by descendent primitives to draw their own content.

func (*Box) SetFocusFunc

func (b *Box) SetFocusFunc(callback func()) *Box

SetFocusFunc sets a callback function which is invoked when this primitive receives focus. Container primitives such as Flex or Grid may not be notified if one of their descendents receive focus directly.

Set to nil to remove the callback function.

func (*Box) SetInputCapture

func (b *Box) SetInputCapture(capture func(event *tcell.EventKey) *tcell.EventKey) *Box

SetInputCapture installs a function which captures key events before they are forwarded to the primitive's default key event handler. This function can then choose to forward that key event (or a different one) to the default handler by returning it. If nil is returned, the default handler will not be called.

Providing a nil handler will remove a previously existing handler.

This function can also be used on container primitives (like Flex, Grid, or Form) as keyboard events will be handed down until they are handled.

func (*Box) SetMouseCapture

func (b *Box) SetMouseCapture(capture func(action tview.MouseAction, event *tcell.EventMouse) (tview.MouseAction, *tcell.EventMouse)) *Box

SetMouseCapture sets a function which captures mouse events (consisting of the original tcell mouse event and the semantic mouse action) before they are forwarded to the primitive's default mouse event handler. This function can then choose to forward that event (or a different one) by returning it or returning a nil mouse event, in which case the default handler will not be called.

Providing a nil handler will remove a previously existing handler.

func (*Box) SetRect

func (b *Box) SetRect(x, y, width, height int)

SetRect sets a new position of the primitive. Note that this has no effect if this primitive is part of a layout (e.g. Flex, Grid) or if it was added like this:

application.SetRoot(p, true)

func (*Box) SetTitle

func (b *Box) SetTitle(title string) *Box

SetTitle sets the box's title.

func (*Box) SetTitleAlign

func (b *Box) SetTitleAlign(align int) *Box

SetTitleAlign sets the alignment of the title, one of AlignLeft, AlignCenter, or AlignRight.

func (*Box) SetTitleColor

func (b *Box) SetTitleColor(color tcell.Color) *Box

SetTitleColor sets the box's title color.

func (*Box) WrapInputHandler

func (b *Box) WrapInputHandler(inputHandler func(*tcell.EventKey, func(p tview.Primitive))) func(*tcell.EventKey, func(p tview.Primitive))

WrapInputHandler wraps an input handler (see InputHandler()) with the functionality to capture input (see SetInputCapture()) before passing it on to the provided (default) input handler.

This is only meant to be used by subclassing primitives.

func (*Box) WrapMouseHandler

func (b *Box) WrapMouseHandler(mouseHandler func(tview.MouseAction, *tcell.EventMouse, func(p tview.Primitive)) (bool, tview.Primitive)) func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

WrapMouseHandler wraps a mouse event handler (see MouseHandler()) with the functionality to capture mouse events (see SetMouseCapture()) before passing them on to the provided (default) event handler.

This is only meant to be used by subclassing primitives.

type Editor

type Editor struct {
	App     *tview.Application
	DirFile *os.File

	Pages     *tview.Pages
	PagesOpen []string
	LastPage  string

	Tree    *Tree
	Grid    *tview.Grid
	Bottom  *tview.TextView
	Bottom2 *tview.TextView
	Bottom3 *tview.TextView

	Search *SearchReplace

	Tabs []*Tab

	LastNode *tview.TreeNode
}

func NewEditor

func NewEditor(app *tview.Application, d *os.File) *Editor

func (*Editor) IsFileATab

func (e *Editor) IsFileATab(p string) bool

func (*Editor) OpenTab

func (e *Editor) OpenTab(p string, node *tview.TreeNode)

func (*Editor) SaveCurrentTab

func (e *Editor) SaveCurrentTab()

func (*Editor) SetCursor

func (e *Editor) SetCursor(x, y int)

func (*Editor) SetTabActive

func (e *Editor) SetTabActive(p string)

func (*Editor) ToggleSearchReplaceModal

func (e *Editor) ToggleSearchReplaceModal()

type SearchReplace

type SearchReplace struct {
	Parent *Editor
	Form   tview.Primitive
}

func NewSearchReplace

func NewSearchReplace(e *Editor) *SearchReplace

type Tab

type Tab struct {
	Path       string
	File       *os.File
	HasChanged bool
}

func NewTab

func NewTab(path string) *Tab

type TextArea

type TextArea struct {
	*Box

	LineNumbers int // jim
	// contains filtered or unexported fields
}

TextArea implements a simple text editor for multi-line text. Multi-color text is not supported. Word-wrapping is enabled by default but can be turned off or be changed to character-wrapping.

At this point, a text area cannot be added to a [Form]. This will be added in the future.

Navigation and Editing

A text area is always in editing mode and no other mode exists. The following keys can be used to move the cursor (subject to what the user's terminal supports and how it is configured):

  • Left arrow: Move left.
  • Right arrow: Move right.
  • Down arrow: Move down.
  • Up arrow: Move up.
  • Ctrl-A, Home: Move to the beginning of the current line.
  • Ctrl-E, End: Move to the end of the current line.
  • Ctrl-F, page down: Move down by one page.
  • Ctrl-B, page up: Move up by one page.
  • Alt-Up arrow: Scroll the page up, leaving the cursor in its position.
  • Alt-Down arrow: Scroll the page down, leaving the cursor in its position.
  • Alt-Left arrow: Scroll the page to the left, leaving the cursor in its position. Ignored if wrapping is enabled.
  • Alt-Right arrow: Scroll the page to the right, leaving the cursor in its position. Ignored if wrapping is enabled.
  • Alt-B, Ctrl-Left arrow: Jump to the beginning of the current or previous word.
  • Alt-F, Ctrl-Right arrow: Jump to the end of the current or next word.

Words are defined according to Unicode Standard Annex #29. We skip any words that contain only spaces or punctuation.

Entering a character will insert it at the current cursor location. Subsequent characters are shifted accordingly. If the cursor is outside the visible area, any changes to the text will move it into the visible area. The following keys can also be used to modify the text:

  • Enter: Insert a newline character (see NewLine).
  • Tab: Insert a tab character (\t). It will be rendered like [TabSize] spaces. (This may eventually be changed to behave like regular tabs.)
  • Ctrl-H, Backspace: Delete one character to the left of the cursor.
  • Ctrl-D, Delete: Delete the character under the cursor (or the first character on the next line if the cursor is at the end of a line).
  • Alt-Backspace: Delete the word to the left of the cursor.
  • Ctrl-K: Delete everything under and to the right of the cursor until the next newline character.
  • Ctrl-W: Delete from the start of the current word to the left of the cursor.
  • Ctrl-U: Delete the current line, i.e. everything after the last newline character before the cursor up until the next newline character. This may span multiple visible rows if wrapping is enabled.

Text can be selected by moving the cursor while holding the Shift key, to the extent that this is supported by the user's terminal. The Ctrl-L key can be used to select the entire text. (Ctrl-A already binds to the "Home" key.)

When text is selected:

  • Entering a character will replace the selected text with the new character.
  • Backspace, delete, Ctrl-H, Ctrl-D: Delete the selected text.
  • Ctrl-Q: Copy the selected text into the clipboard, unselect the text.
  • Ctrl-X: Copy the selected text into the clipboard and delete it.
  • Ctrl-V: Replace the selected text with the clipboard text. If no text is selected, the clipboard text will be inserted at the cursor location.

The Ctrl-Q key was chosen for the "copy" function because the Ctrl-C key is the default key to stop the application. If your application frees up the global Ctrl-C key and you want to bind it to the "copy to clipboard" function, you may use Box.SetInputCapture to override the Ctrl-Q key to implement copying to the clipboard. Note that using your terminal's / operating system's key bindings for copy+paste functionality may not have the expected effect as tview will not be able to handle these keys. Pasting text using your operating system's or terminal's own methods may be very slow as each character will be pasted individually.

The default clipboard is an internal text buffer, i.e. the operating system's clipboard is not used. If you want to implement your own clipboard (or make use of your operating system's clipboard), you can use TextArea.SetClipboard which provides all the functionality needed to implement your own clipboard.

The text area also supports Undo:

  • Ctrl-Z: Undo the last change.
  • Ctrl-Y: Redo the last Undo change.

Undo does not affect the clipboard.

If the mouse is enabled, the following actions are available:

  • Left click: Move the cursor to the clicked position or to the end of the line if past the last character.
  • Left double-click: Select the word under the cursor.
  • Left click while holding the Shift key: Select text.
  • Scroll wheel: Scroll the text.

func NewTextArea

func NewTextArea(fileType string) *TextArea

NewTextArea returns a new text area. Use TextArea.SetText to set the initial text.

func (*TextArea) Draw

func (t *TextArea) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*TextArea) Focus

func (t *TextArea) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (*TextArea) GetCursor

func (t *TextArea) GetCursor() (fromRow, fromColumn, toRow, toColumn int)

GetCursor returns the current cursor position where the first character of the entire text is in row 0, column 0. If the user has selected text, the "from" values will refer to the beginning of the selection and the "to" values to the end of the selection (exclusive). They are the same if there is no selection.

func (*TextArea) GetDisabled

func (t *TextArea) GetDisabled() bool

GetDisabled returns whether or not the item is disabled / read-only.

func (*TextArea) GetFieldHeight

func (t *TextArea) GetFieldHeight() int

GetFieldHeight returns this primitive's field height.

func (*TextArea) GetFieldWidth

func (t *TextArea) GetFieldWidth() int

GetFieldWidth returns this primitive's field width.

func (*TextArea) GetLabel

func (t *TextArea) GetLabel() string

GetLabel returns the text to be displayed before the text area.

func (*TextArea) GetLabelStyle

func (t *TextArea) GetLabelStyle() tcell.Style

GetLabelStyle returns the style of the label.

func (*TextArea) GetLabelWidth

func (t *TextArea) GetLabelWidth() int

GetLabelWidth returns the screen width of the label.

func (*TextArea) GetOffset

func (t *TextArea) GetOffset() (row, column int)

GetOffset returns the text's offset, that is, the number of rows and columns skipped during drawing at the top or on the left, respectively. Note that the column offset is ignored if wrapping is enabled.

func (*TextArea) GetPlaceholderStyle

func (t *TextArea) GetPlaceholderStyle() tcell.Style

GetPlaceholderStyle returns the style of the placeholder text.

func (*TextArea) GetSelection

func (t *TextArea) GetSelection() (text string, start int, end int)

GetSelection returns the currently selected text and its start and end positions within the entire text as a half-open interval. If the returned text is an empty string, the start and end positions are the same and can be interpreted as the cursor position.

Calling this function will result in string allocations as well as a search for text positions. This is expensive if the text has been edited extensively already. Use TextArea.HasSelection first if you are only interested in selected text.

func (*TextArea) GetText

func (t *TextArea) GetText() string

GetText returns the entire text of the text area. Note that this will newly allocate the entire text.

func (*TextArea) GetTextLength

func (t *TextArea) GetTextLength() int

GetTextLength returns the string length of the text in the text area.

func (*TextArea) GetTextStyle

func (t *TextArea) GetTextStyle() tcell.Style

GetTextStyle returns the style of the text.

func (*TextArea) HasSelection

func (t *TextArea) HasSelection() bool

HasSelection returns whether the selected text is non-empty.

func (*TextArea) InputHandler

func (t *TextArea) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns the handler for this primitive.

func (*TextArea) MouseHandler

func (t *TextArea) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

MouseHandler returns the mouse handler for this primitive.

func (*TextArea) Replace

func (t *TextArea) Replace(start, end int, text string) *TextArea

Replace replaces a section of the text with new text. The start and end positions refer to index positions within the entire text string (as a half-open interval). They may be the same, in which case text is inserted at the given position. If the text is an empty string, text between start and end is deleted. Index positions will be shifted to line up with character boundaries. A "changed" event will be triggered.

Previous selections are cleared. The cursor will be located at the end of the replaced text. Scroll offsets will not be changed. A "moved" event will be triggered.

The effects of this function can be undone (and redone) by the user.

func (*TextArea) Select

func (t *TextArea) Select(start, end int) *TextArea

Select selects a section of the text. The start and end positions refer to index positions within the entire text string (as a half-open interval). They may be the same, in which case the cursor is placed at the given position. Any previous selection is removed. Scroll offsets will be preserved.

Index positions will be shifted to line up with character boundaries.

func (*TextArea) SetChangedFunc

func (t *TextArea) SetChangedFunc(handler func()) *TextArea

SetChangedFunc sets a handler which is called whenever the text of the text area has changed.

func (*TextArea) SetClipboard

func (t *TextArea) SetClipboard(copyToClipboard func(string), pasteFromClipboard func() string) *TextArea

SetClipboard allows you to implement your own clipboard by providing a function that is called when the user wishes to store text in the clipboard (copyToClipboard) and a function that is called when the user wishes to retrieve text from the clipboard (pasteFromClipboard).

Providing nil values will cause the default clipboard implementation to be used.

func (*TextArea) SetCursor

func (t *TextArea) SetCursor(x, y int)

func (*TextArea) SetDisabled

func (t *TextArea) SetDisabled(disabled bool) tview.FormItem

SetDisabled sets whether or not the item is disabled / read-only.

func (*TextArea) SetFinishedFunc

func (t *TextArea) SetFinishedFunc(handler func(key tcell.Key)) tview.FormItem

SetFinishedFunc sets a callback invoked when the user leaves this form item.

func (*TextArea) SetFormAttributes

func (t *TextArea) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldTextColor, fieldBgColor tcell.Color) tview.FormItem

SetFormAttributes sets attributes shared by all form items.

func (*TextArea) SetLabel

func (t *TextArea) SetLabel(label string) *TextArea

SetLabel sets the text to be displayed before the text area.

func (*TextArea) SetLabelStyle

func (t *TextArea) SetLabelStyle(style tcell.Style) *TextArea

SetLabelStyle sets the style of the label.

func (*TextArea) SetLabelWidth

func (t *TextArea) SetLabelWidth(width int) *TextArea

SetLabelWidth sets the screen width of the label. A value of 0 will cause the primitive to use the width of the label string.

func (*TextArea) SetMaxLength

func (t *TextArea) SetMaxLength(maxLength int) *TextArea

SetMaxLength sets the maximum number of bytes allowed in the text area. A value of 0 means there is no limit. If the text area currently contains more bytes than this, it may violate this constraint.

func (*TextArea) SetMovedFunc

func (t *TextArea) SetMovedFunc(handler func()) *TextArea

SetMovedFunc sets a handler which is called whenever the cursor position or the text selection has changed.

func (*TextArea) SetOffset

func (t *TextArea) SetOffset(row, column int) *TextArea

SetOffset sets the text's offset, that is, the number of rows and columns skipped during drawing at the top or on the left, respectively. If wrapping is enabled, the column offset is ignored. These values may get adjusted automatically to ensure that some text is always visible.

func (*TextArea) SetPlaceholder

func (t *TextArea) SetPlaceholder(placeholder string) *TextArea

SetPlaceholder sets the text to be displayed when the text area is empty.

func (*TextArea) SetPlaceholderStyle

func (t *TextArea) SetPlaceholderStyle(style tcell.Style) *TextArea

SetPlaceholderStyle sets the style of the placeholder text.

func (*TextArea) SetSelectedStyle

func (t *TextArea) SetSelectedStyle(style tcell.Style) *TextArea

SetSelectedStyle sets the style of the selected text.

func (*TextArea) SetSize

func (t *TextArea) SetSize(rows, columns int) *TextArea

SetSize sets the screen size of the input element of the text area. The input element is always located next to the label which is always located in the top left corner. If any of the values are 0 or larger than the available space, the available space will be used.

func (*TextArea) SetText

func (t *TextArea) SetText(text string, cursorAtTheEnd bool) *TextArea

SetText sets the text of the text area. All existing text is deleted and replaced with the new text. Any edits are discarded, no undos are available. This function is typically only used to initialize the text area with a text after it has been created. To clear the text area's text (again, no undos), provide an empty string.

If cursorAtTheEnd is false, the cursor is placed at the start of the text. If it is true, it is placed at the end of the text. For very long texts, placing the cursor at the end can be an expensive operation because the entire text needs to be parsed and laid out.

If you want to set text and preserve undo functionality, use TextArea.Replace instead.

func (*TextArea) SetTextStyle

func (t *TextArea) SetTextStyle(style tcell.Style) *TextArea

SetTextStyle sets the style of the text.

func (*TextArea) SetWordWrap

func (t *TextArea) SetWordWrap(wrapOnWords bool) *TextArea

SetWordWrap sets the flag that causes lines that are longer than the available width to be wrapped onto the next line at spaces or after punctuation marks (according to Unicode Standard Annex #14). This flag is ignored if the flag set with TextArea.SetWrap is false. The text area's default is word-wrapping.

func (*TextArea) SetWrap

func (t *TextArea) SetWrap(wrap bool) *TextArea

SetWrap sets the flag that, if true, leads to lines that are longer than the available width being wrapped onto the next line. If false, any characters beyond the available width are not displayed.

type Theme

type Theme struct {
	PrimitiveBackgroundColor    tcell.Color // Main background color for primitives.
	ContrastBackgroundColor     tcell.Color // Background color for contrasting elements.
	MoreContrastBackgroundColor tcell.Color // Background color for even more contrasting elements.
	BorderColor                 tcell.Color // Box borders.
	TitleColor                  tcell.Color // Box titles.
	GraphicsColor               tcell.Color // Graphics.
	PrimaryTextColor            tcell.Color // Primary text.
	SecondaryTextColor          tcell.Color // Secondary text (e.g. labels).
	TertiaryTextColor           tcell.Color // Tertiary text (e.g. subtitles, notes).
	InverseTextColor            tcell.Color // Text on primary-colored backgrounds.
	ContrastSecondaryTextColor  tcell.Color // Secondary text on ContrastBackgroundColor-colored backgrounds.
}

Theme defines the colors used when primitives are initialized.

type Tree

type Tree struct {
	Parent *Editor
	Tree   *tview.TreeView
}

func NewTree

func NewTree(e *Editor, dir string) *Tree

Jump to

Keyboard shortcuts

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