mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 09:28:21 +00:00
cleanup use
This commit is contained in:
parent
ce4f3af767
commit
4a442f3829
25 changed files with 76 additions and 70 deletions
|
|
@ -1,12 +1,13 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
error::Result, sync, AsyncNotification, StatusItem, CWD,
|
error::Result,
|
||||||
|
sync::{self, CommitId},
|
||||||
|
AsyncNotification, StatusItem, CWD,
|
||||||
};
|
};
|
||||||
use crossbeam_channel::Sender;
|
use crossbeam_channel::Sender;
|
||||||
use std::sync::{
|
use std::sync::{
|
||||||
atomic::{AtomicUsize, Ordering},
|
atomic::{AtomicUsize, Ordering},
|
||||||
Arc, Mutex,
|
Arc, Mutex,
|
||||||
};
|
};
|
||||||
use sync::CommitId;
|
|
||||||
|
|
||||||
type ResultType = Vec<StatusItem>;
|
type ResultType = Vec<StatusItem>;
|
||||||
struct Request<R, A>(R, A);
|
struct Request<R, A>(R, A);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
error::Result, hash, sync, AsyncNotification, FileDiff, CWD,
|
error::Result,
|
||||||
|
hash,
|
||||||
|
sync::{self, CommitId},
|
||||||
|
AsyncNotification, FileDiff, CWD,
|
||||||
};
|
};
|
||||||
use crossbeam_channel::Sender;
|
use crossbeam_channel::Sender;
|
||||||
use std::{
|
use std::{
|
||||||
|
|
@ -9,7 +12,6 @@ use std::{
|
||||||
Arc, Mutex,
|
Arc, Mutex,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use sync::CommitId;
|
|
||||||
|
|
||||||
///
|
///
|
||||||
#[derive(Hash, Clone, PartialEq)]
|
#[derive(Hash, Clone, PartialEq)]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
error::Result, hash, sync, AsyncNotification, StatusItem, CWD,
|
error::Result,
|
||||||
|
hash,
|
||||||
|
sync::{self, status::StatusType},
|
||||||
|
AsyncNotification, StatusItem, CWD,
|
||||||
};
|
};
|
||||||
use crossbeam_channel::Sender;
|
use crossbeam_channel::Sender;
|
||||||
use std::{
|
use std::{
|
||||||
|
|
@ -10,7 +13,6 @@ use std::{
|
||||||
},
|
},
|
||||||
time::{SystemTime, UNIX_EPOCH},
|
time::{SystemTime, UNIX_EPOCH},
|
||||||
};
|
};
|
||||||
use sync::status::StatusType;
|
|
||||||
|
|
||||||
fn current_tick() -> u64 {
|
fn current_tick() -> u64 {
|
||||||
SystemTime::now()
|
SystemTime::now()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
//! sync git api for fetching a diff
|
//! sync git api for fetching a diff
|
||||||
|
|
||||||
use super::{commit_files::get_commit_diff, utils, CommitId};
|
use super::{
|
||||||
|
commit_files::get_commit_diff,
|
||||||
|
utils::{self, get_head_repo, work_dir},
|
||||||
|
CommitId,
|
||||||
|
};
|
||||||
use crate::{error::Error, error::Result, hash};
|
use crate::{error::Error, error::Result, hash};
|
||||||
use git2::{
|
use git2::{
|
||||||
Delta, Diff, DiffDelta, DiffFormat, DiffHunk, DiffOptions, Patch,
|
Delta, Diff, DiffDelta, DiffFormat, DiffHunk, DiffOptions, Patch,
|
||||||
|
|
@ -8,7 +12,6 @@ use git2::{
|
||||||
};
|
};
|
||||||
use scopetime::scope_time;
|
use scopetime::scope_time;
|
||||||
use std::{cell::RefCell, fs, path::Path, rc::Rc};
|
use std::{cell::RefCell, fs, path::Path, rc::Rc};
|
||||||
use utils::{get_head_repo, work_dir};
|
|
||||||
|
|
||||||
/// type of diff of a single line
|
/// type of diff of a single line
|
||||||
#[derive(Copy, Clone, PartialEq, Hash, Debug)]
|
#[derive(Copy, Clone, PartialEq, Hash, Debug)]
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,7 @@ use scopetime::scope_time;
|
||||||
use std::{
|
use std::{
|
||||||
fs::File,
|
fs::File,
|
||||||
io::{Read, Write},
|
io::{Read, Write},
|
||||||
path::Path,
|
path::{Path, PathBuf},
|
||||||
path::PathBuf,
|
|
||||||
process::Command,
|
process::Command,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
use crate::input::InputState;
|
|
||||||
use crate::{
|
use crate::{
|
||||||
accessors,
|
accessors,
|
||||||
cmdbar::CommandBar,
|
cmdbar::CommandBar,
|
||||||
|
|
@ -8,10 +7,10 @@ use crate::{
|
||||||
InspectCommitComponent, MsgComponent, ResetComponent,
|
InspectCommitComponent, MsgComponent, ResetComponent,
|
||||||
StashMsgComponent,
|
StashMsgComponent,
|
||||||
},
|
},
|
||||||
input::InputEvent,
|
input::{InputEvent, InputState},
|
||||||
keys,
|
keys,
|
||||||
queue::{Action, InternalEvent, NeedsUpdate, Queue},
|
queue::{Action, InternalEvent, NeedsUpdate, Queue},
|
||||||
strings,
|
strings::{self, commands, order},
|
||||||
tabs::{Revlog, StashList, Stashing, Status},
|
tabs::{Revlog, StashList, Stashing, Status},
|
||||||
ui::style::{SharedTheme, Theme},
|
ui::style::{SharedTheme, Theme},
|
||||||
};
|
};
|
||||||
|
|
@ -19,9 +18,7 @@ use anyhow::{anyhow, Result};
|
||||||
use asyncgit::{sync, AsyncNotification, CWD};
|
use asyncgit::{sync, AsyncNotification, CWD};
|
||||||
use crossbeam_channel::Sender;
|
use crossbeam_channel::Sender;
|
||||||
use crossterm::event::{Event, KeyEvent};
|
use crossterm::event::{Event, KeyEvent};
|
||||||
use std::cell::Cell;
|
use std::{cell::Cell, cell::RefCell, rc::Rc};
|
||||||
use std::{cell::RefCell, rc::Rc};
|
|
||||||
use strings::{commands, order};
|
|
||||||
use tui::{
|
use tui::{
|
||||||
backend::Backend,
|
backend::Backend,
|
||||||
layout::{Constraint, Direction, Layout, Rect},
|
layout::{Constraint, Direction, Layout, Rect},
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@ use crate::{
|
||||||
get_app_config_path, keys,
|
get_app_config_path, keys,
|
||||||
queue::{InternalEvent, NeedsUpdate, Queue},
|
queue::{InternalEvent, NeedsUpdate, Queue},
|
||||||
strings,
|
strings,
|
||||||
strings::COMMIT_EDITOR_MSG,
|
strings::{commands, COMMIT_EDITOR_MSG},
|
||||||
ui::style::SharedTheme,
|
ui::style::SharedTheme,
|
||||||
};
|
};
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use asyncgit::{
|
use asyncgit::{
|
||||||
sync::{self, CommitId},
|
sync::{self, CommitId, HookResult},
|
||||||
CWD,
|
CWD,
|
||||||
};
|
};
|
||||||
use crossterm::{
|
use crossterm::{
|
||||||
|
|
@ -20,13 +20,13 @@ use crossterm::{
|
||||||
ExecutableCommand,
|
ExecutableCommand,
|
||||||
};
|
};
|
||||||
use scopeguard::defer;
|
use scopeguard::defer;
|
||||||
use std::env;
|
use std::{
|
||||||
use std::fs::File;
|
env,
|
||||||
use std::io::{self, Read, Write};
|
fs::File,
|
||||||
use std::path::PathBuf;
|
io::{self, Read, Write},
|
||||||
use std::process::Command;
|
path::PathBuf,
|
||||||
use strings::commands;
|
process::Command,
|
||||||
use sync::HookResult;
|
};
|
||||||
use tui::{backend::Backend, layout::Rect, Frame};
|
use tui::{backend::Backend, layout::Rect, Frame};
|
||||||
|
|
||||||
pub struct CommitComponent {
|
pub struct CommitComponent {
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,11 @@ use crate::{
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use asyncgit::{
|
use asyncgit::{
|
||||||
sync::{self, CommitDetails},
|
sync::{self, CommitDetails, CommitId, Tags},
|
||||||
CWD,
|
CWD,
|
||||||
};
|
};
|
||||||
use crossterm::event::Event;
|
use crossterm::event::Event;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use sync::{CommitId, Tags};
|
|
||||||
use tui::{
|
use tui::{
|
||||||
backend::Backend,
|
backend::Backend,
|
||||||
layout::{Constraint, Direction, Layout, Rect},
|
layout::{Constraint, Direction, Layout, Rect},
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,11 @@ use crate::{
|
||||||
ui::style::{SharedTheme, Theme},
|
ui::style::{SharedTheme, Theme},
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use asyncgit::sync;
|
use asyncgit::sync::Tags;
|
||||||
use crossterm::event::Event;
|
use crossterm::event::Event;
|
||||||
use std::{
|
use std::{
|
||||||
borrow::Cow, cell::Cell, cmp, convert::TryFrom, time::Instant,
|
borrow::Cow, cell::Cell, cmp, convert::TryFrom, time::Instant,
|
||||||
};
|
};
|
||||||
use sync::Tags;
|
|
||||||
use tui::{
|
use tui::{
|
||||||
backend::Backend,
|
backend::Backend,
|
||||||
layout::{Alignment, Rect},
|
layout::{Alignment, Rect},
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,13 @@ use crate::{
|
||||||
components::{CommandInfo, Component},
|
components::{CommandInfo, Component},
|
||||||
keys,
|
keys,
|
||||||
queue::{Action, InternalEvent, NeedsUpdate, Queue, ResetItem},
|
queue::{Action, InternalEvent, NeedsUpdate, Queue, ResetItem},
|
||||||
strings,
|
strings::{self, commands},
|
||||||
ui::{calc_scroll_top, style::SharedTheme},
|
ui::{calc_scroll_top, style::SharedTheme},
|
||||||
};
|
};
|
||||||
use asyncgit::{hash, sync, DiffLine, DiffLineType, FileDiff, CWD};
|
use asyncgit::{hash, sync, DiffLine, DiffLineType, FileDiff, CWD};
|
||||||
use bytesize::ByteSize;
|
use bytesize::ByteSize;
|
||||||
use crossterm::event::Event;
|
use crossterm::event::Event;
|
||||||
use std::{borrow::Cow, cell::Cell, cmp, path::Path};
|
use std::{borrow::Cow, cell::Cell, cmp, path::Path};
|
||||||
use strings::commands;
|
|
||||||
use tui::{
|
use tui::{
|
||||||
backend::Backend,
|
backend::Backend,
|
||||||
layout::{Alignment, Rect},
|
layout::{Alignment, Rect},
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,14 @@ use crate::{
|
||||||
components::{CommandInfo, Component},
|
components::{CommandInfo, Component},
|
||||||
keys,
|
keys,
|
||||||
queue::{InternalEvent, NeedsUpdate, Queue},
|
queue::{InternalEvent, NeedsUpdate, Queue},
|
||||||
strings, ui,
|
strings::{commands, order},
|
||||||
|
ui,
|
||||||
ui::style::SharedTheme,
|
ui::style::SharedTheme,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use asyncgit::{hash, StatusItem, StatusItemType};
|
use asyncgit::{hash, StatusItem, StatusItemType};
|
||||||
use crossterm::event::Event;
|
use crossterm::event::Event;
|
||||||
use std::{borrow::Cow, convert::From, path::Path};
|
use std::{borrow::Cow, convert::From, path::Path};
|
||||||
use strings::{commands, order};
|
|
||||||
use tui::{backend::Backend, layout::Rect, widgets::Text, Frame};
|
use tui::{backend::Backend, layout::Rect, widgets::Text, Frame};
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,16 @@ use super::{
|
||||||
visibility_blocking, CommandBlocking, CommandInfo, Component,
|
visibility_blocking, CommandBlocking, CommandInfo, Component,
|
||||||
DrawableComponent,
|
DrawableComponent,
|
||||||
};
|
};
|
||||||
use crate::{keys, strings, ui, version::Version};
|
use crate::{
|
||||||
|
keys,
|
||||||
|
strings::{self, commands},
|
||||||
|
ui,
|
||||||
|
version::Version,
|
||||||
|
};
|
||||||
use asyncgit::hash;
|
use asyncgit::hash;
|
||||||
use crossterm::event::Event;
|
use crossterm::event::Event;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use std::{borrow::Cow, cmp, convert::TryFrom};
|
use std::{borrow::Cow, cmp, convert::TryFrom};
|
||||||
use strings::commands;
|
|
||||||
use tui::{
|
use tui::{
|
||||||
backend::Backend,
|
backend::Backend,
|
||||||
layout::{Alignment, Constraint, Direction, Layout, Rect},
|
layout::{Alignment, Constraint, Direction, Layout, Rect},
|
||||||
|
|
|
||||||
|
|
@ -4,16 +4,16 @@ use super::{
|
||||||
DrawableComponent,
|
DrawableComponent,
|
||||||
};
|
};
|
||||||
use crate::{
|
use crate::{
|
||||||
accessors, keys, queue::Queue, strings, ui::style::SharedTheme,
|
accessors, keys, queue::Queue, strings::commands,
|
||||||
|
ui::style::SharedTheme,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use asyncgit::{
|
use asyncgit::{
|
||||||
sync, AsyncDiff, AsyncNotification, DiffParams, DiffType,
|
sync::{CommitId, Tags},
|
||||||
|
AsyncDiff, AsyncNotification, DiffParams, DiffType,
|
||||||
};
|
};
|
||||||
use crossbeam_channel::Sender;
|
use crossbeam_channel::Sender;
|
||||||
use crossterm::event::Event;
|
use crossterm::event::Event;
|
||||||
use strings::commands;
|
|
||||||
use sync::{CommitId, Tags};
|
|
||||||
use tui::{
|
use tui::{
|
||||||
backend::Backend,
|
backend::Backend,
|
||||||
layout::{Constraint, Direction, Layout, Rect},
|
layout::{Constraint, Direction, Layout, Rect},
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,15 @@ mod reset;
|
||||||
mod stashmsg;
|
mod stashmsg;
|
||||||
mod textinput;
|
mod textinput;
|
||||||
mod utils;
|
mod utils;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
use crossterm::event::Event;
|
||||||
|
|
||||||
pub use changes::ChangesComponent;
|
pub use changes::ChangesComponent;
|
||||||
pub use command::{CommandInfo, CommandText};
|
pub use command::{CommandInfo, CommandText};
|
||||||
pub use commit::CommitComponent;
|
pub use commit::CommitComponent;
|
||||||
pub use commit_details::CommitDetailsComponent;
|
pub use commit_details::CommitDetailsComponent;
|
||||||
pub use commitlist::CommitList;
|
pub use commitlist::CommitList;
|
||||||
use crossterm::event::Event;
|
|
||||||
pub use diff::DiffComponent;
|
pub use diff::DiffComponent;
|
||||||
pub use filetree::FileTreeComponent;
|
pub use filetree::FileTreeComponent;
|
||||||
pub use help::HelpComponent;
|
pub use help::HelpComponent;
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,13 @@ use super::{
|
||||||
visibility_blocking, CommandBlocking, CommandInfo, Component,
|
visibility_blocking, CommandBlocking, CommandInfo, Component,
|
||||||
DrawableComponent,
|
DrawableComponent,
|
||||||
};
|
};
|
||||||
use crate::{keys, strings, ui};
|
use crate::{
|
||||||
|
keys,
|
||||||
|
strings::{self, commands},
|
||||||
|
ui,
|
||||||
|
};
|
||||||
use crossterm::event::Event;
|
use crossterm::event::Event;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use strings::commands;
|
|
||||||
use tui::{
|
use tui::{
|
||||||
backend::Backend,
|
backend::Backend,
|
||||||
layout::{Alignment, Rect},
|
layout::{Alignment, Rect},
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,12 @@ use crate::{
|
||||||
CommandInfo, Component, DrawableComponent,
|
CommandInfo, Component, DrawableComponent,
|
||||||
},
|
},
|
||||||
queue::{Action, InternalEvent, Queue},
|
queue::{Action, InternalEvent, Queue},
|
||||||
strings, ui,
|
strings::{self, commands},
|
||||||
|
ui,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use crossterm::event::{Event, KeyCode};
|
use crossterm::event::{Event, KeyCode};
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use strings::commands;
|
|
||||||
use tui::{
|
use tui::{
|
||||||
backend::Backend,
|
backend::Backend,
|
||||||
layout::Rect,
|
layout::Rect,
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,13 @@ use super::{
|
||||||
};
|
};
|
||||||
use crate::{
|
use crate::{
|
||||||
queue::{InternalEvent, NeedsUpdate, Queue},
|
queue::{InternalEvent, NeedsUpdate, Queue},
|
||||||
strings,
|
strings::{self, commands},
|
||||||
tabs::StashingOptions,
|
tabs::StashingOptions,
|
||||||
ui::style::SharedTheme,
|
ui::style::SharedTheme,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use asyncgit::{sync, CWD};
|
use asyncgit::{sync, CWD};
|
||||||
use crossterm::event::{Event, KeyCode};
|
use crossterm::event::{Event, KeyCode};
|
||||||
use strings::commands;
|
|
||||||
use tui::{backend::Backend, layout::Rect, Frame};
|
use tui::{backend::Backend, layout::Rect, Frame};
|
||||||
|
|
||||||
pub struct StashMsgComponent {
|
pub struct StashMsgComponent {
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@ use crate::{
|
||||||
popup_paragraph, visibility_blocking, CommandBlocking,
|
popup_paragraph, visibility_blocking, CommandBlocking,
|
||||||
CommandInfo, Component, DrawableComponent,
|
CommandInfo, Component, DrawableComponent,
|
||||||
},
|
},
|
||||||
strings, ui,
|
strings::commands,
|
||||||
|
ui::{self, style::SharedTheme},
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use crossterm::event::{Event, KeyCode, KeyModifiers};
|
use crossterm::event::{Event, KeyCode, KeyModifiers};
|
||||||
use strings::commands;
|
|
||||||
use tui::{
|
use tui::{
|
||||||
backend::Backend,
|
backend::Backend,
|
||||||
layout::Rect,
|
layout::Rect,
|
||||||
|
|
@ -15,7 +15,6 @@ use tui::{
|
||||||
widgets::{Clear, Text},
|
widgets::{Clear, Text},
|
||||||
Frame,
|
Frame,
|
||||||
};
|
};
|
||||||
use ui::style::SharedTheme;
|
|
||||||
|
|
||||||
/// primarily a subcomponet for user input of text (used in `CommitComponent`)
|
/// primarily a subcomponet for user input of text (used in `CommitComponent`)
|
||||||
pub struct TextInputComponent {
|
pub struct TextInputComponent {
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,13 @@
|
||||||
|
use anyhow::Result;
|
||||||
use asyncgit::StatusItem;
|
use asyncgit::StatusItem;
|
||||||
use std::{
|
use std::{
|
||||||
collections::BTreeSet,
|
collections::BTreeSet,
|
||||||
convert::TryFrom,
|
convert::TryFrom,
|
||||||
|
ffi::OsStr,
|
||||||
ops::{Index, IndexMut},
|
ops::{Index, IndexMut},
|
||||||
path::Path,
|
path::Path,
|
||||||
};
|
};
|
||||||
|
|
||||||
use anyhow::Result;
|
|
||||||
use std::ffi::OsStr;
|
|
||||||
|
|
||||||
/// holds the information shared among all `FileTreeItem` in a `FileTree`
|
/// holds the information shared among all `FileTreeItem` in a `FileTree`
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct TreeItemInfo {
|
pub struct TreeItemInfo {
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,16 @@ use crate::{
|
||||||
},
|
},
|
||||||
keys,
|
keys,
|
||||||
queue::{InternalEvent, Queue},
|
queue::{InternalEvent, Queue},
|
||||||
strings,
|
strings::{self, commands},
|
||||||
ui::style::SharedTheme,
|
ui::style::SharedTheme,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use asyncgit::{sync, AsyncLog, AsyncNotification, FetchStatus, CWD};
|
use asyncgit::{
|
||||||
|
sync::{self, CommitId},
|
||||||
|
AsyncLog, AsyncNotification, FetchStatus, CWD,
|
||||||
|
};
|
||||||
use crossbeam_channel::Sender;
|
use crossbeam_channel::Sender;
|
||||||
use crossterm::event::Event;
|
use crossterm::event::Event;
|
||||||
use strings::commands;
|
|
||||||
use sync::CommitId;
|
|
||||||
use tui::{
|
use tui::{
|
||||||
backend::Backend,
|
backend::Backend,
|
||||||
layout::{Constraint, Direction, Layout, Rect},
|
layout::{Constraint, Direction, Layout, Rect},
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ use crate::{
|
||||||
},
|
},
|
||||||
keys,
|
keys,
|
||||||
queue::{InternalEvent, Queue},
|
queue::{InternalEvent, Queue},
|
||||||
strings,
|
strings::{self, commands},
|
||||||
ui::style::SharedTheme,
|
ui::style::SharedTheme,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
|
@ -18,7 +18,6 @@ use asyncgit::{
|
||||||
use crossbeam_channel::Sender;
|
use crossbeam_channel::Sender;
|
||||||
use crossterm::event::Event;
|
use crossterm::event::Event;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use strings::commands;
|
|
||||||
use tui::{
|
use tui::{
|
||||||
layout::{Alignment, Constraint, Direction, Layout},
|
layout::{Alignment, Constraint, Direction, Layout},
|
||||||
widgets::{Block, Borders, Paragraph, Text},
|
widgets::{Block, Borders, Paragraph, Text},
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,15 @@ use crate::{
|
||||||
},
|
},
|
||||||
keys,
|
keys,
|
||||||
queue::{Action, InternalEvent, Queue},
|
queue::{Action, InternalEvent, Queue},
|
||||||
strings,
|
strings::{self, commands},
|
||||||
ui::style::SharedTheme,
|
ui::style::SharedTheme,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use asyncgit::sync;
|
use asyncgit::{
|
||||||
use asyncgit::CWD;
|
sync::{self, CommitId},
|
||||||
|
CWD,
|
||||||
|
};
|
||||||
use crossterm::event::Event;
|
use crossterm::event::Event;
|
||||||
use strings::commands;
|
|
||||||
use sync::CommitId;
|
|
||||||
|
|
||||||
pub struct StashList {
|
pub struct StashList {
|
||||||
list: CommitList,
|
list: CommitList,
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
accessors,
|
accessors,
|
||||||
components::{
|
components::{
|
||||||
self, event_pump, ChangesComponent, CommandBlocking,
|
command_pump, event_pump, visibility_blocking,
|
||||||
CommandInfo, Component, DiffComponent, DrawableComponent,
|
ChangesComponent, CommandBlocking, CommandInfo, Component,
|
||||||
FileTreeItemKind,
|
DiffComponent, DrawableComponent, FileTreeItemKind,
|
||||||
},
|
},
|
||||||
keys,
|
keys,
|
||||||
queue::{InternalEvent, Queue, ResetItem},
|
queue::{InternalEvent, Queue, ResetItem},
|
||||||
strings,
|
strings::{self, commands, order},
|
||||||
ui::style::SharedTheme,
|
ui::style::SharedTheme,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
|
@ -16,10 +16,8 @@ use asyncgit::{
|
||||||
AsyncDiff, AsyncNotification, AsyncStatus, DiffParams, DiffType,
|
AsyncDiff, AsyncNotification, AsyncStatus, DiffParams, DiffType,
|
||||||
StatusParams, CWD,
|
StatusParams, CWD,
|
||||||
};
|
};
|
||||||
use components::{command_pump, visibility_blocking};
|
|
||||||
use crossbeam_channel::Sender;
|
use crossbeam_channel::Sender;
|
||||||
use crossterm::event::Event;
|
use crossterm::event::Event;
|
||||||
use strings::{commands, order};
|
|
||||||
use tui::layout::{Constraint, Direction, Layout};
|
use tui::layout::{Constraint, Direction, Layout};
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
mod scrolllist;
|
mod scrolllist;
|
||||||
pub mod style;
|
pub mod style;
|
||||||
|
|
||||||
use scrolllist::ScrollableList;
|
use scrolllist::ScrollableList;
|
||||||
use style::SharedTheme;
|
use style::SharedTheme;
|
||||||
use tui::{
|
use tui::{
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,10 @@ use ron::{
|
||||||
ser::{to_string_pretty, PrettyConfig},
|
ser::{to_string_pretty, PrettyConfig},
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::path::PathBuf;
|
|
||||||
use std::{
|
use std::{
|
||||||
fs::File,
|
fs::File,
|
||||||
io::{Read, Write},
|
io::{Read, Write},
|
||||||
|
path::PathBuf,
|
||||||
rc::Rc,
|
rc::Rc,
|
||||||
};
|
};
|
||||||
use tui::style::{Color, Modifier, Style};
|
use tui::style::{Color, Modifier, Style};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue