mirror of
https://github.com/lotabout/skim.git
synced 2026-09-10 07:16:23 -04:00
* fix: manually acquire cursor pos (closes #885) * chore: bump version * chore: generate completions & manpage * chore: revert crate upgrades * chore: generate completions & manpage --------- Co-authored-by: Loric André <loric.andre@noreply.me> Co-authored-by: Skim bot <skim-bot@skim-rs.github.io>
This commit is contained in:
parent
19d19eb6c6
commit
bd7af947e3
170
Cargo.lock
generated
170
Cargo.lock
generated
|
|
@ -174,9 +174,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
|
|||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "4.5.53"
|
||||
version = "4.5.54"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8"
|
||||
checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394"
|
||||
dependencies = [
|
||||
"clap_builder",
|
||||
"clap_derive",
|
||||
|
|
@ -184,9 +184,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clap_builder"
|
||||
version = "4.5.53"
|
||||
version = "4.5.54"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00"
|
||||
checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00"
|
||||
dependencies = [
|
||||
"anstream",
|
||||
"anstyle",
|
||||
|
|
@ -196,9 +196,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clap_complete"
|
||||
version = "4.5.61"
|
||||
version = "4.5.65"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39615915e2ece2550c0149addac32fb5bd312c657f43845bb9088cb9c8a7c992"
|
||||
checksum = "430b4dc2b5e3861848de79627b2bedc9f3342c7da5173a14eaa5d0f8dc18ae5d"
|
||||
dependencies = [
|
||||
"clap",
|
||||
]
|
||||
|
|
@ -219,9 +219,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clap_lex"
|
||||
version = "0.7.6"
|
||||
version = "0.7.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
|
||||
checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32"
|
||||
|
||||
[[package]]
|
||||
name = "clap_mangen"
|
||||
|
|
@ -348,8 +348,18 @@ version = "0.20.11"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee"
|
||||
dependencies = [
|
||||
"darling_core",
|
||||
"darling_macro",
|
||||
"darling_core 0.20.11",
|
||||
"darling_macro 0.20.11",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling"
|
||||
version = "0.23.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d"
|
||||
dependencies = [
|
||||
"darling_core 0.23.0",
|
||||
"darling_macro 0.23.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -366,13 +376,37 @@ dependencies = [
|
|||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling_core"
|
||||
version = "0.23.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0"
|
||||
dependencies = [
|
||||
"ident_case",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"strsim",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling_macro"
|
||||
version = "0.20.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead"
|
||||
dependencies = [
|
||||
"darling_core",
|
||||
"darling_core 0.20.11",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling_macro"
|
||||
version = "0.23.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d"
|
||||
dependencies = [
|
||||
"darling_core 0.23.0",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
|
@ -402,7 +436,7 @@ version = "0.20.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8"
|
||||
dependencies = [
|
||||
"darling",
|
||||
"darling 0.20.11",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
|
|
@ -652,9 +686,9 @@ checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5"
|
|||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "2.12.1"
|
||||
version = "2.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2"
|
||||
checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
|
||||
dependencies = [
|
||||
"equivalent",
|
||||
"hashbrown 0.16.1",
|
||||
|
|
@ -671,11 +705,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "instability"
|
||||
version = "0.3.10"
|
||||
version = "0.3.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6778b0196eefee7df739db78758e5cf9b37412268bfa5650bfeed028aed20d9c"
|
||||
checksum = "357b7205c6cd18dd2c86ed312d1e70add149aea98e7ef72b9fdf0270e555c11d"
|
||||
dependencies = [
|
||||
"darling",
|
||||
"darling 0.23.0",
|
||||
"indoc",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
@ -699,15 +733,15 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.15"
|
||||
version = "1.0.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
|
||||
checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
|
||||
|
||||
[[package]]
|
||||
name = "jiff"
|
||||
version = "0.2.16"
|
||||
version = "0.2.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "49cce2b81f2098e7e3efc35bc2e0a6b7abec9d34128283d7a26fa8f32a6dbb35"
|
||||
checksum = "e67e8da4c49d6d9909fe03361f9b620f58898859f5c7aded68351e85e71ecf50"
|
||||
dependencies = [
|
||||
"jiff-static",
|
||||
"log",
|
||||
|
|
@ -718,9 +752,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "jiff-static"
|
||||
version = "0.2.16"
|
||||
version = "0.2.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "980af8b43c3ad5d8d349ace167ec8170839f753a42d233ba19e08afe1850fa69"
|
||||
checksum = "e0c84ee7f197eca9a86c6fd6cb771e55eb991632f15f2bc3ca6ec838929e6e78"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
@ -735,9 +769,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
|||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.178"
|
||||
version = "0.2.180"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091"
|
||||
checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
|
||||
|
||||
[[package]]
|
||||
name = "linux-raw-sys"
|
||||
|
|
@ -830,6 +864,12 @@ dependencies = [
|
|||
"minimal-lexical",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "numtoa"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6aa2c4e539b869820a2b82e1aef6ff40aa85e65decdd5185e83fb4b1249cd00f"
|
||||
|
||||
[[package]]
|
||||
name = "object"
|
||||
version = "0.37.3"
|
||||
|
|
@ -900,9 +940,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
|||
|
||||
[[package]]
|
||||
name = "portable-atomic"
|
||||
version = "1.11.1"
|
||||
version = "1.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
|
||||
checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950"
|
||||
|
||||
[[package]]
|
||||
name = "portable-atomic-util"
|
||||
|
|
@ -924,9 +964,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.103"
|
||||
version = "1.0.105"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8"
|
||||
checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
|
@ -944,9 +984,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.42"
|
||||
version = "1.0.43"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f"
|
||||
checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
|
@ -979,9 +1019,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "rand_core"
|
||||
version = "0.9.3"
|
||||
version = "0.9.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
|
||||
checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
]
|
||||
|
|
@ -1092,9 +1132,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "rustix"
|
||||
version = "1.1.2"
|
||||
version = "1.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e"
|
||||
checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"errno",
|
||||
|
|
@ -1111,9 +1151,9 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
|
|||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.20"
|
||||
version = "1.0.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
|
||||
checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984"
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
|
|
@ -1197,10 +1237,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "signal-hook-registry"
|
||||
version = "1.4.7"
|
||||
version = "1.4.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad"
|
||||
checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
|
||||
dependencies = [
|
||||
"errno",
|
||||
"libc",
|
||||
]
|
||||
|
||||
|
|
@ -1235,6 +1276,7 @@ dependencies = [
|
|||
"shell-quote",
|
||||
"shlex",
|
||||
"tempfile",
|
||||
"termion",
|
||||
"thiserror 2.0.17",
|
||||
"thread_local",
|
||||
"tokio",
|
||||
|
|
@ -1292,9 +1334,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.111"
|
||||
version = "2.0.114"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87"
|
||||
checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
@ -1303,17 +1345,27 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tempfile"
|
||||
version = "3.23.0"
|
||||
version = "3.24.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16"
|
||||
checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"getrandom",
|
||||
"once_cell",
|
||||
"rustix 1.1.2",
|
||||
"rustix 1.1.3",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "termion"
|
||||
version = "4.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f44138a9ae08f0f502f24104d82517ef4da7330c35acd638f1f29d3cd5475ecb"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"numtoa",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.69"
|
||||
|
|
@ -1365,9 +1417,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tokio"
|
||||
version = "1.48.0"
|
||||
version = "1.49.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408"
|
||||
checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86"
|
||||
dependencies = [
|
||||
"pin-project-lite",
|
||||
"tokio-macros",
|
||||
|
|
@ -1386,9 +1438,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tokio-util"
|
||||
version = "0.7.17"
|
||||
version = "0.7.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594"
|
||||
checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-core",
|
||||
|
|
@ -1399,9 +1451,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tracing"
|
||||
version = "0.1.43"
|
||||
version = "0.1.44"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647"
|
||||
checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
|
||||
dependencies = [
|
||||
"pin-project-lite",
|
||||
"tracing-core",
|
||||
|
|
@ -1409,9 +1461,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tracing-core"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c"
|
||||
checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"valuable",
|
||||
|
|
@ -1440,9 +1492,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "unicase"
|
||||
version = "2.8.1"
|
||||
version = "2.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539"
|
||||
checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
|
|
@ -1523,7 +1575,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "d3fabb953106c3c8eea8306e4393700d7657561cb43122571b172bbfb7c7ba1d"
|
||||
dependencies = [
|
||||
"env_home",
|
||||
"rustix 1.1.2",
|
||||
"rustix 1.1.3",
|
||||
"winsafe",
|
||||
]
|
||||
|
||||
|
|
@ -1651,18 +1703,18 @@ checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
|
|||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.8.31"
|
||||
version = "0.8.33"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3"
|
||||
checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd"
|
||||
dependencies = [
|
||||
"zerocopy-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy-derive"
|
||||
version = "0.8.31"
|
||||
version = "0.8.33"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a"
|
||||
checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
|
|
|||
|
|
@ -55,8 +55,9 @@ futures = "0.3.31"
|
|||
tokio-util = "0.7.17"
|
||||
thiserror = "2.0.17"
|
||||
tempfile = "3.20.0"
|
||||
crossterm = { version = "0.28.1", features = ["event-stream", "use-dev-tty", "libc"] } # TODO remove libc feature after ratatui upgrades to crossterm 0.29+
|
||||
crossterm = { version = "0.28.1", features = ["event-stream", "use-dev-tty", "libc"] }
|
||||
thread_local = "1.1.9"
|
||||
termion = "4.0.6"
|
||||
|
||||
[features]
|
||||
default = ["cli"]
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ clangd\:"Clangd fuzzy matching algorithm"))' \
|
|||
'--case=[Case sensitivity]:CASE:((respect\:"Case-sensitive matching"
|
||||
ignore\:"Case-insensitive matching"
|
||||
smart\:"Smart case\: case-insensitive unless query contains uppercase"))' \
|
||||
'*-b+[Comma separated list of bindings]' \
|
||||
'*--bind=[Comma separated list of bindings]' \
|
||||
'*-b+[Comma separated list of bindings]::BIND:_default' \
|
||||
'*--bind=[Comma separated list of bindings]::BIND:_default' \
|
||||
'-c+[Command to invoke dynamically in interactive mode]:CMD:_default' \
|
||||
'--cmd=[Command to invoke dynamically in interactive mode]:CMD:_default' \
|
||||
'-I+[Replace replstr with the selected item in commands]:REPLSTR:_default' \
|
||||
|
|
@ -65,7 +65,7 @@ reverse-list\:"Display from the top of the screen, prompt at the bottom"))' \
|
|||
'-f+[Query for filter mode]:FILTER:_default' \
|
||||
'--filter=[Query for filter mode]:FILTER:_default' \
|
||||
'--shell=[Generate shell completion script]:SHELL:(bash elvish fish powershell zsh)' \
|
||||
'--tmux=[Run in a tmux popup]' \
|
||||
'--tmux=[Run in a tmux popup]::TMUX:_default' \
|
||||
'--log-file=[Pipe log output to a file]:LOG_FILE:_default' \
|
||||
'--hscroll-off=[Reserved for later use]:HSCROLL_OFF:_default' \
|
||||
'--jump-labels=[Reserved for later use]:JUMP_LABELS:_default' \
|
||||
|
|
|
|||
|
|
@ -1,13 +1,17 @@
|
|||
use std::io::IsTerminal;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::sync::Once;
|
||||
|
||||
use color_eyre::eyre::{Context, Result};
|
||||
use crossterm::cursor;
|
||||
use crossterm::event::{DisableMouseCapture, EnableMouseCapture, KeyEventKind};
|
||||
use color_eyre::eyre::Result;
|
||||
use crossterm::event::KeyEventKind;
|
||||
use crossterm::event::{DisableMouseCapture, EnableMouseCapture};
|
||||
use crossterm::terminal::{EnterAlternateScreen, LeaveAlternateScreen};
|
||||
use crossterm::{self, cursor};
|
||||
use futures::{FutureExt as _, StreamExt as _};
|
||||
use ratatui::prelude::Backend;
|
||||
use ratatui::{TerminalOptions, Viewport};
|
||||
use termion::cursor::DetectCursorPos;
|
||||
use termion::raw::IntoRawMode as _;
|
||||
use tokio::sync::mpsc::unbounded_channel;
|
||||
use tokio::{
|
||||
sync::mpsc::{UnboundedReceiver, UnboundedSender},
|
||||
|
|
@ -45,12 +49,42 @@ impl<B: Backend> Tui<B> {
|
|||
/// Creates a new TUI with the specified backend and height
|
||||
pub fn new_with_height(backend: B, height: Size) -> Result<Self> {
|
||||
let event_channel = unbounded_channel();
|
||||
|
||||
// Until https://github.com/crossterm-rs/crossterm/issues/919 is fixed, we need to do it ourselves
|
||||
let cursor_pos = if std::io::stdout().is_terminal() {
|
||||
let mut stdout = std::io::stdout().into_raw_mode()?;
|
||||
let res = stdout.cursor_pos()?;
|
||||
drop(stdout);
|
||||
res
|
||||
} else {
|
||||
let mut tty = termion::get_tty()?.into_raw_mode()?;
|
||||
let res = tty.cursor_pos()?;
|
||||
drop(tty);
|
||||
res
|
||||
};
|
||||
|
||||
let (is_fullscreen, viewport) = match height {
|
||||
Size::Percent(100) => (true, Viewport::Fullscreen),
|
||||
Size::Fixed(lines) => (false, Viewport::Inline(lines)),
|
||||
Size::Fixed(lines) => (
|
||||
false,
|
||||
Viewport::Fixed(ratatui::prelude::Rect::new(
|
||||
1,
|
||||
cursor_pos.1,
|
||||
backend.size().expect("Failed to get terminal width").width,
|
||||
lines,
|
||||
)),
|
||||
),
|
||||
Size::Percent(p) => {
|
||||
let term_height = backend.size().context("Failed to get terminal size")?.height;
|
||||
(false, Viewport::Inline(term_height * p / 100))
|
||||
let term_height = backend.size().expect("Failed to get terminal height").height;
|
||||
(
|
||||
false,
|
||||
Viewport::Fixed(ratatui::prelude::Rect::new(
|
||||
1,
|
||||
cursor_pos.1,
|
||||
backend.size().expect("Failed to get terminal width").width,
|
||||
term_height * p / 100,
|
||||
)),
|
||||
)
|
||||
}
|
||||
};
|
||||
set_panic_hook();
|
||||
|
|
@ -177,6 +211,9 @@ impl<B: Backend> DerefMut for Tui<B> {
|
|||
|
||||
impl<B: Backend> Drop for Tui<B> {
|
||||
fn drop(&mut self) {
|
||||
if let Some(t) = self.task.take() {
|
||||
t.abort();
|
||||
}
|
||||
let _ = self.exit();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use tokio::task::JoinHandle;
|
|||
|
||||
use super::Direction;
|
||||
use super::Event;
|
||||
use super::backend::Tui;
|
||||
use super::Tui;
|
||||
|
||||
use crate::theme::ColorTheme;
|
||||
use crate::tui::widget::{SkimRender, SkimWidget};
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ mod common;
|
|||
use common::Keys::*;
|
||||
|
||||
sk_test!(test_ansi_flag_enabled, @cmd "echo -e 'plain\\n\\x1b[31mred\\x1b[0m\\n\\x1b[32mgreen\\x1b[0m'", &["--ansi"], {
|
||||
@capture[0] starts_with(">");
|
||||
@lines |l| (l.len() >= 3 && l.iter().any(|line| line.contains("plain")));
|
||||
|
||||
@keys Key('d');
|
||||
|
|
@ -15,6 +16,7 @@ sk_test!(test_ansi_flag_enabled, @cmd "echo -e 'plain\\n\\x1b[31mred\\x1b[0m\\n\
|
|||
});
|
||||
|
||||
sk_test!(test_ansi_flag_disabled, @cmd "echo -e 'plain\\n\\x1b[31mred\\x1b[0m\\n\\x1b[32mgreen\\x1b[0m'", &[], {
|
||||
@capture[0] starts_with(">");
|
||||
@capture[*] contains("plain");
|
||||
|
||||
@keys Str("red");
|
||||
|
|
@ -25,6 +27,7 @@ sk_test!(test_ansi_flag_disabled, @cmd "echo -e 'plain\\n\\x1b[31mred\\x1b[0m\\n
|
|||
});
|
||||
|
||||
sk_test!(test_ansi_matching_on_stripped_text, @cmd "echo -e '\\x1b[32mgreen\\x1b[0m text\\n\\x1b[31mred\\x1b[0m text\\nplain text'", &["--ansi"], {
|
||||
@capture[0] starts_with(">");
|
||||
@lines |l| (l.len() >= 3 && l.iter().any(|line| line.contains("plain")));
|
||||
@keys Str("text");
|
||||
// Tiebreak will reorder items
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@ sk_test!(issue_361_literal_space_invert, "foo bar\\nfoo bar", &["-q", "'!foo\\
|
|||
});
|
||||
|
||||
sk_test!(issue_547_null_match, "\\0Test Test Test", &[], {
|
||||
@keys Str("Test");
|
||||
@capture[0] starts_with(">");
|
||||
@keys Str("Test");
|
||||
@capture[0] starts_with("> Test");
|
||||
@capture[2] starts_with("> Test Test Test");
|
||||
|
||||
@capture_colored[2] starts_with("\u{1b}[1m\u{1b}[38;5;168m\u{1b}[48;5;236m>\u{1b}[0m \u{1b}[38;5;151m\u{1b}[48;5;236mTest");
|
||||
|
|
@ -33,6 +34,7 @@ sk_test!(issue_xxx_null_delimiter_with_nth, "a\\0b\\0c", &["--delimiter", "'\\x0
|
|||
@capture[2] starts_with("> b");
|
||||
});
|
||||
sk_test!(issue_xxx_null_delimiter_nth, "a\\0b\\0c", &["--delimiter", "'\\x00'", "--nth", "2"], {
|
||||
@capture[0] starts_with(">");
|
||||
@keys Key('c');
|
||||
@capture[0] starts_with("> c");
|
||||
@capture[1] contains("0/1");
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ sk_test!(opt_with_nth_range_desc, "f1,f2,f3,f4", &["--delimiter", ",", "--with-n
|
|||
});
|
||||
|
||||
sk_test!(opt_nth_1, "f1,f2,f3,f4", &["--delimiter", ",", "--nth", "1"], {
|
||||
@capture[0] starts_with(">");
|
||||
@keys Key('1');
|
||||
@capture[0] eq("> 1");
|
||||
@capture[1] contains("1/1");
|
||||
|
|
@ -113,6 +114,7 @@ sk_test!(opt_nth_1, "f1,f2,f3,f4", &["--delimiter", ",", "--nth", "1"], {
|
|||
@capture[1] contains("0/1");
|
||||
});
|
||||
sk_test!(opt_nth_2, "f1,f2,f3,f4", &["--delimiter", ",", "--nth", "2"], {
|
||||
@capture[0] starts_with(">");
|
||||
@keys Str("2");
|
||||
@capture[0] eq("> 2");
|
||||
@capture[1] contains("1/1");
|
||||
|
|
@ -127,6 +129,7 @@ sk_test!(opt_nth_2, "f1,f2,f3,f4", &["--delimiter", ",", "--nth", "2"], {
|
|||
});
|
||||
|
||||
sk_test!(opt_nth_4, "f1,f2,f3,f4", &["--delimiter", ",", "--nth", "4"], {
|
||||
@capture[0] starts_with(">");
|
||||
@keys Str("4");
|
||||
@capture[0] eq("> 4");
|
||||
@capture[1] contains("1/1");
|
||||
|
|
@ -141,6 +144,7 @@ sk_test!(opt_nth_4, "f1,f2,f3,f4", &["--delimiter", ",", "--nth", "4"], {
|
|||
});
|
||||
|
||||
sk_test!(opt_nth_oob, "f1,f2,f3,f4", &["--delimiter", ",", "--nth", "5"], {
|
||||
@capture[0] starts_with(">");
|
||||
@capture[1] contains("1/1");
|
||||
@capture[2] eq("> f1,f2,f3,f4");
|
||||
|
||||
|
|
@ -163,6 +167,7 @@ sk_test!(opt_nth_neg_1, "f1,f2,f3,f4", &["--delimiter", ",", "--nth=-1"], {
|
|||
});
|
||||
|
||||
sk_test!(opt_nth_neg_2, "f1,f2,f3,f4", &["--delimiter", ",", "--nth=-2"], {
|
||||
@capture[0] starts_with(">");
|
||||
@keys Str("3");
|
||||
@capture[0] eq("> 3");
|
||||
@capture[1] contains("1/1");
|
||||
|
|
@ -177,6 +182,7 @@ sk_test!(opt_nth_neg_2, "f1,f2,f3,f4", &["--delimiter", ",", "--nth=-2"], {
|
|||
});
|
||||
|
||||
sk_test!(opt_nth_neg_4, "f1,f2,f3,f4", &["--delimiter", ",", "--nth=-4"], {
|
||||
@capture[0] starts_with(">");
|
||||
@keys Str("1");
|
||||
@capture[0] eq("> 1");
|
||||
@capture[1] contains("1/1");
|
||||
|
|
@ -191,6 +197,7 @@ sk_test!(opt_nth_neg_4, "f1,f2,f3,f4", &["--delimiter", ",", "--nth=-4"], {
|
|||
});
|
||||
|
||||
sk_test!(opt_nth_neg_oob, "f1,f2,f3,f4", &["--delimiter", ",", "--nth=-5"], {
|
||||
@capture[0] starts_with(">");
|
||||
@capture[1] contains("1/1");
|
||||
@capture[2] eq("> f1,f2,f3,f4");
|
||||
|
||||
|
|
@ -199,6 +206,7 @@ sk_test!(opt_nth_neg_oob, "f1,f2,f3,f4", &["--delimiter", ",", "--nth=-5"], {
|
|||
@capture[1] contains("0/1");
|
||||
});
|
||||
sk_test!(opt_nth_range_to_end, "f1,f2,f3,f4", &["--delimiter", ",", "--nth", "2.."], {
|
||||
@capture[0] starts_with(">");
|
||||
@keys Str("3");
|
||||
@capture[0] eq("> 3");
|
||||
@capture[1] contains("1/1");
|
||||
|
|
@ -213,6 +221,7 @@ sk_test!(opt_nth_range_to_end, "f1,f2,f3,f4", &["--delimiter", ",", "--nth", "2.
|
|||
});
|
||||
|
||||
sk_test!(opt_nth_range_from_start, "f1,f2,f3,f4", &["--delimiter", ",", "--nth", "..3"], {
|
||||
@capture[0] starts_with(">");
|
||||
@keys Str("1");
|
||||
@capture[0] eq("> 1");
|
||||
@capture[1] contains("1/1");
|
||||
|
|
@ -227,6 +236,7 @@ sk_test!(opt_nth_range_from_start, "f1,f2,f3,f4", &["--delimiter", ",", "--nth",
|
|||
});
|
||||
|
||||
sk_test!(opt_nth_range_closed, "f1,f2,f3,f4", &["--delimiter", ",", "--nth", "2..3"], {
|
||||
@capture[0] starts_with(">");
|
||||
@keys Str("2");
|
||||
@capture[0] eq("> 2");
|
||||
@capture[1] contains("1/1");
|
||||
|
|
|
|||
Loading…
Reference in a new issue