Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateViewSize(width, height int) (ncols, nrows int)
- func MakeStyle(primary bool, isEditing bool, activeRegions []core.Region) lipgloss.Style
- func TeaMsgCmd(msg tea.Msg) tea.Cmd
- type ActiveColumn
- type BufferSavedMsg
- type EditingMode
- type Model
- func (m *Model) GetViewBounds() (int64, int64)
- func (m Model) Init() tea.Cmd
- func (m *Model) LoadFile(name string) error
- func (m *Model) MoveCursor(amount int64)
- func (m Model) RenderHexView() (string, error)
- func (m Model) RenderStatus() string
- func (m *Model) ScrollToCursor()
- func (m *Model) SetCursor(pos int64)
- func (m *Model) SetMode(mode EditingMode)
- func (m *Model) StatusMessage(msg string, isError bool)
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
- type StatusTextMsg
Constants ¶
View Source
const ( ModeNormal EditingMode = "NORMAL" ModeInsert EditingMode = "INSERT" ModeVisual EditingMode = "VISUAL" ModeReplace EditingMode = "REPLACE" ModeCommand EditingMode = "COMMAND" ActiveColumnHex ActiveColumn = iota ActiveColumnAscii )
Variables ¶
View Source
var (
EmptyReadSeeker = io.ReadSeeker(bytes.NewReader([]byte{}))
)
Functions ¶
func CalculateViewSize ¶
CalculateViewSize calculates the number of rows and columns that can fit in the given width and height.
Types ¶
type ActiveColumn ¶
type ActiveColumn int
type BufferSavedMsg ¶
type EditingMode ¶
type EditingMode string
type Model ¶
type Model struct { ResponsiveCols bool // contains filtered or unexported fields }
func (*Model) GetViewBounds ¶
GetViewBounds returns the start and end positions of the view.
func (*Model) MoveCursor ¶
MoveCursor moves the cursor by the given amount.
func (Model) RenderHexView ¶
RenderHexView renders the hex dump.
func (Model) RenderStatus ¶
RenderStatus renders the status bar.
func (*Model) ScrollToCursor ¶
func (m *Model) ScrollToCursor()
ScrollToCursor scrolls the view so that the cursor is visible.
func (*Model) StatusMessage ¶
StatusMessage sets the status message.
type StatusTextMsg ¶
Click to show internal directories.
Click to hide internal directories.