filechange

package
v0.0.0-...-91d1363 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffPrettyText

func DiffPrettyText(diffs []diffmatchpatch.Diff, enabled bool, reviewMode bool) string

Types

type LineChange

type LineChange struct {
	LineNo        int
	Original      string
	Replaced      *string
	Diffs         []diffmatchpatch.Diff
	PreviewLineNo int
	// contains filtered or unexported fields
}

type Model

type Model struct {
	Cursor  int
	Preview []string
	// contains filtered or unexported fields
}

func New

func New(file *os.File, regex *regexp2.Regexp, subst *string) (*Model, error)

func (Model) AllLineChangesDisabled

func (m Model) AllLineChangesDisabled() bool

func (Model) GetFocusedLineChange

func (m Model) GetFocusedLineChange() *LineChange

func (Model) GetHeight

func (m Model) GetHeight() int

func (Model) IsItemEnabled

func (m Model) IsItemEnabled(idx int) bool

func (*Model) MoveCursor

func (m *Model) MoveCursor(lines int) int

func (*Model) MoveCursorToHead

func (m *Model) MoveCursorToHead()

func (*Model) MoveCursorToTail

func (m *Model) MoveCursorToTail()

func (Model) OpenInEditor

func (m Model) OpenInEditor() tea.Cmd

func (Model) Replace

func (m Model) Replace()

func (*Model) SetLineChangesEnabled

func (m *Model) SetLineChangesEnabled(enabled bool)

func (*Model) ToggleItemEnabled

func (m *Model) ToggleItemEnabled(idx int)

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (m Model) View(width uint) string

type PastHeadMsg

type PastHeadMsg struct{}

type PastTailMsg

type PastTailMsg struct{}

type UpdateMsg

type UpdateMsg tea.Cmd

Jump to

Keyboard shortcuts

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