Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
konradsz committed Apr 14, 2024
1 parent 4ab556b commit 9ba609e
Show file tree
Hide file tree
Showing 11 changed files with 400 additions and 337 deletions.
656 changes: 372 additions & 284 deletions Cargo.lock

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,23 @@ name = "ig"
path = "src/main.rs"

[dependencies]
grep = "0.2.8"
ignore = "0.4.18"
grep = "0.3.1"
ignore = "0.4.22"
clap = { version = "3.1.6", features = ["derive", "env"] }
crossterm = "0.23.0"
ratatui = { version = "0.21.0", default-features = false, features = ['crossterm'] }
unicode-width = "0.1"
itertools = "0.10.0"
anyhow = "1.0.38"
strum = { version = "0.24", features = ["derive"] }
strum_macros = "0.24.0"
crossterm = "0.27.0"
ratatui = { version = "0.26.1", default-features = false, features = [
'crossterm',
] }
unicode-width = "0.1.11"
itertools = "0.12.1"
anyhow = "1.0.82"
strum = { version = "0.26.2", features = ["derive"] }
syntect = "5.0.0"

[dev-dependencies]
lazy_static = "1.4.0"
test-case = "2.0.0"
mockall = "0.11.0"
test-case = "3.3.1"
mockall = "0.12.1"

[build-dependencies]
anyhow = "1.0.38"
anyhow = "1.0.82"
6 changes: 1 addition & 5 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,7 @@ impl App {
Ok(())
}

