From 823a328d82e8abbdd13465f44e7973ed429d4460 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Tue, 29 Aug 2023 15:27:44 +0200 Subject: [PATCH] cargo update (related to #1781) --- Cargo.lock | 242 ++++++++++++++++++----------- Cargo.toml | 16 +- asyncgit/Cargo.toml | 6 +- asyncgit/src/lib.rs | 3 +- asyncgit/src/sync/commit_filter.rs | 2 + src/keys/key_config.rs | 12 +- src/keys/key_list.rs | 25 ++- src/watcher.rs | 14 +- vim_style_key_config.ron | 44 +++--- 9 files changed, 218 insertions(+), 146 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b94136d70f..2818296723 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -99,7 +99,7 @@ checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" name = "asyncgit" version = "0.24.3" dependencies = [ - "bitflags", + "bitflags 2.4.1", "crossbeam-channel", "easy-cast", "env_logger", @@ -178,6 +178,15 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +dependencies = [ + "serde", +] + [[package]] name = "bugreport" version = "0.5.0" @@ -346,11 +355,11 @@ dependencies = [ [[package]] name = "crossterm" -version = "0.26.1" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84cda67535339806297f1b331d6dd6320470d2a0fe65381e79ee9e156dd3d13" +checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags", + "bitflags 2.4.1", "crossterm_winapi", "libc", "mio", @@ -363,9 +372,9 @@ dependencies = [ [[package]] name = "crossterm_winapi" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ae1b35a484aa10e07fe0638d02301c5ad24de82d310ccbd2f3693da5f09bf1c" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" dependencies = [ "winapi", ] @@ -394,7 +403,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 1.0.107", ] [[package]] @@ -411,7 +420,7 @@ checksum = "ebf883b7aacd7b2aeb2a7b338648ee19f57c140d4ee8e52c68979c6b2f7f2263" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -421,7 +430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" dependencies = [ "cfg-if", - "hashbrown", + "hashbrown 0.12.3", "lock_api", "once_cell", "parking_lot_core", @@ -479,6 +488,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.2.8" @@ -521,14 +536,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.20" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if", "libc", - "redox_syscall", - "windows-sys 0.45.0", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", ] [[package]] @@ -705,16 +720,16 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "git2" -version = "0.17.2" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b989d6a7ca95a362cf2cfc5ad688b3a467be1f87e480b8dad07fee8c79b0044" +checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" dependencies = [ - "bitflags", + "bitflags 2.4.1", "libc", "libgit2-sys", "log", @@ -730,7 +745,7 @@ dependencies = [ "anyhow", "asyncgit", "backtrace", - "bitflags", + "bitflags 2.4.1", "bugreport", "bwrap", "bytesize", @@ -773,6 +788,18 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "hermit-abi" version = "0.3.2" @@ -821,21 +848,27 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ - "autocfg", - "hashbrown", + "equivalent", + "hashbrown 0.14.1", ] +[[package]] +name = "indoc" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" + [[package]] name = "inotify" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" dependencies = [ - "bitflags", + "bitflags 1.3.2", "inotify-sys", "libc", ] @@ -933,7 +966,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587" dependencies = [ - "bitflags", + "bitflags 1.3.2", "libc", ] @@ -951,9 +984,9 @@ checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libgit2-sys" -version = "0.15.2+1.6.4" +version = "0.16.1+1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a80df2e11fb4a61f4ba2ab42dbe7f74468da143f1a75c74e11dee7c813f694fa" +checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" dependencies = [ "cc", "libc", @@ -1058,29 +1091,31 @@ dependencies = [ [[package]] name = "notify" -version = "5.2.0" +version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729f63e1ca555a43fe3efa4f3efdf4801c479da85b432242a7b726f353c88486" +checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags", + "bitflags 2.4.1", "crossbeam-channel", "filetime", "fsevent-sys", "inotify", "kqueue", "libc", + "log", "mio", "walkdir", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "notify-debouncer-mini" -version = "0.2.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e23e9fa24f094b143c1eb61f90ac6457de87be6987bc70746e0179f7dbc9007b" +checksum = "5d40b221972a1fc5ef4d858a2f671fb34c75983eb385463dff3780eeff6a9d43" dependencies = [ "crossbeam-channel", + "log", "notify", ] @@ -1114,7 +1149,7 @@ version = "6.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c4b31c8722ad9171c6d77d3557db078cab2bd50afcc9d09c8b315c59df8ca4f" dependencies = [ - "bitflags", + "bitflags 1.3.2", "libc", "once_cell", "onig_sys", @@ -1182,11 +1217,17 @@ checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "windows-sys 0.45.0", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "percent-encoding" version = "2.3.0" @@ -1239,30 +1280,6 @@ dependencies = [ "yansi", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro-hack" version = "0.5.20+deprecated" @@ -1289,14 +1306,18 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce841e0486e7c2412c3740168ede33adeba8e154a15107b879d8162d77c7174e" +checksum = "2e2e4cd95294a85c3b4446e63ef054eea43e0205b1fd60120c16b74ff7ff96ad" dependencies = [ - "bitflags", + "bitflags 2.4.1", "cassowary", "crossterm", + "indoc", + "itertools", + "paste", "serde", + "strum", "unicode-segmentation", "unicode-width", ] @@ -1327,7 +1348,16 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", ] [[package]] @@ -1337,7 +1367,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom", - "redox_syscall", + "redox_syscall 0.2.16", "thiserror", ] @@ -1377,7 +1407,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "300a51053b1cb55c80b7a9fde4120726ddf25ca241a1cbb926626f62fb136bff" dependencies = [ "base64", - "bitflags", + "bitflags 1.3.2", "serde", ] @@ -1393,7 +1423,7 @@ version = "0.36.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", @@ -1401,6 +1431,12 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "ryu" version = "1.0.14" @@ -1452,7 +1488,7 @@ checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1468,9 +1504,9 @@ dependencies = [ [[package]] name = "serial_test" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "538c30747ae860d6fb88330addbbd3e0ddbe46d662d032855596d8a8ca260611" +checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d" dependencies = [ "dashmap", "futures", @@ -1482,13 +1518,13 @@ dependencies = [ [[package]] name = "serial_test_derive" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "079a83df15f85d89a68d64ae1238f142f172b1fa915d0d76b26a7cba1b659a69" +checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.32", ] [[package]] @@ -1508,9 +1544,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" dependencies = [ "libc", "signal-hook-registry", @@ -1575,23 +1611,44 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "struct-patch" -version = "0.2.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c25d7271340ea5e82f6d598a02ad5fc155c11b703c808b120a8873279027b4" +checksum = "7c52ef523e89b3172242bbabefd8a92493ae5571224c29ed2f00185c39b395c2" dependencies = [ "struct-patch-derive", ] [[package]] name = "struct-patch-derive" -version = "0.2.3" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f14a349c27ebe59faba22f933c9c734d428da7231e88a247e9d8c61eea964ddb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + +[[package]] +name = "strum" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead485b43c32fccb5a6ac1e94a938adcd616d80903d92fb1b1d9d633ea0d29f" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" dependencies = [ - "proc-macro-error", + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +dependencies = [ + "heck", "proc-macro2", "quote", - "syn", + "rustversion", + "syn 2.0.32", ] [[package]] @@ -1605,6 +1662,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syntect" version = "5.1.0" @@ -1612,7 +1680,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e02b4b303bf8d08bfeb0445cba5068a3d306b6baece1d5582171a9bf49188f91" dependencies = [ "bincode", - "bitflags", + "bitflags 1.3.2", "fancy-regex", "flate2", "fnv", @@ -1643,7 +1711,7 @@ checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", + "redox_syscall 0.2.16", "rustix", "windows-sys 0.42.0", ] @@ -1674,7 +1742,7 @@ checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1794,12 +1862,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "walkdir" version = "2.3.3" @@ -1837,7 +1899,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.107", "wasm-bindgen-shared", ] @@ -1859,7 +1921,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/Cargo.toml b/Cargo.toml index f1065a01ec..c8b5152192 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,26 +17,26 @@ keywords = ["git", "gui", "cli", "terminal", "ui"] anyhow = "1.0" asyncgit = { path = "./asyncgit", version = "0.24", default-features = false } backtrace = "0.3" -bitflags = "1.3" +bitflags = "2.4" bugreport = "0.5" bwrap = { version = "1.3.0", features = ["use_std"] } bytesize = { version = "1.3", default-features = false } chrono = { version = "0.4", default-features = false, features = ["clock"] } clap = { version = "4.4", features = ["env", "cargo"] } crossbeam-channel = "0.5" -crossterm = { version = "0.26.1", features = ["serde"] } +crossterm = { version = "0.27", features = ["serde"] } dirs = "5.0" easy-cast = "0.5" filetreelist = { path = "./filetreelist", version = "0.5" } fuzzy-matcher = "0.3" gh-emoji = { version = "1.0", optional = true } -indexmap = "1.9" +indexmap = "2.0" itertools = "0.11" log = "0.4" -notify = "5.1" -notify-debouncer-mini = "0.2" +notify = "6.1" +notify-debouncer-mini = "0.4" once_cell = "1" -ratatui = { version = "0.21", default-features = false, features = ['crossterm', 'serde'] } +ratatui = { version = "0.23", default-features = false, features = ['crossterm', 'serde'] } rayon-core = "1.11" ron = "0.8" scopeguard = "1.2" @@ -44,8 +44,8 @@ scopetime = { path = "./scopetime", version = "0.1" } serde = "1.0" shellexpand = "3.1" simplelog = { version = "0.12", default-features = false } -struct-patch = "0.2" -syntect = { version = "5.0", default-features = false, features = ["parsing", "default-syntaxes", "default-themes", "html"] } +struct-patch = "0.4" +syntect = { version = "5.1", default-features = false, features = ["parsing", "default-syntaxes", "default-themes", "html"] } unicode-segmentation = "1.10" unicode-truncate = "0.2" unicode-width = "0.1" diff --git a/asyncgit/Cargo.toml b/asyncgit/Cargo.toml index e927aba3f2..6e2fbe5cb3 100644 --- a/asyncgit/Cargo.toml +++ b/asyncgit/Cargo.toml @@ -12,11 +12,11 @@ categories = ["concurrency", "asynchronous"] keywords = ["git"] [dependencies] -bitflags = "1" +bitflags = "2" crossbeam-channel = "0.5" easy-cast = "0.5" fuzzy-matcher = "0.3" -git2 = "0.17" +git2 = "0.18" log = "0.4" # git2 = { path = "../../extern/git2-rs", features = ["vendored-openssl"]} # git2 = { git="https://github.com/extrawurst/git2-rs.git", rev="fc13dcc", features = ["vendored-openssl"]} @@ -35,7 +35,7 @@ url = "2.4" env_logger = "0.10" invalidstring = { path = "../invalidstring", version = "0.1" } pretty_assertions = "1.4" -serial_test = "1.0" +serial_test = "2.0" tempfile = "3.4" [features] diff --git a/asyncgit/src/lib.rs b/asyncgit/src/lib.rs index d03ed30d5e..dc75de9d52 100644 --- a/asyncgit/src/lib.rs +++ b/asyncgit/src/lib.rs @@ -27,7 +27,8 @@ //TODO: #![allow( clippy::significant_drop_tightening, - clippy::missing_panics_doc + clippy::missing_panics_doc, + clippy::multiple_crate_versions )] pub mod asyncjob; diff --git a/asyncgit/src/sync/commit_filter.rs b/asyncgit/src/sync/commit_filter.rs index 7fdb781820..2509596491 100644 --- a/asyncgit/src/sync/commit_filter.rs +++ b/asyncgit/src/sync/commit_filter.rs @@ -33,6 +33,7 @@ pub fn diff_contains_file(file_path: String) -> SharedCommitFilterFn { bitflags! { /// + #[derive(Debug, Clone, Copy)] pub struct SearchFields: u32 { /// const MESSAGE_SUMMARY = 1 << 0; @@ -59,6 +60,7 @@ impl Default for SearchFields { bitflags! { /// + #[derive(Debug, Clone, Copy)] pub struct SearchOptions: u32 { /// const CASE_SENSITIVE = 1 << 0; diff --git a/src/keys/key_config.rs b/src/keys/key_config.rs index e48db11be4..5feb560661 100644 --- a/src/keys/key_config.rs +++ b/src/keys/key_config.rs @@ -163,11 +163,11 @@ mod tests { NamedTempFile::new_in(&app_home).unwrap(); writeln!( temporary_key_list, - r" + r#" ( - move_down: Some(( code: Char('j'), modifiers: ( bits: 2,),)), + move_down: Some(( code: Char('j'), modifiers: "CONTROL")), ) -" +"# ) .unwrap(); @@ -175,11 +175,11 @@ mod tests { NamedTempFile::new_in(&app_home).unwrap(); writeln!( temporary_key_symbols, - " + r#" ( - esc: Some(\"Esc\"), + esc: Some("Esc"), ) -" +"# ) .unwrap(); diff --git a/src/keys/key_list.rs b/src/keys/key_list.rs index 5530719330..cc6fc99a6e 100644 --- a/src/keys/key_list.rs +++ b/src/keys/key_list.rs @@ -34,8 +34,8 @@ impl From<&GituiKeyEvent> for KeyEvent { } } -#[derive(Clone, Patch)] -#[patch_derive(Deserialize)] +#[derive(Debug, Clone, Patch)] +#[patch_derive(Deserialize, Debug)] pub struct KeysList { pub tab_status: GituiKeyEvent, pub tab_log: GituiKeyEvent, @@ -217,8 +217,11 @@ impl KeysList { pub fn init(file: PathBuf) -> Self { let mut keys_list = Self::default(); if let Ok(f) = File::open(file) { - if let Ok(patch) = ron::de::from_reader(f) { - keys_list.apply(patch); + match ron::de::from_reader(f) { + Ok(patch) => keys_list.apply(patch), + Err(e) => { + log::error!("KeysList parse error: {e}"); + } } } keys_list @@ -248,11 +251,12 @@ mod tests { writeln!( file, - r" + r#" ( - move_down: Some(( code: Char('j'), modifiers: ( bits: 2,),)), + move_down: Some(( code: Char('j'), modifiers: "CONTROL")), + move_up: Some((code: Char('h'), modifiers: "")) ) -" +"# ) .unwrap(); @@ -266,5 +270,12 @@ mod tests { KeyModifiers::CONTROL ) ); + assert_eq!( + keys.move_up, + GituiKeyEvent::new( + KeyCode::Char('h'), + KeyModifiers::NONE + ) + ); } } diff --git a/src/watcher.rs b/src/watcher.rs index 42fe8dcfae..9c557b92bb 100644 --- a/src/watcher.rs +++ b/src/watcher.rs @@ -1,7 +1,7 @@ use anyhow::Result; use crossbeam_channel::{unbounded, Sender}; -use notify::{Error, RecommendedWatcher, RecursiveMode, Watcher}; -use notify_debouncer_mini::{new_debouncer, DebouncedEvent}; +use notify::{RecommendedWatcher, RecursiveMode, Watcher}; +use notify_debouncer_mini::{new_debouncer, DebounceEventResult}; use scopetime::scope_time; use std::{path::Path, thread, time::Duration}; @@ -43,9 +43,7 @@ impl RepoWatcher { } fn forwarder( - receiver: &std::sync::mpsc::Receiver< - Result, Vec>, - >, + receiver: &std::sync::mpsc::Receiver, sender: &Sender<()>, ) -> Result<()> { loop { @@ -68,15 +66,13 @@ impl RepoWatcher { fn create_watcher( timeout: Duration, - tx: std::sync::mpsc::Sender< - Result, Vec>, - >, + tx: std::sync::mpsc::Sender, workdir: &str, ) { scope_time!("create_watcher"); let mut bouncer = - new_debouncer(timeout, None, tx).expect("Watch create error"); + new_debouncer(timeout, tx).expect("Watch create error"); bouncer .watcher() .watch(Path::new(&workdir), RecursiveMode::Recursive) diff --git a/vim_style_key_config.ron b/vim_style_key_config.ron index 25d4091df9..e4288b8c68 100644 --- a/vim_style_key_config.ron +++ b/vim_style_key_config.ron @@ -6,40 +6,40 @@ // Note: // If the default key layout is lower case, // and you want to use `Shift + q` to trigger the exit event, -// the setting should like this `exit: Some(( code: Char('Q'), modifiers: ( bits: 1,),)),` +// the setting should like this `exit: Some(( code: Char('Q'), modifiers: "SHIFT")),` // The Char should be upper case, and the shift modified bit should be set to 1. // // Note: // find `KeysList` type in src/keys/key_list.rs for all possible keys. // every key not overwritten via the config file will use the default specified there ( - open_help: Some(( code: F(1), modifiers: ( bits: 0,),)), + open_help: Some(( code: F(1), modifiers: "")), - move_left: Some(( code: Char('h'), modifiers: ( bits: 0,),)), - move_right: Some(( code: Char('l'), modifiers: ( bits: 0,),)), - move_up: Some(( code: Char('k'), modifiers: ( bits: 0,),)), - move_down: Some(( code: Char('j'), modifiers: ( bits: 0,),)), + move_left: Some(( code: Char('h'), modifiers: "")), + move_right: Some(( code: Char('l'), modifiers: "")), + move_up: Some(( code: Char('k'), modifiers: "")), + move_down: Some(( code: Char('j'), modifiers: "")), - popup_up: Some(( code: Char('p'), modifiers: ( bits: 2,),)), - popup_down: Some(( code: Char('n'), modifiers: ( bits: 2,),)), - page_up: Some(( code: Char('b'), modifiers: ( bits: 2,),)), - page_down: Some(( code: Char('f'), modifiers: ( bits: 2,),)), - home: Some(( code: Char('g'), modifiers: ( bits: 0,),)), - end: Some(( code: Char('G'), modifiers: ( bits: 1,),)), - shift_up: Some(( code: Char('K'), modifiers: ( bits: 1,),)), - shift_down: Some(( code: Char('J'), modifiers: ( bits: 1,),)), + popup_up: Some(( code: Char('p'), modifiers: "CONTROL")), + popup_down: Some(( code: Char('n'), modifiers: "CONTROL")), + page_up: Some(( code: Char('b'), modifiers: "CONTROL")), + page_down: Some(( code: Char('f'), modifiers: "CONTROL")), + home: Some(( code: Char('g'), modifiers: "")), + end: Some(( code: Char('G'), modifiers: "SHIFT")), + shift_up: Some(( code: Char('K'), modifiers: "SHIFT")), + shift_down: Some(( code: Char('J'), modifiers: "SHIFT")), - edit_file: Some(( code: Char('I'), modifiers: ( bits: 1,),)), + edit_file: Some(( code: Char('I'), modifiers: "SHIFT")), - status_reset_item: Some(( code: Char('U'), modifiers: ( bits: 1,),)), + status_reset_item: Some(( code: Char('U'), modifiers: "SHIFT")), - diff_reset_lines: Some(( code: Char('u'), modifiers: ( bits: 0,),)), - diff_stage_lines: Some(( code: Char('s'), modifiers: ( bits: 0,),)), + diff_reset_lines: Some(( code: Char('u'), modifiers: "")), + diff_stage_lines: Some(( code: Char('s'), modifiers: "")), - stashing_save: Some(( code: Char('w'), modifiers: ( bits: 0,),)), - stashing_toggle_index: Some(( code: Char('m'), modifiers: ( bits: 0,),)), + stashing_save: Some(( code: Char('w'), modifiers: "")), + stashing_toggle_index: Some(( code: Char('m'), modifiers: "")), - stash_open: Some(( code: Char('l'), modifiers: ( bits: 0,),)), + stash_open: Some(( code: Char('l'), modifiers: "")), - abort_merge: Some(( code: Char('M'), modifiers: ( bits: 1,),)), + abort_merge: Some(( code: Char('M'), modifiers: "SHIFT")), )