Skip to content

Commit

Permalink
move App from ui module
Browse files Browse the repository at this point in the history
  • Loading branch information
konradsz committed Nov 1, 2023
1 parent 441eee2 commit 083a888
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 20 deletions.
10 changes: 5 additions & 5 deletions src/ui/app.rs → src/app.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use super::{
bottom_bar, context_viewer::ContextViewer, input_handler::InputHandler,
keymap_popup::KeymapPopup, result_list::ResultList, search_popup::SearchPopup, theme::Theme,
};

use crate::{
editor::EditorCommand,
ig::{Ig, SearchConfig},
ui::{
bottom_bar, context_viewer::ContextViewer, input_handler::InputHandler,
keymap_popup::KeymapPopup, result_list::ResultList, search_popup::SearchPopup,
theme::Theme,
},
};
use anyhow::Result;
use crossterm::{
Expand Down
7 changes: 3 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use anyhow::Result;
use app::App;
use args::Args;
use editor::EditorCommand;
use std::io::Write;
use ui::{
theme::{dark::Dark, light::Light, Theme, ThemeVariant},
App,
};
use ui::theme::{dark::Dark, light::Light, Theme, ThemeVariant};

mod app;
mod args;
mod editor;
pub mod ig;
Expand Down
6 changes: 4 additions & 2 deletions src/ui/input_handler.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use super::app::Application;
use anyhow::Result;
use crossterm::event::{poll, read, Event, KeyCode, KeyEvent, KeyModifiers};
use std::time::Duration;

use crate::app::Application;

#[derive(Default)]
pub struct InputHandler {
input_buffer: String,
Expand Down Expand Up @@ -241,8 +242,9 @@ impl InputHandler {

#[cfg(test)]
mod tests {
use crate::app::MockApplication;

use super::*;
use crate::ui::app::MockApplication;
use crossterm::event::KeyCode::{Char, Esc};
use test_case::test_case;

Expand Down
16 changes: 7 additions & 9 deletions src/ui/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
pub mod app;
pub use app::App;

mod bottom_bar;
mod context_viewer;
mod input_handler;
mod keymap_popup;
pub mod bottom_bar;
pub mod context_viewer;
pub mod input_handler;
pub mod keymap_popup;
pub mod result_list;
mod scroll_offset_list;
mod search_popup;
pub mod search_popup;
pub mod theme;

mod scroll_offset_list;

0 comments on commit 083a888

Please sign in to comment.