summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2022-06-29 09:13:00 +0800
committerSebastian Thiel <sebastian.thiel@icloud.com>2022-06-29 09:15:37 +0800
commit2abb429bbcf7a9d9e3ab84e49c9d11de94109680 (patch)
treeda3518b43f464f028245fee6d34759d3ff9f8b6f
parentc0e3678c9f0eb61885c259b34355b4fd0ae0e3f3 (diff)
write debug information in any case to gain some insights on `open::that()`debug-open
-rw-r--r--src/interactive/app/handlers.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/interactive/app/handlers.rs b/src/interactive/app/handlers.rs
index eae0e6c..beffcb1 100644
--- a/src/interactive/app/handlers.rs
+++ b/src/interactive/app/handlers.rs
@@ -50,7 +50,14 @@ impl CursorDirection {
impl AppState {
pub fn open_that(&self, traversal: &Traversal) {
if let Some(idx) = self.selected {
- open::that(path_of(&traversal.tree, idx)).ok();
+ let res = open::that(path_of(&traversal.tree, idx));
+ use std::io::Write;
+ std::fs::OpenOptions::new()
+ .create(true)
+ .append(true)
+ .open("dua-open.dbg")
+ .and_then(|mut file| file.write_all(format!("{:?}", res).as_bytes()))
+ .ok();
}
}