Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiffPopup ¶
type DiffPopup struct {
// Hunk is the diff hunk to display.
Hunk *providers.DiffHunk
// Colors defines the color scheme.
Colors PopupColors
// TextSize is the size of the text.
TextSize unit.Sp
// ShowStageButton controls whether to show the stage button.
ShowStageButton bool
// MaxHeight is the maximum height of the popup.
MaxHeight unit.Dp
// contains filtered or unexported fields
}
DiffPopup displays a diff hunk with actions to revert or stage changes.
func NewDiffPopup ¶
NewDiffPopup creates a new diff popup for the given hunk.
type GitDiff ¶
type GitDiff struct {
// contains filtered or unexported fields
}
GitDiff is a helper that can be used to parse git diff output. Use the NewGitDiff function to build a new instance to make sure we are dealing with a real git repository.
func NewGitDiff ¶
type PopupAction ¶
type PopupAction int
PopupAction represents an action that can be performed on a diff hunk.
const ( // ActionNone indicates no action was taken. ActionNone PopupAction = iota // DiffActionRevert indicates the user wants to revert the changes. ActionRevert // ActionStage indicates the user wants to stage the changes. ActionStage // ActionClose indicates the user closed the popup. ActionClose )
type PopupColors ¶
type PopupColors struct {
// Background is the popup background color.
Background gvcolor.Color
// Border is the popup border color.
Border gvcolor.Color
// AddedBackground is the background for added lines.
AddedBackground gvcolor.Color
// AddedText is the text color for added lines.
AddedText gvcolor.Color
// DeletedBackground is the background for deleted lines.
DeletedBackground gvcolor.Color
// DeletedText is the text color for deleted lines.
DeletedText gvcolor.Color
// ButtonBackground is the button background color.
ButtonBackground gvcolor.Color
// ButtonText is the button text color.
ButtonText gvcolor.Color
// HeaderText is the header text color.
HeaderText gvcolor.Color
}
PopupColors defines the color scheme for the diff popup.
func DefaultPopupColors ¶
func DefaultPopupColors() PopupColors
DefaultPopupColors returns the default color scheme for the diff popup.
type PopupEvent ¶
type PopupEvent struct {
Action PopupAction
Hunk *providers.DiffHunk
}
PopupEvent is emitted when the user interacts with the diff popup.
Click to show internal directories.
Click to hide internal directories.