Skip to content

Commit

Permalink
fix api error
Browse files Browse the repository at this point in the history
  • Loading branch information
ModProg committed Apr 25, 2023
1 parent a1d6e8a commit 1a37cd9
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 16 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ rmp-serde = "1.1.0"
itertools = "0.10.3"
# nvim-oxi = { version = "0.2.2", features = ["test"] }
nvim-oxi = { git = "https://github.com/noib3/nvim-oxi/", features = ["test"] }
# nvim-oxi = { path = "../nvim-oxi/crates/nvim-oxi/", features = ["test"] }

[features]
default = ["0.9"]
Expand Down
8 changes: 4 additions & 4 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ pub struct AutoCommand {
pub struct Config {
// TODO investigate if `or` is the right way to interpret multiple conditions
#[merge(skip)]
conditions: Vec<Condition>,
pub conditions: Vec<Condition>,
#[merge(strategy = merge::vec::append)]
keys: Vec<Keys>,
pub keys: Vec<Keys>,
#[merge(strategy = merge::vec::append)]
#[serde_as(deserialize_as = "FromInto<SetsDeserializer>")]
set: Vec<Set>,
pub set: Vec<Set>,
#[merge(strategy = merge::vec::append)]
#[serde_as(deserialize_as = "OneOrMany<_>")]
auto_commands: Vec<AutoCommand>,
pub auto_commands: Vec<AutoCommand>,
}

impl Config {
Expand Down
6 changes: 1 addition & 5 deletions src/config/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use oxi::{
Buffer, Window,
},
conversion::{self, ToObject},
Object, ObjectKind, dbg,
Object, ObjectKind,
};
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -200,10 +200,6 @@ impl Set {
error,
"Invalid option {key}: {error}"
);
// TODO remove after (https://github.com/noib3/nvim-oxi/pull/106)
if scope.is_global() {
return Ok(());
}
let set_option = set_option(scope, buffer)?;

let get_option = get_option(scope, buffer)?;
Expand Down
2 changes: 1 addition & 1 deletion src/hashes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl Hashes {
}

pub fn load() -> Option<Self> {
rmp_serde::from_slice(&fs::read(&hashes_file()).ok()?).ok()?
rmp_serde::from_slice(&fs::read(hashes_file()).ok()?).ok()?
}

pub fn unhashed(
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn load_config(_: ()) -> Result<()> {

let mut conditional_configs: HashMap<Condition, Config> = HashMap::new();

for path in get_files("config/*.toml")?
for path in get_files("config/*.yml")?
.chain(get_files("config/*.yaml")?)
.chain(get_files("config/*.json")?)
.chain(get_files("config/*.toml")?)
Expand Down

0 comments on commit 1a37cd9

Please sign in to comment.