Skip to content

Commit

Permalink
Debugprint ill-formed redraw event
Browse files Browse the repository at this point in the history
  • Loading branch information
ryo33 committed Feb 18, 2023
1 parent 9379c3e commit 1c0ef4d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ euclid = "0.22.7"
flexi_logger = { version = "0.22.3", default-features = false }
futures = "0.3.21"
gl = "0.14.0"
glutin = { git = "https://github.com/neovide/glutin", branch = "new-keyboard-all", features = ["serde"] }
glutin = { git = "https://github.com/neovide/glutin", branch = "new-keyboard-all", features = [
"serde",
] }
image = { version = "0.24.1", default-features = false, features = ["ico"] }
itertools = "0.10.5"
lazy_static = "1.4.0"
Expand All @@ -39,6 +41,7 @@ parking_lot = "0.12.0"
pin-project = "1.0.10"
rand = "0.8.5"
rmpv = "1.0.0"
rmp-serde = "1.0"
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.79"
swash = "0.1.4"
Expand Down
10 changes: 8 additions & 2 deletions src/bridge/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ impl Handler for NeovimHandler {
match event_name.as_ref() {
"redraw" => {
for events in arguments {
let parsed_events = parse_redraw_event(events)
.unwrap_or_explained_panic("Could not parse event from neovim");
let cloned = events.clone();
let Ok(parsed_events) = parse_redraw_event(events) else {
let mut last = Vec::new();
rmpv::encode::write_value_ref(&mut last, &cloned.as_ref()).expect("write_value_ref");
let last: serde_json::Value = rmp_serde::from_slice(&last).expect("from_slice");
let last = serde_json::to_string_pretty(&last).expect("to_string_pretty");
panic!("Could not parse event from neovim {}", last);
};

for parsed_event in parsed_events {
EVENT_AGGREGATOR.send(EditorCommand::NeovimRedrawEvent(parsed_event));
Expand Down

0 comments on commit 1c0ef4d

Please sign in to comment.