fn draw(
frame: &mut Frame<CrosstermBackend<std::io::Stdout>>,
app: &mut App,
input_handler: &InputHandler,
) {
fn draw(frame: &mut Frame, app: &mut App, input_handler: &InputHandler) {
let chunks = Layout::default()
.direction(Direction::Vertical)
.constraints([Constraint::Min(1), Constraint::Length(1)].as_ref())
Expand Down
2 changes: 1 addition & 1 deletion src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{
io,
process::{Child, Command},
};
use strum_macros::Display;
use strum::Display;

#[derive(Display, Default, PartialEq, Eq, Copy, Clone, Debug, ArgEnum)]
#[strum(serialize_all = "lowercase")]
Expand Down
16 changes: 5 additions & 11 deletions src/ui/bottom_bar.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use ratatui::{
backend::CrosstermBackend,
layout::{Alignment, Constraint, Direction, Layout, Rect},
style::Style,
text::Span,
Expand All @@ -16,7 +15,7 @@ use super::{
};

pub fn draw(
frame: &mut Frame<CrosstermBackend<std::io::Stdout>>,
frame: &mut Frame,
area: Rect,
result_list: &ResultList,
ig: &Ig,
Expand Down Expand Up @@ -44,12 +43,7 @@ pub fn draw(
draw_selected_info(frame, hsplit[3], selected_info_text, theme);
}

fn draw_app_status(
frame: &mut Frame<CrosstermBackend<std::io::Stdout>>,
area: Rect,
ig: &Ig,
theme: &dyn Theme,
) {
fn draw_app_status(frame: &mut Frame, area: Rect, ig: &Ig, theme: &dyn Theme) {
let (app_status_text, app_status_style) = if ig.is_searching() {
("SEARCHING", theme.searching_state_style())
} else if ig.last_error().is_some() {
Expand All @@ -68,7 +62,7 @@ fn draw_app_status(
}

fn draw_search_result_summary(
frame: &mut Frame<CrosstermBackend<std::io::Stdout>>,
frame: &mut Frame,
area: Rect,
ig: &Ig,
result_list: &ResultList,
Expand Down Expand Up @@ -112,7 +106,7 @@ fn draw_search_result_summary(
}

fn draw_current_input(
frame: &mut Frame<CrosstermBackend<std::io::Stdout>>,
frame: &mut Frame,
area: Rect,
input_handler: &InputHandler,
theme: &dyn Theme,
Expand Down Expand Up @@ -145,7 +139,7 @@ fn render_selected_info_text(result_list: &ResultList) -> String {
}

fn draw_selected_info(
frame: &mut Frame<CrosstermBackend<std::io::Stdout>>,
frame: &mut Frame,
area: Rect,
selected_info_text: String,
theme: &dyn Theme,
Expand Down
9 changes: 1 addition & 8 deletions src/ui/context_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use std::{
use clap::ValueEnum;
use itertools::Itertools;
use ratatui::{
backend::CrosstermBackend,
layout::{Constraint, Direction, Layout, Rect},
style::{Color, Style},
text::{Line, Span},
Expand Down Expand Up @@ -150,13 +149,7 @@ impl ContextViewer {
}
}

pub fn draw(
&self,
frame: &mut Frame<CrosstermBackend<std::io::Stdout>>,
area: Rect,
result_list: &ResultList,
theme: &dyn Theme,
) {
pub fn draw(&self, frame: &mut Frame, area: Rect, result_list: &ResultList, theme: &dyn Theme) {
let block_widget = Block::default()
.borders(Borders::ALL)
.border_type(BorderType::Rounded);
Expand Down
3 changes: 3 additions & 0 deletions src/ui/input_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ impl InputHandler {
KeyEvent {
code: KeyCode::Char('c'),
modifiers: KeyModifiers::CONTROL,
..
} => app.on_exit(),
KeyEvent {
code: KeyCode::Char(character),
Expand All @@ -77,6 +78,7 @@ impl InputHandler {
| KeyEvent {
code: KeyCode::Char('c'),
modifiers: KeyModifiers::CONTROL,
..
}
| KeyEvent {
code: KeyCode::F(5),
Expand All @@ -88,6 +90,7 @@ impl InputHandler {
KeyEvent {
code: KeyCode::Char(c),
modifiers: modifier,
..
} => {
if modifier == KeyModifiers::SHIFT {
app.on_char_inserted(c.to_ascii_uppercase());
Expand Down
7 changes: 1 addition & 6 deletions src/ui/keymap_popup.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use ratatui::{
backend::CrosstermBackend,
layout::{Alignment, Rect},
text::Text,
widgets::{Block, Borders, Clear, Padding, Paragraph},
Expand Down Expand Up @@ -51,11 +50,7 @@ impl KeymapPopup {
self.scroll_x = self.scroll_x.saturating_sub(1);
}

pub fn draw(
&mut self,
frame: &mut Frame<CrosstermBackend<std::io::Stdout>>,
theme: &dyn Theme,
) {
pub fn draw(&mut self, frame: &mut Frame, theme: &dyn Theme) {
if !self.visible {
return;
}
Expand Down
8 changes: 1 addition & 7 deletions src/ui/result_list.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::cmp;

use ratatui::{
backend::CrosstermBackend,
layout::Rect,
style::Style,
text::{Line, Span},
Expand Down Expand Up @@ -303,12 +302,7 @@ impl ResultList {
self.filtered_matches_count
}

pub fn draw(
&mut self,
frame: &mut Frame<CrosstermBackend<std::io::Stdout>>,
area: Rect,
theme: &dyn Theme,
) {
pub fn draw(&mut self, frame: &mut Frame, area: Rect, theme: &dyn Theme) {
let files_list: Vec<ListItem> = self
.iter()
.map(|e| match e {
Expand Down
3 changes: 1 addition & 2 deletions src/ui/search_popup.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use ratatui::{
backend::CrosstermBackend,
layout::{Alignment, Constraint, Direction, Layout, Rect},
text::{Line, Text},
widgets::{Block, Borders, Clear, Paragraph},
Expand Down Expand Up @@ -35,7 +34,7 @@ impl SearchPopup {
self.pattern.pop();
}

pub fn draw(&self, frame: &mut Frame<CrosstermBackend<std::io::Stdout>>, theme: &dyn Theme) {
pub fn draw(&self, frame: &mut Frame, theme: &dyn Theme) {
if !self.visible {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pub mod light;

use clap::ArgEnum;
use ratatui::style::{Color, Modifier, Style};
use strum_macros::Display;
use strum::Display;

#[derive(Display, Copy, Clone, Debug, ArgEnum)]
#[strum(serialize_all = "lowercase")]
Expand Down

0 comments on commit 9ba609e

Please sign in to comment.