diff --git a/.github/workflows/devskim.yml b/.github/workflows/devskim.yml
new file mode 100644
index 00000000..070b22f8
--- /dev/null
+++ b/.github/workflows/devskim.yml
@@ -0,0 +1,34 @@
+# This workflow uses actions that are not certified by GitHub.
+# They are provided by a third-party and are governed by
+# separate terms of service, privacy policy, and support
+# documentation.
+
+name: DevSkim
+
+on:
+ push:
+ branches: [ "master" ]
+ pull_request:
+ branches: [ "master" ]
+ schedule:
+ - cron: '23 18 * * 4'
+
+jobs:
+ lint:
+ name: DevSkim
+ runs-on: ubuntu-20.04
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Run DevSkim scanner
+ uses: microsoft/DevSkim-Action@v1
+
+ - name: Upload DevSkim scan results to GitHub Security tab
+ uses: github/codeql-action/upload-sarif@v2
+ with:
+ sarif_file: devskim-results.sarif
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
new file mode 100644
index 00000000..000bb2c4
--- /dev/null
+++ b/.github/workflows/rust.yml
@@ -0,0 +1,22 @@
+name: Rust
+
+on:
+ push:
+ branches: [ "master" ]
+ pull_request:
+ branches: [ "master" ]
+
+env:
+ CARGO_TERM_COLOR: always
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Build
+ run: cargo build --verbose
+ - name: Run tests
+ run: cargo test --verbose
diff --git a/Cargo.lock b/Cargo.lock
index 19554fdb..1e0e7dae 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,5 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
+version = 3
+
[[package]]
name = "aho-corasick"
version = "0.7.15"
@@ -11,9 +13,9 @@ dependencies = [
[[package]]
name = "ansi_term"
-version = "0.11.0"
+version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
+checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
dependencies = [
"winapi",
]
@@ -59,6 +61,12 @@ version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
+[[package]]
+name = "bitflags"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
+
[[package]]
name = "blake2b_simd"
version = "0.5.11"
@@ -84,28 +92,19 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clap"
-version = "2.33.3"
+version = "2.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
+checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
dependencies = [
"ansi_term",
"atty",
- "bitflags",
+ "bitflags 1.2.1",
"strsim",
"textwrap",
"unicode-width",
"vec_map",
]
-[[package]]
-name = "cloudabi"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467"
-dependencies = [
- "bitflags",
-]
-
[[package]]
name = "constant_time_eq"
version = "0.1.5"
@@ -125,25 +124,25 @@ dependencies = [
[[package]]
name = "crossterm"
-version = "0.18.2"
+version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4e86d73f2a0b407b5768d10a8c720cf5d2df49a9efc10ca09176d201ead4b7fb"
+checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df"
dependencies = [
- "bitflags",
+ "bitflags 2.5.0",
"crossterm_winapi",
- "lazy_static",
"libc",
"mio",
"parking_lot",
"signal-hook",
+ "signal-hook-mio",
"winapi",
]
[[package]]
name = "crossterm_winapi"
-version = "0.6.2"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c2265c3f8e080075d9b6417aa72293fc71662f34b4af2612d8d1b074d29510db"
+checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b"
dependencies = [
"winapi",
]
@@ -154,17 +153,26 @@ version = "3.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8fed639d60b58d0f53498ab13d26f621fd77569cc6edb031f4cc36a2ad9da0f"
dependencies = [
- "dirs-sys",
+ "dirs-sys 0.3.5",
]
[[package]]
name = "dirs"
-version = "2.0.2"
+version = "5.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3"
+checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225"
dependencies = [
- "cfg-if 0.1.10",
- "dirs-sys",
+ "dirs-sys 0.4.1",
+]
+
+[[package]]
+name = "dirs-next"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
+dependencies = [
+ "cfg-if 1.0.0",
+ "dirs-sys-next",
]
[[package]]
@@ -174,7 +182,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a"
dependencies = [
"libc",
- "redox_users",
+ "redox_users 0.3.5",
+ "winapi",
+]
+
+[[package]]
+name = "dirs-sys"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c"
+dependencies = [
+ "libc",
+ "option-ext",
+ "redox_users 0.4.5",
+ "windows-sys",
+]
+
+[[package]]
+name = "dirs-sys-next"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
+dependencies = [
+ "libc",
+ "redox_users 0.4.5",
"winapi",
]
@@ -186,25 +217,27 @@ checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
dependencies = [
"cfg-if 0.1.10",
"libc",
- "wasi",
+ "wasi 0.9.0+wasi-snapshot-preview1",
]
[[package]]
-name = "hermit-abi"
-version = "0.1.17"
+name = "getrandom"
+version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"
+checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c"
dependencies = [
+ "cfg-if 1.0.0",
"libc",
+ "wasi 0.11.0+wasi-snapshot-preview1",
]
[[package]]
-name = "instant"
-version = "0.1.8"
+name = "hermit-abi"
+version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb1fc4429a33e1f80d41dc9fea4d108a88bec1de8053878898ae448a0b52f613"
+checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [
- "cfg-if 1.0.0",
+ "libc",
]
[[package]]
@@ -215,15 +248,25 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
-version = "0.2.80"
+version = "0.2.154"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614"
+checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346"
+
+[[package]]
+name = "libredox"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
+dependencies = [
+ "bitflags 2.5.0",
+ "libc",
+]
[[package]]
name = "lock_api"
-version = "0.4.1"
+version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c"
+checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b"
dependencies = [
"scopeguard",
]
@@ -245,35 +288,21 @@ checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
[[package]]
name = "mio"
-version = "0.7.6"
+version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f33bc887064ef1fd66020c9adfc45bb9f33d75a42096c81e7c56c65b75dd1a8b"
+checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
dependencies = [
"libc",
"log",
- "miow",
- "ntapi",
- "winapi",
-]
-
-[[package]]
-name = "miow"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897"
-dependencies = [
- "socket2",
- "winapi",
+ "wasi 0.11.0+wasi-snapshot-preview1",
+ "windows-sys",
]
[[package]]
-name = "ntapi"
-version = "0.3.6"
+name = "option-ext"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
-dependencies = [
- "winapi",
-]
+checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
[[package]]
name = "ox"
@@ -293,44 +322,41 @@ dependencies = [
[[package]]
name = "parking_lot"
-version = "0.11.0"
+version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733"
+checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb"
dependencies = [
- "instant",
"lock_api",
"parking_lot_core",
]
[[package]]
name = "parking_lot_core"
-version = "0.8.0"
+version = "0.9.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
+checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
dependencies = [
- "cfg-if 0.1.10",
- "cloudabi",
- "instant",
+ "cfg-if 1.0.0",
"libc",
- "redox_syscall",
+ "redox_syscall 0.5.1",
"smallvec",
- "winapi",
+ "windows-targets 0.52.5",
]
[[package]]
name = "proc-macro2"
-version = "1.0.24"
+version = "1.0.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
+checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba"
dependencies = [
- "unicode-xid",
+ "unicode-ident",
]
[[package]]
name = "quote"
-version = "1.0.7"
+version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
+checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
dependencies = [
"proc-macro2",
]
@@ -341,17 +367,37 @@ version = "0.1.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
+[[package]]
+name = "redox_syscall"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e"
+dependencies = [
+ "bitflags 2.5.0",
+]
+
[[package]]
name = "redox_users"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d"
dependencies = [
- "getrandom",
- "redox_syscall",
+ "getrandom 0.1.15",
+ "redox_syscall 0.1.57",
"rust-argon2",
]
+[[package]]
+name = "redox_users"
+version = "0.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891"
+dependencies = [
+ "getrandom 0.2.14",
+ "libredox",
+ "thiserror",
+]
+
[[package]]
name = "regex"
version = "1.4.2"
@@ -377,7 +423,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8a58080b7bb83b2ea28c3b7a9a994fd5e310330b7c8ca5258d99b98128ecfe4"
dependencies = [
"base64",
- "bitflags",
+ "bitflags 1.2.1",
"serde",
]
@@ -393,6 +439,12 @@ dependencies = [
"crossbeam-utils",
]
+[[package]]
+name = "rustversion"
+version = "1.0.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47"
+
[[package]]
name = "scopeguard"
version = "1.1.0"
@@ -416,56 +468,54 @@ checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e"
dependencies = [
"proc-macro2",
"quote",
- "syn",
+ "syn 1.0.48",
]
[[package]]
name = "shellexpand"
-version = "2.0.0"
+version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a2b22262a9aaf9464d356f656fea420634f78c881c5eebd5ef5e66d8b9bc603"
+checksum = "da03fa3b94cc19e3ebfc88c4229c49d8f08cdbd1228870a45f0ffdf84988e14b"
dependencies = [
"dirs",
]
[[package]]
name = "signal-hook"
-version = "0.1.16"
+version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "604508c1418b99dfe1925ca9224829bb2a8a9a04dda655cc01fcad46f4ab05ed"
+checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801"
dependencies = [
"libc",
- "mio",
"signal-hook-registry",
]
[[package]]
-name = "signal-hook-registry"
-version = "1.2.2"
+name = "signal-hook-mio"
+version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce32ea0c6c56d5eacaeb814fbed9960547021d3edd010ded1425f180536b20ab"
+checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af"
dependencies = [
"libc",
+ "mio",
+ "signal-hook",
]
[[package]]
-name = "smallvec"
+name = "signal-hook-registry"
version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"
-
-[[package]]
-name = "socket2"
-version = "0.3.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fd8b795c389288baa5f355489c65e71fd48a02104600d15c4cfbc561e9e429d"
+checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1"
dependencies = [
- "cfg-if 0.1.10",
"libc",
- "redox_syscall",
- "winapi",
]
+[[package]]
+name = "smallvec"
+version = "1.13.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
+
[[package]]
name = "strsim"
version = "0.8.0"
@@ -483,13 +533,25 @@ dependencies = [
"unicode-xid",
]
+[[package]]
+name = "syn"
+version = "2.0.60"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
[[package]]
name = "term"
-version = "0.6.1"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0863a3345e70f61d613eab32ee046ccd1bcc5f9105fe402c61fcd0c13eeb8b5"
+checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f"
dependencies = [
- "dirs",
+ "dirs-next",
+ "rustversion",
"winapi",
]
@@ -502,6 +564,26 @@ dependencies = [
"unicode-width",
]
+[[package]]
+name = "thiserror"
+version = "1.0.59"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa"
+dependencies = [
+ "thiserror-impl",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "1.0.59"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.60",
+]
+
[[package]]
name = "thread_local"
version = "1.0.1"
@@ -511,17 +593,23 @@ dependencies = [
"lazy_static",
]
+[[package]]
+name = "unicode-ident"
+version = "1.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
+
[[package]]
name = "unicode-segmentation"
-version = "1.7.0"
+version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db8716a166f290ff49dabc18b44aa407cb7c6dbe1aa0971b44b8a24b0ca35aae"
+checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202"
[[package]]
name = "unicode-width"
-version = "0.1.8"
+version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
+checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6"
[[package]]
name = "unicode-xid"
@@ -541,6 +629,12 @@ version = "0.9.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
+[[package]]
+name = "wasi"
+version = "0.11.0+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
+
[[package]]
name = "winapi"
version = "0.3.9"
@@ -562,3 +656,133 @@ name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+
+[[package]]
+name = "windows-sys"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
+dependencies = [
+ "windows-targets 0.48.5",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
+dependencies = [
+ "windows_aarch64_gnullvm 0.48.5",
+ "windows_aarch64_msvc 0.48.5",
+ "windows_i686_gnu 0.48.5",
+ "windows_i686_msvc 0.48.5",
+ "windows_x86_64_gnu 0.48.5",
+ "windows_x86_64_gnullvm 0.48.5",
+ "windows_x86_64_msvc 0.48.5",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
+dependencies = [
+ "windows_aarch64_gnullvm 0.52.5",
+ "windows_aarch64_msvc 0.52.5",
+ "windows_i686_gnu 0.52.5",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc 0.52.5",
+ "windows_x86_64_gnu 0.52.5",
+ "windows_x86_64_gnullvm 0.52.5",
+ "windows_x86_64_msvc 0.52.5",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.52.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
diff --git a/Cargo.toml b/Cargo.toml
index cb16e2ee..5ad0e06b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,16 +18,16 @@ panic = "abort"
codegen-units = 1
[dependencies]
-unicode-segmentation = "1.6.0"
-unicode-width = "0.1.8"
+unicode-segmentation = "1.11.0"
+unicode-width = "0.1.12"
clap = "2.33.3"
-shellexpand = "2.0.0"
+shellexpand = "3.1.0"
ron = "0.6.2"
serde = "1.0.117"
regex = "1.4.2"
directories = "3.0.1"
-crossterm = "0.18.2"
-term = "0.6.1"
+crossterm = "0.27.0"
+term = "0.7.0"
[package.metadata.rpm]
package = "ox"
diff --git a/README.md b/README.md
index c281ac6b..ffd60c75 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+[](https://github.com/prfiredragon/ox/actions/workflows/rust.yml)
+[](https://github.com/prfiredragon/ox/actions/workflows/devskim.yml)
diff --git a/buildrrcos.sh b/buildrrcos.sh
new file mode 100644
index 00000000..dfacefcd
--- /dev/null
+++ b/buildrrcos.sh
@@ -0,0 +1,3 @@
+mkdir -pv /system/packages/ox
+cargo build --release
+cargo install --path . --root=/system/packages/ox
diff --git a/src/config.rs b/src/config.rs
index bfa9ba80..be63c156 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -110,12 +110,12 @@ impl Reader {
for expr in reg {
if expr.starts_with("(?ms)") || expr.starts_with("(?sm)") {
// Multiline regular expression
- if let Ok(regx) = Regex::new(&expr) {
+ if let Ok(regx) = Regex::new(expr) {
multi.push(regx);
}
} else {
// Single line regular expression
- if let Ok(regx) = Regex::new(&expr) {
+ if let Ok(regx) = Regex::new(expr) {
single.push(regx);
}
}
@@ -139,7 +139,7 @@ impl Reader {
}
result
}
- pub fn rgb_fg(colour: (u8, u8, u8)) -> SetForegroundColor {
+ pub const fn rgb_fg(colour: (u8, u8, u8)) -> SetForegroundColor {
// Get the text ANSI code from an RGB value
SetForegroundColor(Color::Rgb {
r: colour.0,
@@ -147,7 +147,7 @@ impl Reader {
b: colour.2,
})
}
- pub fn rgb_bg(colour: (u8, u8, u8)) -> SetBackgroundColor {
+ pub const fn rgb_bg(colour: (u8, u8, u8)) -> SetBackgroundColor {
// Get the background ANSI code from an RGB value
SetBackgroundColor(Color::Rgb {
r: colour.0,
diff --git a/src/document.rs b/src/document.rs
index 3b725f8d..0f559144 100644
--- a/src/document.rs
+++ b/src/document.rs
@@ -4,6 +4,7 @@ use crate::editor::OFFSET;
use crate::util::{line_offset, spaces_to_tabs, tabs_to_spaces};
use crate::{log, Editor, Event, EventStack, Position, Row, Size, Variable, VERSION};
use crossterm::event::KeyCode as Key;
+use directories::BaseDirs;
use regex::Regex;
use std::ffi::OsStr;
use std::fs::OpenOptions;
@@ -63,13 +64,13 @@ impl Document {
rows: vec![Row::from("")],
name: String::from("[No name]"),
dirty: false,
- cmd_line: Document::config_to_commandline(&status),
+ cmd_line: Self::config_to_commandline(status),
path: String::new(),
line_offset: config.general.line_number_padding_right
+ config.general.line_number_padding_left,
undo_stack: EventStack::new(),
redo_stack: EventStack::new(),
- regex: Reader::get_syntax_regex(&config, ""),
+ regex: Reader::get_syntax_regex(config, ""),
icon: String::new(),
kind: String::new(),
show_welcome: true,
@@ -90,7 +91,7 @@ impl Document {
// File exists
let tabs = file.contains("\n\t");
let file = tabs_to_spaces(&file, config.general.tab_width);
- let mut file = Document::split_file(&file);
+ let mut file = Self::split_file(&file);
// Handle newline on last line
if let Some(line) = file.iter().last() {
if line.is_empty() {
@@ -101,23 +102,23 @@ impl Document {
if file.is_empty() {
file.push("");
}
- let ext = path.split('.').last().unwrap_or(&"");
+ let extension = path.split('.').last().unwrap_or("");
Some(Self {
rows: file.iter().map(|row| Row::from(*row)).collect(),
name: Path::new(path)
.file_name()
.unwrap_or_else(|| OsStr::new(path))
.to_str()
- .unwrap_or(&path)
+ .unwrap_or(path)
.to_string(),
dirty: false,
- cmd_line: Document::config_to_commandline(&status),
+ cmd_line: Self::config_to_commandline(status),
path: path.to_string(),
line_offset: config.general.line_number_padding_right
+ config.general.line_number_padding_left,
undo_stack: EventStack::new(),
redo_stack: EventStack::new(),
- regex: Reader::get_syntax_regex(&config, ext),
+ regex: Reader::get_syntax_regex(config, extension),
kind: Self::identify(path).0.to_string(),
icon: Self::identify(path).1.to_string(),
show_welcome: false,
@@ -138,24 +139,24 @@ impl Document {
// Create a new document from a path with empty document on error
let true_path = path.to_string();
let path = path.split(':').next().unwrap();
- if let Some(doc) = Document::open(&config, &status, &true_path, read_only) {
+ if let Some(doc) = Self::open(config, status, &true_path, read_only) {
log!("Opening file", "File was found");
doc
} else {
// Create blank document
log!("Opening file", "File not found");
- let ext = path.split('.').last().unwrap_or(&"");
+ let ext = path.split('.').last().unwrap_or("");
Self {
rows: vec![Row::from("")],
name: path.to_string(),
path: path.to_string(),
dirty: false,
- cmd_line: Document::config_to_commandline(&status),
+ cmd_line: Self::config_to_commandline(status),
line_offset: config.general.line_number_padding_right
+ config.general.line_number_padding_left,
undo_stack: EventStack::new(),
redo_stack: EventStack::new(),
- regex: Reader::get_syntax_regex(&config, ext),
+ regex: Reader::get_syntax_regex(config, ext),
kind: Self::identify(path).0.to_string(),
icon: Self::identify(path).1.to_string(),
show_welcome: false,
@@ -265,9 +266,9 @@ impl Document {
}
Key::Up => {
// Move the cursor up
- if self.cursor.y - OFFSET == 0 {
+ if self.cursor.y == OFFSET {
self.offset.y = self.offset.y.saturating_sub(1);
- } else if self.cursor.y != OFFSET {
+ } else {
self.cursor.y = self.cursor.y.saturating_sub(1);
}
self.snap_cursor(term);
@@ -562,6 +563,18 @@ impl Document {
}
self.rows[pos.y].delete(self.graphemes.saturating_sub(1));
}
+ Event::DeletionFw(pos, _) => {
+ self.dirty = true;
+ self.show_welcome = false;
+ self.recalculate_graphemes();
+ self.goto(pos, term);
+ if reversed {
+ self.move_cursor(Key::Left, term, config.general.wrap_cursor);
+ } else {
+ self.undo_stack.push(event);
+ }
+ self.rows[pos.y].delete(self.graphemes);
+ }
Event::InsertLineAbove(pos) => {
self.dirty = true;
self.rows.insert(pos.y, Row::from(""));
@@ -586,7 +599,7 @@ impl Document {
Event::InsertTab(pos) => {
self.dirty = true;
self.goto(pos, term);
- self.tab(&pos, &config, term);
+ self.tab(&pos, config, term);
if !reversed {
self.undo_stack.push(event);
}
diff --git a/src/editor.rs b/src/editor.rs
index 455d748e..9e35472d 100644
--- a/src/editor.rs
+++ b/src/editor.rs
@@ -9,7 +9,7 @@ use crate::{log, Document, Event, Row, Size, Terminal, VERSION};
use clap::App;
use crossterm::event::{Event as InputEvent, KeyCode, KeyEvent, KeyModifiers};
use crossterm::style::{Attribute, Color, SetBackgroundColor, SetForegroundColor};
-use crossterm::ErrorKind;
+use directories::BaseDirs;
use regex::Regex;
use std::collections::HashMap;
use std::ffi::OsStr;
@@ -125,7 +125,7 @@ pub struct Editor {
// Implementing methods for our editor struct / class
impl Editor {
- pub fn new(args: App) -> Result