Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiple selection in diff view #231

Merged
merged 3 commits into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
profile: minimal
components: clippy

- name: Install dependencies for clipboard access
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get -qq install libxcb-shape0-dev libxcb-xfixes0-dev

- name: Build Debug
run: |
rustc --version
Expand Down Expand Up @@ -54,6 +59,10 @@ jobs:
profile: minimal
target: x86_64-unknown-linux-musl

- name: Install dependencies for clipboard access
run: |
sudo apt-get -qq install libxcb-shape0-dev libxcb-xfixes0-dev

- name: Setup MUSL
run: |
sudo apt-get -qq install musl-tools
Expand Down
86 changes: 86 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ serde = "1.0"
anyhow = "1.0.32"
unicode-width = "0.1"
textwrap = "0.12"
clipboard = "0.5"

[target.'cfg(not(windows))'.dependencies]
pprof = { version = "0.3", features = ["flamegraph"], optional = true }
Expand Down
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@ impl App {
self.stashmsg_popup.draw(f, size)?;
self.reset.draw(f, size)?;
self.help.draw(f, size)?;
self.msg.draw(f, size)?;
self.inspect_commit_popup.draw(f, size)?;
self.msg.draw(f, size)?;
self.external_editor_popup.draw(f, size)?;
self.tag_commit_popup.draw(f, size)?;

Expand Down
18 changes: 1 addition & 17 deletions src/components/changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
components::{CommandInfo, Component},
keys,
queue::{Action, InternalEvent, NeedsUpdate, Queue, ResetItem},
strings,
strings, try_or_popup,
ui::style::SharedTheme,
};
use anyhow::Result;
Expand All @@ -17,22 +17,6 @@ use std::path::Path;
use strings::commands;
use tui::{backend::Backend, layout::Rect, Frame};

/// macro to simplify running code that might return Err.
/// It will show a popup in that case
#[macro_export]
macro_rules! try_or_popup {
($self:ident, $msg:literal, $e:expr) => {
if let Err(err) = $e {
$self.queue.borrow_mut().push_back(
InternalEvent::ShowErrorMsg(format!(
"{}\n{}",
$msg, err
)),
);
}
};
}

///
pub struct ChangesComponent {
title: String,
Expand Down
Loading