Skip to content

Commit

Permalink
Fix SelectAll and UI colors (#604)
Browse files Browse the repository at this point in the history
- SelectAll will not unselect the existing paths. Same for
  ToggleSelectAll.
- Fixed UI bug causing random bold characters (deps).
  • Loading branch information
sayanarijit committed Mar 25, 2023
1 parent c791757 commit b995be0
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 72 deletions.
101 changes: 47 additions & 54 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ path = './benches/criterion.rs'

[package]
name = 'xplr'
version = '0.21.0'
version = '0.21.1'
authors = ['Arijit Basu <[email protected]>']
edition = '2021'
description = 'A hackable, minimal, fast TUI file explorer'
Expand All @@ -29,8 +29,8 @@ anyhow = "1.0.70"
serde_yaml = "0.9.19"
crossterm = "0.26.1"
dirs = "5.0.0"
ansi-to-tui-forked = "3.0.0-ratatui"
regex = "1.7.1"
ansi-to-tui = "3.0.0"
regex = "1.7.3"
gethostname = "0.4.1"
serde_json = "1.0.94"
path-absolutize = "3.0.14"
Expand All @@ -55,25 +55,25 @@ version = "2.0.4"
features = ["rev-mappings"]

[dependencies.tui]
version = "0.20.0"
version = "0.20.1"
default-features = false
features = ['crossterm', 'serde']
package = 'ratatui'

[dependencies.serde]
version = "1.0.157"
version = "1.0.158"
features = ['derive']

[dependencies.indexmap]
version = "1.9.2"
version = "1.9.3"
features = ['serde']

[dependencies.mlua]
version = "0.8.8"
features = ['luajit', 'vendored', 'serialize', 'send']

[dependencies.tui-input]
version = "0.6.1"
version = "0.7.0"
features = ['serde']

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions docs/en/src/upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ compatibility.

### Instructions

#### [v0.20.2][48] -> [v0.21.0][49]
#### [v0.20.2][48] -> [v0.21.1][49]

- Some plugins might stop rendering colors. Wait for them to update.
- Rename `xplr.config.general.sort_and_filter_ui.search_identifier` to
Expand Down Expand Up @@ -516,5 +516,5 @@ Else do the following:
[46]: https://github.com/sayanarijit/xplr/releases/tag/v0.18.0
[47]: https://github.com/sayanarijit/xplr/releases/tag/v0.19.4
[48]: https://github.com/sayanarijit/xplr/releases/tag/v0.20.2
[49]: https://github.com/sayanarijit/xplr/releases/tag/v0.21.0
[49]: https://github.com/sayanarijit/xplr/releases/tag/v0.21.1
[50]: https://github.com/lotabout/skim#search-syntax
12 changes: 6 additions & 6 deletions src/lua/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,24 +160,24 @@ mod tests {
assert!(check_version(VERSION, "foo path").is_ok());

// Current release if OK
assert!(check_version("0.21.0", "foo path").is_ok());
assert!(check_version("0.21.1", "foo path").is_ok());

// Prev major release is ERR
// - Not yet

// Prev minor release is ERR (Change when we get to v1)
assert!(check_version("0.20.0", "foo path").is_err());
assert!(check_version("0.20.1", "foo path").is_err());

// Prev bugfix release is OK
// assert!(check_version("0.21.-1", "foo path").is_ok());
assert!(check_version("0.21.0", "foo path").is_ok());

// Next major release is ERR
assert!(check_version("1.20.0", "foo path").is_err());
assert!(check_version("1.20.1", "foo path").is_err());

// Next minor release is ERR
assert!(check_version("0.22.0", "foo path").is_err());
assert!(check_version("0.22.1", "foo path").is_err());

// Next bugfix release is ERR (Change when we get to v1)
assert!(check_version("0.21.1", "foo path").is_err());
assert!(check_version("0.21.2", "foo path").is_err());
}
}
6 changes: 3 additions & 3 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::config::PanelUiConfig;
use crate::lua;
use crate::permissions::Permissions;
use crate::{app, path};
use ansi_to_tui_forked::IntoText;
use ansi_to_tui::IntoText;
use indexmap::IndexSet;
use lazy_static::lazy_static;
use lscolors::{Color as LsColorsColor, Style as LsColorsStyle};
Expand Down Expand Up @@ -258,7 +258,7 @@ pub enum Modifier {
}

impl Modifier {
pub fn bits(self) -> u8 {
pub fn bits(self) -> u16 {
match self {
Self::Bold => TuiModifier::BOLD.bits(),
Self::Dim => TuiModifier::DIM.bits(),
Expand Down Expand Up @@ -315,7 +315,7 @@ impl Style {

impl Into<TuiStyle> for Style {
fn into(self) -> TuiStyle {
fn xor(modifiers: Option<IndexSet<Modifier>>) -> u8 {
fn xor(modifiers: Option<IndexSet<Modifier>>) -> u16 {
modifiers
.unwrap_or_default()
.into_iter()
Expand Down

0 comments on commit b995be0

Please sign in to comment.