Skip to content

Commit

Permalink
release: v5.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
AMythicDev committed Apr 10, 2023
1 parent fbd0801 commit 355ad0d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Changelog
This file documents all changes made to the project and is updated before each release.

## v5.3.0 [2023-04-10]
### Added
* Add a new native API for defining key/mouse bindings (#93)

### Fixed
* Fixed a bug where screen would get broken if user scrolls with the mouse while simultaneously data in also being
inserted onto the screen (#92)

### Misc
* Removed dependency from [crossbeam-utils](https://crates.io/crates/crossbeam-utils)

## v5.2.1 [2023-03-22]
### Fixed
* Fixed bug where copy pasting the default `DefaultInputClassifier` template causes a compile error(#90)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "minus"
version = "5.2.1"
version = "5.3.0"
authors = ["Arijit Dey <[email protected]>"]
edition = "2018"
license = "MIT OR Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Add minus as a dependency in your `Cargo.toml` file and enable features as you l

```toml
[dependencies.minus]
version = "5.2.1"
version = "5.3.0"
features = [
# Enable features you want. For example
"dynamic_output",
Expand Down
4 changes: 2 additions & 2 deletions src/input/event_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ use std::{
pub struct HashedEventRegister<S>(HashMap<EventWrapper, EventReturnType, S>);

/// A convinient type for the return type of [`HashedInputRegister::get`]
/// A convinient type for the return type of [`HashedEventRegister::get`]
type EventReturnType = Arc<dyn Fn(Event, &PagerState) -> InputEvent + Send + Sync>;

#[derive(Copy, Clone, Eq)]
Expand Down Expand Up @@ -173,7 +173,7 @@ where
self.0.insert(EventWrapper::WildEvent, Arc::new(cb));
}

pub fn get(&self, k: &Event) -> Option<&EventReturnType> {
fn get(&self, k: &Event) -> Option<&EventReturnType> {
self.0
.get(&k.into())
.map_or_else(|| self.0.get(&EventWrapper::WildEvent), |k| Some(k))
Expand Down
3 changes: 2 additions & 1 deletion src/input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ pub trait InputClassifier {
fn classify_input(&self, ev: Event, ps: &PagerState) -> Option<InputEvent>;
}

pub fn generate_default_bindingss<S>(map: &mut HashedEventRegister<S>)
/// Insert the default set of actions into the [`HashedEventRegister`]
pub fn generate_default_bindings<S>(map: &mut HashedEventRegister<S>)
where
S: std::hash::BuildHasher,
{
Expand Down
6 changes: 3 additions & 3 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::minus_core::{ev_handler::handle_event, events::Event};
use crossbeam_channel::Receiver;

/// Holds all information and configuration about the pager during
/// its un time.
/// its run time.
///
/// This type is exposed so that end-applications can implement the
/// [`InputClassifier`](input::InputClassifier) trait which requires the `PagerState` to be passed
Expand Down Expand Up @@ -128,7 +128,7 @@ impl PagerState {
.unwrap_or_else(|_| String::from("minus"));

let mut event_register = HashedEventRegister::default();
input::generate_default_bindingss(&mut event_register);
input::generate_default_bindings(&mut event_register);

let mut state = Self {
lines: String::with_capacity(u16::MAX.into()),
Expand Down Expand Up @@ -173,7 +173,7 @@ impl PagerState {
/// # Errors
/// This function will return an error if it could not create the default [`PagerState`] or fails
/// to process the events
pub fn generate_initial_state(
pub(crate) fn generate_initial_state(
rx: &mut Receiver<Event>,
mut out: &mut Stdout,
) -> Result<Self, MinusError> {
Expand Down

0 comments on commit 355ad0d

Please sign in to comment.