class

Tui::DiffView

Inherits Tui::Widget / Tui::Reactive / Reference / Object

DiffView widget - displays parsed diff with colors and interactivity

Constructors

new(id : String | Nil = nil)
Source

Instance methods

addition_bg

Colors

Source
addition_bg=(addition_bg : Color)

Colors

Source
addition_fg
Source
addition_fg=(addition_fg : Color)
Source
author_fg
Source
author_fg=(author_fg : Color)
Source
can_go_back?

Check if can go back

Source
clear_commit_info

Clear commit info (for file diffs, not commit diffs)

Source
collapse_all

Collapse/expand all

Source
commit_header_bg
Source
commit_header_bg=(commit_header_bg : Color)
Source
commit_header_lines

Number of header lines for commit info

Source
commit_info

Commit metadata (for single commit diffs)

Source
commit_info=(commit_info : CommitInfo)

Commit metadata (for single commit diffs)

Source
content=(diff_text : String)

Set diff content from raw diff text

Source
context_fg
Source
context_fg=(context_fg : Color)
Source
date_fg
Source
date_fg=(date_fg : Color)
Source
deletion_bg
Source
deletion_bg=(deletion_bg : Color)
Source
deletion_fg
Source
deletion_fg=(deletion_fg : Color)
Source
expand_all
Source
files
Source
files=(files : Array(DiffFile))
Source
go_back

Go back in history

Source
hash_fg
Source
hash_fg=(hash_fg : Color)
Source
header_bg
Source
header_bg=(header_bg : Color)
Source
header_fg
Source
header_fg=(header_fg : Color)
Source
line_number_fg
Source
line_number_fg=(line_number_fg : Color)
Source
line_number_width
Source
line_number_width=(line_number_width : Int32)
Source
on_event(event : Event) : Bool

Override to handle events for this widget (target/bubble phase) Called after children have had a chance to handle the event

Source
on_file_select

Callback when file is selected

Source
on_go_back

Callback when backspace is pressed to go back

Source
on_hash_click

Callback when commit hash is clicked (for navigation)

Source
render(buffer : Buffer, clip : Rect) : Nil

Override to render widget content

Source
scroll_offset
Source
scroll_offset=(scroll_offset : Int32)
Source
selected_index
Source
selected_index=(selected_index : Int32)
Source
set_commit(hash : String, info : CommitInfo, diff_text : String)

Set commit with content - pushes current to history

Source
show_commit_header=(show_commit_header : Bool)
Source
show_commit_header?
Source
show_line_numbers=(show_line_numbers : Bool)

UI settings

Source
show_line_numbers?

UI settings

Source
show_scrollbar=(show_scrollbar : Bool)
Source
show_scrollbar?
Source
toggle_selected

Toggle current item (file or hunk)

Source
total_additions

Statistics

Source
total_deletions
Source
total_lines

Calculate total visible lines

Source
word_change_bg
Source
word_change_bg=(word_change_bg : Color)
Source