Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Refactor #3

Merged
merged 9 commits into from
Oct 1, 2019
Merged

Refactor #3

merged 9 commits into from
Oct 1, 2019

Conversation

TimonPost
Copy link
Member

@TimonPost TimonPost commented Sep 26, 2019

  • book -> lib.rs
  • removed /src/input/input.rs
  • some namespace refactoring
  • added some examples and made them compile
  • ITerminalInput -> Input
  • removed unsafe code
  • handled tab WinApi property

@TimonPost TimonPost changed the title [WIP] Refactor Refactor Sep 27, 2019
src/input.rs Outdated
#[cfg(unix)]
mod unix_input;
pub(crate) mod unix_input;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to follow style of what we're doing now here - drop the _unix suffix here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 👍 means okay, but in another PR?

@@ -41,7 +44,7 @@ const ENABLE_MOUSE_MODE: u32 = 0x0010 | 0x0080 | 0x0008;
// NOTE (@imdaveho): this global var is terrible -> move it elsewhere...
static mut ORIG_MODE: u32 = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fix the static mut in this PR as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review re-requested, but it's still there. Does it mean that it will be in another PR?

@zrzka
Copy link
Contributor

zrzka commented Sep 30, 2019

LGTM except couple of things:

  • still static mut
  • still unix_input.rs
  • no change log update

@TimonPost
Copy link
Member Author

Sorry, I figured the up-to-date code was not yet pushed.

Copy link
Contributor

@zrzka zrzka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I will follow up this one with docs PR.

@@ -38,10 +42,29 @@ impl WindowsInput {

const ENABLE_MOUSE_MODE: u32 = 0x0010 | 0x0080 | 0x0008;

// NOTE (@imdaveho): this global var is terrible -> move it elsewhere...
static mut ORIG_MODE: u32 = 0;
lazy_static! {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this & ENABLE_MOUSE_MODE above the pub(crate) struct WindowsInput; line? Just to keep constants, statics, ... at the "top" (below imports & modules).

src/input/windows.rs Show resolved Hide resolved
src/sys/unix.rs Show resolved Hide resolved
@TimonPost TimonPost merged commit 327dfa7 into master Oct 1, 2019
@TimonPost TimonPost deleted the refactor branch October 11, 2019 12:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants