From 403d114d8296fe37dbdb509449a2fee2badb8d37 Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 4 Aug 2020 12:17:09 +0530 Subject: add feature to compile on windows, switch to termion --- src/main.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 84fd8ee..56c521d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,13 @@ use crate::command::{open_command_window, Command}; use crate::utils::{load_configuration_file, AppConfig}; use clap::{App as ClapApp, Arg}; -use cursive::pancurses; + +#[cfg(any(feature = "termion-backend", feature = "default"))] +use cursive::termion; + +#[cfg(feature = "crossterm-backend")] +use cursive::crossterm; + use cursive::views::{LinearLayout, NamedView}; use lazy_static::lazy_static; @@ -62,7 +68,11 @@ fn main() { println!("{}", h); } } else { - let mut s = pancurses().unwrap(); + #[cfg(any(feature = "termion-backend", feature = "default"))] + let mut s = termion().unwrap(); + + #[cfg(feature = "crossterm-backend")] + let mut s = crossterm().unwrap(); let app = App::load_state(); let layout = NamedView::new( -- cgit v1.2.3