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

Screen refactor #44

Merged
merged 1 commit into from
Nov 21, 2018
Merged

Screen refactor #44

merged 1 commit into from
Nov 21, 2018

Conversation

TimonPost
Copy link
Member

Putted Screen behind an Option. Now when you call the functions: color, cursor, terminal, input you won't need to provide a screen for it anymore.

When you want to work with the alternate screen you can call the following functions: terminal::from_screen etc. Which will give you an instance to the back of the module you are calling it in.

So instead of:

let color = color(Screen::default());
let cursor = cursor(Screen::default());
let input = input(Screen::default());
let terminal = terminal(Screen::default());

You can do:

let color = color();
let cursor = cursor();
let input = input();
let terminal = terminal();

which looks much better too.

@TimonPost TimonPost force-pushed the screen_refactor branch 3 times, most recently from 0dfabeb to b717d30 Compare November 21, 2018 13:56
@TimonPost TimonPost merged commit 8ac61db into master Nov 21, 2018
…color, cursor, terminal, input you won't need to provide a `Screen` anymore.

When you want to work with the 'alternate screen' you can call the following functions: terminal::from_screen etc. Which will give you an instance to the back of the module you are calling it in.

So instead of:

let color = color(Screen::default());
let cursor = cursor(Screen::default());
let input = input(Screen::default());
let terminal = terminal(Screen::default());

You can do:

let color = color();
let cursor = cursor();
let input = input();
let terminal = terminal();
@TimonPost TimonPost deleted the screen_refactor branch November 21, 2018 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant