From 32f613430932e44eea60b9e2c6e2171c2e9f5456 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Sun, 29 Jan 2023 11:15:19 +0100 Subject: [PATCH] log errors in key bindings parsing (#1491) --- CHANGELOG.md | 1 + src/keys/key_list.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ca7f03c..1d9f2278 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * `edit`-file command shown on commits msg ([#1461](https://github.com/extrawurst/gitui/issues/1461)) * crash on branches popup in small terminal ([#1470](https://github.com/extrawurst/gitui/issues/1470)) * `edit` command duplication ([#1489](https://github.com/extrawurst/gitui/issues/1489)) +* syntax errors in `key_bindings.ron` will be logged ([#1491](https://github.com/extrawurst/gitui/issues/1491)) ### Changed * minimum supported rust version bumped to 1.64 (thank you `clap`) diff --git a/src/keys/key_list.rs b/src/keys/key_list.rs index 1f60899c..d1120549 100644 --- a/src/keys/key_list.rs +++ b/src/keys/key_list.rs @@ -205,8 +205,9 @@ impl Default for KeysList { impl KeysList { pub fn init(file: PathBuf) -> Self { if file.exists() { - let file = - KeysListFile::read_file(file).unwrap_or_default(); + let file = KeysListFile::read_file(file) + .map_err(|e| log::error!("key binding error: {e}",)) + .unwrap_or_default(); file.get_list() } else { Self::default()