use crate::{
accessors,
cmdbar::CommandBar,
components::{
command_pump, event_pump, AppOption, BlameFileComponent,
BranchListComponent, CommandInfo, CommitComponent,
CompareCommitsComponent, Component, ConfirmComponent,
CreateBranchComponent, DrawableComponent,
ExternalEditorComponent, FetchComponent, FileRevlogComponent,
FuzzyFindPopup, FuzzyFinderTarget, HelpComponent,
InspectCommitComponent, LogSearchPopupComponent,
MsgComponent, OptionsPopupComponent, PullComponent,
PushComponent, PushTagsComponent, RenameBranchComponent,
ResetPopupComponent, RevisionFilesPopup, StashMsgComponent,
SubmodulesListComponent, TagCommitComponent,
TagListComponent,
},
input::{Input, InputEvent, InputState},
keys::{key_match, KeyConfig, SharedKeyConfig},
options::{Options, SharedOptions},
popup_stack::PopupStack,
queue::{
Action, AppTabs, InternalEvent, NeedsUpdate, Queue,
StackablePopupOpen,
},
setup_popups,
strings::{self, ellipsis_trim_start, order},
tabs::{FilesTab, Revlog, StashList, Stashing, Status},
try_or_popup,
ui::style::{SharedTheme, Theme},
AsyncAppNotification, AsyncNotification,
};
use anyhow::{bail, Result};
use asyncgit::{
sync::{
self,
utils::{repo_work_dir, undo_last_commit},
RepoPath, RepoPathRef,
},
AsyncGitNotification, PushType,
};
use crossbeam_channel::Sender;
use crossterm::event::{Event, KeyEvent};
use ratatui::{
backend::Backend,
layout::{
Alignment, Constraint, Direction, Layout, Margin, Rect,
},
text::{Line, Span},
widgets::{Block, Borders, Paragraph, Tabs},
Frame,
};
use std::{
cell::{Cell, RefCell},
path::{Path, PathBuf},
rc::Rc,
};
use unicode_width::UnicodeWidthStr;
#[derive(Clone)]
pub enum QuitState {
None,
Close,
OpenSubmodule(RepoPath),
}
/// the main app type
pub struct App {
repo: RepoPathRef,
do_quit: