Merge branch 'master' of https://github.com/helix-editor/helix into tree_explore

pull/9/head
wongjiahau 1 year ago
commit 54b16936db

220
Cargo.lock generated

@ -51,9 +51,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.68"
version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61"
checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800"
[[package]]
name = "arc-swap"
@ -73,15 +73,6 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bstr"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
dependencies = [
"memchr",
]
[[package]]
name = "bstr"
version = "1.3.0"
@ -143,9 +134,9 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53"
[[package]]
name = "cc"
version = "1.0.78"
version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d"
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
[[package]]
name = "cfg-if"
@ -166,9 +157,9 @@ dependencies = [
[[package]]
name = "chrono"
version = "0.4.23"
version = "0.4.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f"
checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b"
dependencies = [
"iana-time-zone",
"num-integer",
@ -233,15 +224,6 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f"
dependencies = [
"cfg-if",
]
[[package]]
name = "crossterm"
version = "0.26.1"
@ -396,9 +378,9 @@ checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797"
[[package]]
name = "encoding_rs"
version = "0.8.31"
version = "0.8.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b"
checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394"
dependencies = [
"cfg-if",
]
@ -567,9 +549,9 @@ dependencies = [
[[package]]
name = "gix"
version = "0.39.0"
version = "0.41.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dabfac58aecb4a38cdd2568de66eb1f0d968fd6726f5a80cb8bea7944ef10cc0"
checksum = "b1853c840375a04e02315cb225b6d802291abfabbf08e500727c98a8670f1bf1"
dependencies = [
"gix-actor",
"gix-attributes",
@ -613,7 +595,7 @@ version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc22b0cdc52237667c301dd7cdc6ead8f8f73c9f824e9942c8ebd6b764f6c0bf"
dependencies = [
"bstr 1.3.0",
"bstr",
"btoi",
"gix-date",
"itoa",
@ -627,7 +609,7 @@ version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2231a25934a240d0a4b6f4478401c73ee81d8be52de0293eedbc172334abf3e1"
dependencies = [
"bstr 1.3.0",
"bstr",
"gix-features",
"gix-glob",
"gix-path",
@ -660,16 +642,16 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2c6f75c1e0f924de39e750880a6e21307194bb1ab773efe3c7d2d787277f8ab"
dependencies = [
"bstr 1.3.0",
"bstr",
]
[[package]]
name = "gix-config"
version = "0.18.0"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52c62e26ce11f607712e4f49a0a192ed87675d30187fd61be070abbd607d12f1"
checksum = "6aa7d7dd60256b7a0c0506a1d708ec92767c2662ee57b3301b538eaa3e064f8a"
dependencies = [
"bstr 1.3.0",
"bstr",
"gix-config-value",
"gix-features",
"gix-glob",
@ -691,7 +673,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "693d4a4ba0531e46fe558459557a5b29fb86c3e4b2666c1c0861d93c7c678331"
dependencies = [
"bitflags",
"bstr 1.3.0",
"bstr",
"gix-path",
"libc",
"thiserror",
@ -699,11 +681,11 @@ dependencies = [
[[package]]
name = "gix-credentials"
version = "0.11.0"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5be32b5fe339a31b8e53fa854081dc914c45020dcb64637f3c21baf69c96fc1b"
checksum = "750b684197374518ea057e0a0594713e07683faa0a3f43c0f93d97f64130ad8d"
dependencies = [
"bstr 1.3.0",
"bstr",
"gix-command",
"gix-config-value",
"gix-path",
@ -719,7 +701,7 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b96271912ce39822501616f177dea7218784e6c63be90d5f36322ff3a722aae2"
dependencies = [
"bstr 1.3.0",
"bstr",
"itoa",
"thiserror",
"time",
@ -739,11 +721,11 @@ dependencies = [
[[package]]
name = "gix-discover"
version = "0.15.0"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91c204adba5ebd211c74735cbb65817d277e154486bac0dffa3701f163b80350"
checksum = "1b58931ab475a977deff03417e041a66e4bcb76c4e5797e7ec2fcb272ebce01c"
dependencies = [
"bstr 1.3.0",
"bstr",
"dunce",
"gix-hash",
"gix-path",
@ -776,7 +758,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93e43efd776bc543f46f0fd0ca3d920c37af71a764a16f2aebd89765e9ff2993"
dependencies = [
"bitflags",
"bstr 1.3.0",
"bstr",
]
[[package]]
@ -802,12 +784,12 @@ dependencies = [
[[package]]
name = "gix-index"
version = "0.14.0"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c12caf7886c7ba06f2b28835cdc2be1dca86bd047d00299d2d49e707ce1c2616"
checksum = "546ee7855d5d8731288f05a63c07ab41b59cb406660a825ed3fe89d7223823df"
dependencies = [
"bitflags",
"bstr 1.3.0",
"bstr",
"btoi",
"filetime",
"gix-bitmap",
@ -824,9 +806,9 @@ dependencies = [
[[package]]
name = "gix-lock"
version = "4.0.0"
version = "5.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66119ff8a4a395d0ea033fef718bc85f8b4f0855874f4ce1e005fc16cfe1f66e"
checksum = "41b80172055c5d8017a48ddac5cc7a95421c00211047db0165c97853c4f05194"
dependencies = [
"fastrand",
"gix-tempfile",
@ -839,7 +821,7 @@ version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b66aea5e52875cd4915f4957a6f4b75831a36981e2ec3f5fad9e370e444fe1a"
dependencies = [
"bstr 1.3.0",
"bstr",
"gix-actor",
"thiserror",
]
@ -850,7 +832,7 @@ version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8df068db9180ee935fbb70504848369e270bdcb576b05c0faa8b9fd3b86fc017"
dependencies = [
"bstr 1.3.0",
"bstr",
"btoi",
"gix-actor",
"gix-features",
@ -865,9 +847,9 @@ dependencies = [
[[package]]
name = "gix-odb"
version = "0.42.0"
version = "0.43.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9a5f9e1afbd509761977a2ea02869cedaaba500b4e783deb2e4de5179a55a80"
checksum = "aa63fce01e5bce663bb24ad01fa2b77266e91b1d1982aab3f67cb0aed8af8169"
dependencies = [
"arc-swap",
"gix-features",
@ -883,9 +865,9 @@ dependencies = [
[[package]]
name = "gix-pack"
version = "0.32.0"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e51db84e1459a8022e518d40a8778028d793dbb28e4d35c9a5eaf92658fb0775"
checksum = "66bc9d22f0d0620d013003ab05ead5c60124b6e1101bc245be9be4fd7e2330cb"
dependencies = [
"clru",
"gix-chunk",
@ -909,7 +891,7 @@ version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6c104a66dec149cb8f7aaafc6ab797654cf82d67f050fd0cb7e7294e328354b"
dependencies = [
"bstr 1.3.0",
"bstr",
"thiserror",
]
@ -932,16 +914,16 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a282f5a8d9ee0b09ec47390ac727350c48f2f5c76d803cd8da6b3e7ad56e0bcb"
dependencies = [
"bstr 1.3.0",
"bstr",
"btoi",
"thiserror",
]
[[package]]
name = "gix-ref"
version = "0.26.0"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90a0ed29e581f04b904ecd0c32b11f33b8209b5a0af9c43f415249a4f2fba632"
checksum = "3de7cd1050fa82be4240994defc1f1f2fd9def5d8815dcd005f5ddc5e3dc7511"
dependencies = [
"gix-actor",
"gix-features",
@ -962,7 +944,7 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aba332462bda2e8efeae4302b39a6ed01ad56ef772fd5b7ef197cf2798294d65"
dependencies = [
"bstr 1.3.0",
"bstr",
"gix-hash",
"gix-revision",
"gix-validate",
@ -976,7 +958,7 @@ version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed98e4a0254953c64bc913bd23146a1de662067d5cf974cbdde396958b39e5b0"
dependencies = [
"bstr 1.3.0",
"bstr",
"gix-date",
"gix-hash",
"gix-hashtable",
@ -999,9 +981,9 @@ dependencies = [
[[package]]
name = "gix-tempfile"
version = "4.1.0"
version = "5.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8e0227bd284cd16105e8479602bb8af6bddcb800427e881c1feee4806310a31"
checksum = "743bae41b5db7f085dc7acc54ed72c98853a6e5dabb355e95caa7b534f21b35c"
dependencies = [
"libc",
"once_cell",
@ -1025,11 +1007,11 @@ dependencies = [
[[package]]
name = "gix-url"
version = "0.15.0"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "044072b7ce8601b62dcec841b92129f5cc677072823324121b395d766ac5f528"
checksum = "b6a22b4b32ad14d68f7b7fb6458fa58d44b01797d94c1b8f4db2d9c7b3c366b5"
dependencies = [
"bstr 1.3.0",
"bstr",
"gix-features",
"gix-path",
"home",
@ -1043,17 +1025,17 @@ version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b69ddb780ea1465255e66818d75b7098371c58dbc9560da4488a44b9f5c7e443"
dependencies = [
"bstr 1.3.0",
"bstr",
"thiserror",
]
[[package]]
name = "gix-worktree"
version = "0.14.0"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7cb9af6e56152953d8fe113c4f9d7cf60cf7a982362711e9200a255579b49cb"
checksum = "992b8fdade33e079dc61c29f2388ab8e049965ebf7be40efa7f8b80e3c4543fe"
dependencies = [
"bstr 1.3.0",
"bstr",
"gix-attributes",
"gix-features",
"gix-glob",
@ -1067,12 +1049,12 @@ dependencies = [
[[package]]
name = "globset"
version = "0.4.9"
version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a"
checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc"
dependencies = [
"aho-corasick",
"bstr 0.2.17",
"bstr",
"fnv",
"log",
"regex",
@ -1094,7 +1076,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "997598b41d53a37a2e3fc5300d5c11d825368c054420a9c65125b8fe1078463f"
dependencies = [
"aho-corasick",
"bstr 1.3.0",
"bstr",
"grep-matcher",
"log",
"regex",
@ -1108,7 +1090,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5601c4b9f480f0c9ebb40b1f6cbf447b8a50c5369223937a6c5214368c58779f"
dependencies = [
"bstr 1.3.0",
"bstr",
"bytecount",
"encoding_rs",
"encoding_rs_io",
@ -1245,6 +1227,7 @@ dependencies = [
"helix-view",
"ignore",
"indoc",
"libc",
"log",
"once_cell",
"pretty_assertions",
@ -1382,11 +1365,10 @@ dependencies = [
[[package]]
name = "ignore"
version = "0.4.18"
version = "0.4.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d"
checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492"
dependencies = [
"crossbeam-utils",
"globset",
"lazy_static",
"log",
@ -1420,9 +1402,9 @@ dependencies = [
[[package]]
name = "indoc"
version = "2.0.0"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fe2b9d82064e8a0226fddb3547f37f28eaa46d0fc210e275d835f08cf3b76a7"
checksum = "9f2cb48b81b1dc9f39676bf99f5499babfec7cd8fe14307f7b3d747208fb5690"
[[package]]
name = "instant"
@ -1445,12 +1427,12 @@ dependencies = [
[[package]]
name = "io-lifetimes"
version = "1.0.6"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfa919a82ea574332e2de6e74b4c36e74d41982b335080fa59d4ef31be20fdf3"
checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e"
dependencies = [
"libc",
"windows-sys 0.45.0",
"windows-sys 0.42.0",
]
[[package]]
@ -1476,9 +1458,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
version = "0.2.139"
version = "0.2.140"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c"
[[package]]
name = "libloading"
@ -1601,15 +1583,6 @@ dependencies = [
"minimal-lexical",
]
[[package]]
name = "nom8"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8"
dependencies = [
"memchr",
]
[[package]]
name = "num-integer"
version = "0.1.45"
@ -1650,9 +1623,9 @@ dependencies = [
[[package]]
name = "once_cell"
version = "1.17.0"
version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
[[package]]
name = "output_vt100"
@ -1848,16 +1821,16 @@ dependencies = [
[[package]]
name = "rustix"
version = "0.36.9"
version = "0.36.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc"
checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03"
dependencies = [
"bitflags",
"errno",
"io-lifetimes",
"libc",
"linux-raw-sys",
"windows-sys 0.45.0",
"windows-sys 0.42.0",
]
[[package]]
@ -1889,24 +1862,24 @@ checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898"
[[package]]
name = "semver"
version = "1.0.16"
version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a"
checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed"
[[package]]
name = "serde"
version = "1.0.152"
version = "1.0.155"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
checksum = "71f2b4817415c6d4210bfe1c7bfcf4801b2d904cb4d0e1a8fdb651013c9e86b8"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.152"
version = "1.0.155"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e"
checksum = "d071a94a3fac4aff69d023a7f411e33f40f3483f8c5190b1953822b6b76d7630"
dependencies = [
"proc-macro2",
"quote",
@ -1915,9 +1888,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.91"
version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883"
checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea"
dependencies = [
"itoa",
"ryu",
@ -1965,9 +1938,9 @@ checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012"
[[package]]
name = "signal-hook"
version = "0.3.14"
version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d"
checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9"
dependencies = [
"libc",
"signal-hook-registry",
@ -2135,18 +2108,18 @@ dependencies = [
[[package]]
name = "thiserror"
version = "1.0.38"
version = "1.0.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0"
checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.38"
version = "1.0.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f"
checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e"
dependencies = [
"proc-macro2",
"quote",
@ -2259,9 +2232,9 @@ dependencies = [
[[package]]
name = "toml"
version = "0.7.1"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "772c1426ab886e7362aedf4abc9c0d1348a979517efedfc25862944d10137af0"
checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21"
dependencies = [
"serde",
"serde_spanned",
@ -2280,15 +2253,15 @@ dependencies = [
[[package]]
name = "toml_edit"
version = "0.19.1"
version = "0.19.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90a238ee2e6ede22fb95350acc78e21dc40da00bb66c0334bde83de4ed89424e"
checksum = "08de71aa0d6e348f070457f85af8bd566e2bc452156a423ddf22861b3a953fae"
dependencies = [
"indexmap",
"nom8",
"serde",
"serde_spanned",
"toml_datetime",
"winnow",
]
[[package]]
@ -2354,9 +2327,9 @@ dependencies = [
[[package]]
name = "unicode-segmentation"
version = "1.10.0"
version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a"
checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36"
[[package]]
name = "unicode-width"
@ -2597,6 +2570,15 @@ version = "0.42.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
[[package]]
name = "winnow"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee7b2c67f962bf5042bfd8b6a916178df33a26eec343ae064cb8e069f638fa6f"
dependencies = [
"memchr",
]
[[package]]
name = "xtask"
version = "0.6.0"

@ -53,6 +53,7 @@ signal to the Helix process on Unix operating systems, such as by using the comm
| `completion-replace` | Set to `true` to make completions always replace the entire word and not just the part before the cursor | `false` |
| `auto-info` | Whether to display info boxes | `true` |
| `true-color` | Set to `true` to override automatic detection of terminal truecolor support in the event of a false negative | `false` |
| `undercurl` | Set to `true` to override automatic detection of terminal undercurl support in the event of a false negative | `false` |
| `rulers` | List of column positions at which to display the rulers. Can be overridden by language specific `rulers` in `languages.toml` file | `[]` |
| `bufferline` | Renders a line at the top of the editor displaying open buffers. Can be `always`, `never` or `multiple` (only shown if more than one buffer is in use) | `never` |
| `color-modes` | Whether to color the mode indicator with different colors depending on the mode itself | `false` |

@ -1136,20 +1136,23 @@ impl Client {
Some(self.call::<lsp::request::CodeActionRequest>(params))
}
pub fn supports_rename(&self) -> bool {
let capabilities = self.capabilities.get().unwrap();
matches!(
capabilities.rename_provider,
Some(lsp::OneOf::Left(true) | lsp::OneOf::Right(_))
)
}
pub fn rename_symbol(
&self,
text_document: lsp::TextDocumentIdentifier,
position: lsp::Position,
new_name: String,
) -> Option<impl Future<Output = Result<lsp::WorkspaceEdit>>> {
let capabilities = self.capabilities.get().unwrap();
// Return early if the language server does not support renaming.
match capabilities.rename_provider {
Some(lsp::OneOf::Left(true)) | Some(lsp::OneOf::Right(_)) => (),
// None | Some(false)
_ => return None,
};
if !self.supports_rename() {
return None;
}
let params = lsp::RenameParams {
text_document_position: lsp::TextDocumentPositionParams {

@ -68,13 +68,14 @@ grep-searcher = "0.1.11"
[target.'cfg(not(windows))'.dependencies] # https://github.com/vorner/signal-hook/issues/100
signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] }
libc = "0.2.140"
[build-dependencies]
helix-loader = { version = "0.6", path = "../helix-loader" }
[dev-dependencies]
smallvec = "1.10"
indoc = "2.0.0"
indoc = "2.0.1"
tempfile = "3.4.0"
pretty_assertions = "1.3.0"
build-fs-tree = "0.4.1"

@ -40,10 +40,7 @@ use anyhow::{Context, Error};
use crossterm::{event::Event as CrosstermEvent, tty::IsTty};
#[cfg(not(windows))]
use {
signal_hook::{consts::signal, low_level},
signal_hook_tokio::Signals,
};
use {signal_hook::consts::signal, signal_hook_tokio::Signals};
#[cfg(windows)]
type Signals = futures_util::stream::Empty<()>;
@ -137,7 +134,7 @@ impl Application {
let syn_loader = std::sync::Arc::new(syntax::Loader::new(syn_loader_conf));
#[cfg(not(feature = "integration"))]
let backend = CrosstermBackend::new(stdout());
let backend = CrosstermBackend::new(stdout(), &config.editor);
#[cfg(feature = "integration")]
let backend = TestBackend::new(120, 150);
@ -447,7 +444,32 @@ impl Application {
match signal {
signal::SIGTSTP => {
self.restore_term().unwrap();
low_level::emulate_default_handler(signal::SIGTSTP).unwrap();
// SAFETY:
//
// - helix must have permissions to send signals to all processes in its signal
// group, either by already having the requisite permission, or by having the
// user's UID / EUID / SUID match that of the receiving process(es).
let res = unsafe {
// A pid of 0 sends the signal to the entire process group, allowing the user to
// regain control of their terminal if the editor was spawned under another process
// (e.g. when running `git commit`).
//
// We have to send SIGSTOP (not SIGTSTP) to the entire process group, because,
// as mentioned above, the terminal will get stuck if `helix` was spawned from
// an external process and that process waits for `helix` to complete. This may
// be an issue with signal-hook-tokio, but the author of signal-hook believes it
// could be a tokio issue instead:
// https://github.com/vorner/signal-hook/issues/132
libc::kill(0, signal::SIGSTOP)
};
if res != 0 {
let err = std::io::Error::last_os_error();
eprintln!("{}", err);
let res = err.raw_os_error().unwrap_or(1);
std::process::exit(res);
}
}
signal::SIGCONT => {
self.claim_term().await.unwrap();

@ -32,8 +32,7 @@ use crate::{
};
use std::{
borrow::Cow, cmp::Ordering, collections::BTreeMap, fmt::Write, future::Future, path::PathBuf,
sync::Arc,
cmp::Ordering, collections::BTreeMap, fmt::Write, future::Future, path::PathBuf, sync::Arc,
};
/// Gets the language server that is attached to a document, and
@ -138,15 +137,11 @@ impl ui::menu::Item for PickerDiagnostic {
// remove background as it is distracting in the picker list
style.bg = None;
let code: Cow<'_, str> = self
.diag
.code
.as_ref()
.map(|c| match c {
NumberOrString::Number(n) => n.to_string().into(),
NumberOrString::String(s) => s.as_str().into(),
})
.unwrap_or_default();
let code = match self.diag.code.as_ref() {
Some(NumberOrString::Number(n)) => format!(" ({n})"),
Some(NumberOrString::String(s)) => format!(" ({s})"),
None => String::new(),
};
let path = match format {
DiagnosticsFormat::HideSourcePath => String::new(),
@ -1316,6 +1311,12 @@ pub fn rename_symbol(cx: &mut Context) {
let language_server = language_server!(cx.editor, doc);
let offset_encoding = language_server.offset_encoding();
if !language_server.supports_rename() {
cx.editor
.set_error("Language server does not support symbol renaming");
return;
}
let pos = doc.position(view.id, offset_encoding);
match language_server.prepare_rename(doc.identifier(), pos) {

@ -5,7 +5,7 @@ use crate::job::Job;
use super::*;
use helix_core::encoding;
use helix_core::{encoding, shellwords::Shellwords};
use helix_view::document::DEFAULT_LANGUAGE_NAME;
use helix_view::editor::{Action, CloseError, ConfigEvent};
use serde_json::Value;
@ -18,7 +18,49 @@ pub struct TypableCommand {
pub doc: &'static str,
// params, flags, helper, completer
pub fun: fn(&mut compositor::Context, &[Cow<str>], PromptEvent) -> anyhow::Result<()>,
pub completer: Option<Completer>,
/// What completion methods, if any, does this command have?
pub signature: CommandSignature,
}
impl TypableCommand {
fn completer_for_argument_number(&self, n: usize) -> &Completer {
match self.signature.positional_args.get(n) {
Some(completer) => completer,
_ => &self.signature.var_args,
}
}
}
#[derive(Clone)]
pub struct CommandSignature {
// Arguments with specific completion methods based on their position.
positional_args: &'static [Completer],
// All remaining arguments will use this completion method, if set.
var_args: Completer,
}
impl CommandSignature {
const fn none() -> Self {
Self {
positional_args: &[],
var_args: completers::none,
}
}
const fn positional(completers: &'static [Completer]) -> Self {
Self {
positional_args: completers,
var_args: completers::none,
}
}
const fn all(completer: Completer) -> Self {
Self {
positional_args: &[],
var_args: completer,
}
}
}
fn quit(cx: &mut compositor::Context, args: &[Cow<str>], event: PromptEvent) -> anyhow::Result<()> {
@ -2113,112 +2155,114 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
aliases: &["q"],
doc: "Close the current view.",
fun: quit,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "quit!",
aliases: &["q!"],
doc: "Force close the current view, ignoring unsaved changes.",
fun: force_quit,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "open",
aliases: &["o"],
doc: "Open a file from disk into the current view.",
fun: open,
completer: Some(completers::filename),
signature: CommandSignature::all(completers::filename),
},
TypableCommand {
name: "buffer-close",
aliases: &["bc", "bclose"],
doc: "Close the current buffer.",
fun: buffer_close,
completer: Some(completers::buffer),
signature: CommandSignature::all(completers::buffer),
},
TypableCommand {
name: "buffer-close!",
aliases: &["bc!", "bclose!"],
doc: "Close the current buffer forcefully, ignoring unsaved changes.",
fun: force_buffer_close,
completer: Some(completers::buffer),
signature: CommandSignature::all(completers::buffer)
},
TypableCommand {
name: "buffer-close-others",
aliases: &["bco", "bcloseother"],
doc: "Close all buffers but the currently focused one.",
fun: buffer_close_others,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "buffer-close-others!",
aliases: &["bco!", "bcloseother!"],
doc: "Force close all buffers but the currently focused one.",
fun: force_buffer_close_others,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "buffer-close-all",
aliases: &["bca", "bcloseall"],
doc: "Close all buffers without quitting.",
fun: buffer_close_all,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "buffer-close-all!",
aliases: &["bca!", "bcloseall!"],
doc: "Force close all buffers ignoring unsaved changes without quitting.",
fun: force_buffer_close_all,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "buffer-next",
aliases: &["bn", "bnext"],
doc: "Goto next buffer.",
fun: buffer_next,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "buffer-previous",
aliases: &["bp", "bprev"],
doc: "Goto previous buffer.",
fun: buffer_previous,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "write",
aliases: &["w"],
doc: "Write changes to disk. Accepts an optional path (:write some/path.txt)",
fun: write,
completer: Some(completers::filename),
signature: CommandSignature::positional(&[completers::filename]),
},
TypableCommand {
name: "write!",
aliases: &["w!"],
doc: "Force write changes to disk creating necessary subdirectories. Accepts an optional path (:write some/path.txt)",
fun: force_write,
completer: Some(completers::filename),
signature: CommandSignature::positional(&[completers::filename]),
},
TypableCommand {
name: "new",
aliases: &["n"],
doc: "Create a new scratch buffer.",
fun: new_file,
completer: Some(completers::filename),
// TODO: This seems to complete with a filename, but doesn't use that filename to
// set the path of the newly created buffer.
signature: CommandSignature::positional(&[completers::filename]),
},
TypableCommand {
name: "format",
aliases: &["fmt"],
doc: "Format the file using the LSP formatter.",
fun: format,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "indent-style",
aliases: &[],
doc: "Set the indentation style for editing. ('t' for tabs or 1-8 for number of spaces.)",
fun: set_indent_style,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "line-ending",
@ -2228,427 +2272,428 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
#[cfg(feature = "unicode-lines")]
doc: "Set the document's default line ending. Options: crlf, lf, cr, ff, nel.",
fun: set_line_ending,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "earlier",
aliases: &["ear"],
doc: "Jump back to an earlier point in edit history. Accepts a number of steps or a time span.",
fun: earlier,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "later",
aliases: &["lat"],
doc: "Jump to a later point in edit history. Accepts a number of steps or a time span.",
fun: later,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "write-quit",
aliases: &["wq", "x"],
doc: "Write changes to disk and close the current view. Accepts an optional path (:wq some/path.txt)",
fun: write_quit,
completer: Some(completers::filename),
signature: CommandSignature::positional(&[completers::filename]),
},
TypableCommand {
name: "write-quit!",
aliases: &["wq!", "x!"],
doc: "Write changes to disk and close the current view forcefully. Accepts an optional path (:wq! some/path.txt)",
fun: force_write_quit,
completer: Some(completers::filename),
signature: CommandSignature::positional(&[completers::filename]),
},
TypableCommand {
name: "write-all",
aliases: &["wa"],
doc: "Write changes from all buffers to disk.",
fun: write_all,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "write-quit-all",
aliases: &["wqa", "xa"],
doc: "Write changes from all buffers to disk and close all views.",
fun: write_all_quit,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "write-quit-all!",
aliases: &["wqa!", "xa!"],
doc: "Write changes from all buffers to disk and close all views forcefully (ignoring unsaved changes).",
fun: force_write_all_quit,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "quit-all",
aliases: &["qa"],
doc: "Close all views.",
fun: quit_all,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "quit-all!",
aliases: &["qa!"],
doc: "Force close all views ignoring unsaved changes.",
fun: force_quit_all,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "cquit",
aliases: &["cq"],
doc: "Quit with exit code (default 1). Accepts an optional integer exit code (:cq 2).",
fun: cquit,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "cquit!",
aliases: &["cq!"],
doc: "Force quit with exit code (default 1) ignoring unsaved changes. Accepts an optional integer exit code (:cq! 2).",
fun: force_cquit,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "theme",
aliases: &[],
doc: "Change the editor theme (show current theme if no name specified).",
fun: theme,
completer: Some(completers::theme),
signature: CommandSignature::positional(&[completers::theme]),
},
TypableCommand {
name: "clipboard-yank",
aliases: &[],
doc: "Yank main selection into system clipboard.",
fun: yank_main_selection_to_clipboard,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "clipboard-yank-join",
aliases: &[],
doc: "Yank joined selections into system clipboard. A separator can be provided as first argument. Default value is newline.", // FIXME: current UI can't display long doc.
fun: yank_joined_to_clipboard,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "primary-clipboard-yank",
aliases: &[],
doc: "Yank main selection into system primary clipboard.",
fun: yank_main_selection_to_primary_clipboard,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "primary-clipboard-yank-join",
aliases: &[],
doc: "Yank joined selections into system primary clipboard. A separator can be provided as first argument. Default value is newline.", // FIXME: current UI can't display long doc.
fun: yank_joined_to_primary_clipboard,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "clipboard-paste-after",
aliases: &[],
doc: "Paste system clipboard after selections.",
fun: paste_clipboard_after,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "clipboard-paste-before",
aliases: &[],
doc: "Paste system clipboard before selections.",
fun: paste_clipboard_before,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "clipboard-paste-replace",
aliases: &[],
doc: "Replace selections with content of system clipboard.",
fun: replace_selections_with_clipboard,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "primary-clipboard-paste-after",
aliases: &[],
doc: "Paste primary clipboard after selections.",
fun: paste_primary_clipboard_after,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "primary-clipboard-paste-before",
aliases: &[],
doc: "Paste primary clipboard before selections.",
fun: paste_primary_clipboard_before,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "primary-clipboard-paste-replace",
aliases: &[],
doc: "Replace selections with content of system primary clipboard.",
fun: replace_selections_with_primary_clipboard,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "show-clipboard-provider",
aliases: &[],
doc: "Show clipboard provider name in status bar.",
fun: show_clipboard_provider,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "change-current-directory",
aliases: &["cd"],
doc: "Change the current working directory.",
fun: change_current_directory,
completer: Some(completers::directory),
signature: CommandSignature::positional(&[completers::directory]),
},
TypableCommand {
name: "show-directory",
aliases: &["pwd"],
doc: "Show the current working directory.",
fun: show_current_directory,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "encoding",
aliases: &[],
doc: "Set encoding. Based on `https://encoding.spec.whatwg.org`.",
fun: set_encoding,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "character-info",
aliases: &["char"],
doc: "Get info about the character under the primary cursor.",
fun: get_character_info,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "reload",
aliases: &[],
doc: "Discard changes and reload from the source file.",
fun: reload,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "reload-all",
aliases: &[],
doc: "Discard changes and reload all documents from the source files.",
fun: reload_all,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "update",
aliases: &[],
doc: "Write changes only if the file has been modified.",
fun: update,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "lsp-workspace-command",
aliases: &[],
doc: "Open workspace command picker",
fun: lsp_workspace_command,
completer: Some(completers::lsp_workspace_command),
signature: CommandSignature::positional(&[completers::lsp_workspace_command]),
},
TypableCommand {
name: "lsp-restart",
aliases: &[],
doc: "Restarts the Language Server that is in use by the current doc",
fun: lsp_restart,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "lsp-stop",
aliases: &[],
doc: "Stops the Language Server that is in use by the current doc",
fun: lsp_stop,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "tree-sitter-scopes",
aliases: &[],
doc: "Display tree sitter scopes, primarily for theming and development.",
fun: tree_sitter_scopes,
completer: None,
},
signature: CommandSignature::none(),
},
TypableCommand {
name: "debug-start",
aliases: &["dbg"],
doc: "Start a debug session from a given template with given parameters.",
fun: debug_start,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "debug-remote",
aliases: &["dbg-tcp"],
doc: "Connect to a debug adapter by TCP address and start a debugging session from a given template with given parameters.",
fun: debug_remote,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "debug-eval",
aliases: &[],
doc: "Evaluate expression in current debug context.",
fun: debug_eval,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "vsplit",
aliases: &["vs"],
doc: "Open the file in a vertical split.",
fun: vsplit,
completer: Some(completers::filename),
signature: CommandSignature::all(completers::filename)
},
TypableCommand {
name: "vsplit-new",
aliases: &["vnew"],
doc: "Open a scratch buffer in a vertical split.",
fun: vsplit_new,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "hsplit",
aliases: &["hs", "sp"],
doc: "Open the file in a horizontal split.",
fun: hsplit,
completer: Some(completers::filename),
signature: CommandSignature::all(completers::filename)
},
TypableCommand {
name: "hsplit-new",
aliases: &["hnew"],
doc: "Open a scratch buffer in a horizontal split.",
fun: hsplit_new,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "tutor",
aliases: &[],
doc: "Open the tutorial.",
fun: tutor,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "goto",
aliases: &["g"],
doc: "Goto line number.",
fun: goto_line_number,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "set-language",
aliases: &["lang"],
doc: "Set the language of current buffer (show current language if no value specified).",
fun: language,
completer: Some(completers::language),
signature: CommandSignature::positional(&[completers::language]),
},
TypableCommand {
name: "set-option",
aliases: &["set"],
doc: "Set a config option at runtime.\nFor example to disable smart case search, use `:set search.smart-case false`.",
fun: set_option,
completer: Some(completers::setting),
// TODO: Add support for completion of the options value(s), when appropriate.
signature: CommandSignature::positional(&[completers::setting]),
},
TypableCommand {
name: "toggle-option",
aliases: &["toggle"],
doc: "Toggle a boolean config option at runtime.\nFor example to toggle smart case search, use `:toggle search.smart-case`.",
fun: toggle_option,
completer: Some(completers::setting),
signature: CommandSignature::positional(&[completers::setting]),
},
TypableCommand {
name: "get-option",
aliases: &["get"],
doc: "Get the current value of a config option.",
fun: get_option,
completer: Some(completers::setting),
signature: CommandSignature::positional(&[completers::setting]),
},
TypableCommand {
name: "sort",
aliases: &[],
doc: "Sort ranges in selection.",
fun: sort,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "rsort",
aliases: &[],
doc: "Sort ranges in selection in reverse order.",
fun: sort_reverse,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "reflow",
aliases: &[],
doc: "Hard-wrap the current selection of lines to a given width.",
fun: reflow,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "tree-sitter-subtree",
aliases: &["ts-subtree"],
doc: "Display tree sitter subtree under cursor, primarily for debugging queries.",
fun: tree_sitter_subtree,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "config-reload",
aliases: &[],
doc: "Refresh user config.",
fun: refresh_config,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "config-open",
aliases: &[],
doc: "Open the user config.toml file.",
fun: open_config,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "log-open",
aliases: &[],
doc: "Open the helix log file.",
fun: open_log,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "insert-output",
aliases: &[],
doc: "Run shell command, inserting output before each selection.",
fun: insert_output,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "append-output",
aliases: &[],
doc: "Run shell command, appending output after each selection.",
fun: append_output,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "pipe",
aliases: &[],
doc: "Pipe each selection to the shell command.",
fun: pipe,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "pipe-to",
aliases: &[],
doc: "Pipe each selection to the shell command, ignoring output.",
fun: pipe_to,
completer: None,
signature: CommandSignature::none(),
},
TypableCommand {
name: "run-shell-command",
aliases: &["sh"],
doc: "Run a shell command",
fun: run_shell_command,
completer: Some(completers::filename),
signature: CommandSignature::all(completers::filename)
},
TypableCommand {
name: "reset-diff-change",
aliases: &["diffget", "diffg"],
doc: "Reset the diff change at the cursor position.",
fun: reset_diff_change,
completer: None,
signature: CommandSignature::none(),
},
];
@ -2665,8 +2710,6 @@ pub static TYPABLE_COMMAND_MAP: Lazy<HashMap<&'static str, &'static TypableComma
#[allow(clippy::unnecessary_unwrap)]
pub(super) fn command_mode(cx: &mut Context) {
use shellwords::Shellwords;
let mut prompt = Prompt::new(
":".into(),
Some(':'),
@ -2705,10 +2748,11 @@ pub(super) fn command_mode(cx: &mut Context) {
)
};
if let Some(typed::TypableCommand {
completer: Some(completer),
..
}) = typed::TYPABLE_COMMAND_MAP.get(&words[0] as &str)
let argument_number = argument_number_of(&shellwords);
if let Some(completer) = TYPABLE_COMMAND_MAP
.get(&words[0] as &str)
.map(|tc| tc.completer_for_argument_number(argument_number))
{
completer(editor, part)
.into_iter()
@ -2773,3 +2817,29 @@ pub(super) fn command_mode(cx: &mut Context) {
prompt.recalculate_completion(cx.editor);
cx.push_layer(Box::new(prompt));
}
fn argument_number_of(shellwords: &Shellwords) -> usize {
if shellwords.ends_with_whitespace() {
shellwords.words().len().saturating_sub(1)
} else {
shellwords.words().len().saturating_sub(2)
}
}
#[test]
fn test_argument_number_of() {
let cases = vec![
("set-option", 0),
("set-option ", 0),
("set-option a", 0),
("set-option asdf", 0),
("set-option asdf ", 1),
("set-option asdf xyz", 1),
("set-option asdf xyz abc", 2),
("set-option asdf xyz abc ", 3),
];
for case in cases {
assert_eq!(case.1, argument_number_of(&Shellwords::from(case.0)));
}
}

@ -14,7 +14,10 @@ use crossterm::{
terminal::{self, Clear, ClearType},
Command,
};
use helix_view::graphics::{Color, CursorKind, Modifier, Rect, UnderlineStyle};
use helix_view::{
editor::Config as EditorConfig,
graphics::{Color, CursorKind, Modifier, Rect, UnderlineStyle},
};
use once_cell::sync::OnceCell;
use std::{
fmt,
@ -39,14 +42,15 @@ impl Capabilities {
/// Detect capabilities from the terminfo database located based
/// on the $TERM environment variable. If detection fails, returns
/// a default value where no capability is supported.
pub fn from_env_or_default() -> Self {
pub fn from_env_or_default(config: &EditorConfig) -> Self {
match termini::TermInfo::from_env() {
Err(_) => Capabilities::default(),
Ok(t) => Capabilities {
// Smulx, VTE: https://unix.stackexchange.com/a/696253/246284
// Su (used by kitty): https://sw.kovidgoyal.net/kitty/underlines
// WezTerm supports underlines but a lot of distros don't properly install it's terminfo
has_extended_underlines: t.extended_cap("Smulx").is_some()
has_extended_underlines: config.undercurl
|| t.extended_cap("Smulx").is_some()
|| t.extended_cap("Su").is_some()
|| vte_version() >= Some(5102)
|| matches!(term_program().as_deref(), Some("WezTerm")),
@ -65,10 +69,10 @@ impl<W> CrosstermBackend<W>
where
W: Write,
{
pub fn new(buffer: W) -> CrosstermBackend<W> {
pub fn new(buffer: W, config: &EditorConfig) -> CrosstermBackend<W> {
CrosstermBackend {
buffer,
capabilities: Capabilities::from_env_or_default(),
capabilities: Capabilities::from_env_or_default(config),
supports_keyboard_enhancement_protocol: OnceCell::new(),
}
}

@ -25,10 +25,12 @@
//! use std::io;
//! use helix_tui::Terminal;
//! use helix_tui::backend::CrosstermBackend;
//! use helix_view::editor::Config;
//!
//! fn main() -> Result<(), io::Error> {
//! let stdout = io::stdout();
//! let backend = CrosstermBackend::new(stdout);
//! let config = Config::default();
//! let backend = CrosstermBackend::new(stdout, &config);
//! let mut terminal = Terminal::new(backend)?;
//! Ok(())
//! }
@ -56,11 +58,13 @@
//! use helix_tui::backend::CrosstermBackend;
//! use helix_tui::widgets::{Widget, Block, Borders};
//! use helix_tui::layout::{Layout, Constraint, Direction};
//! use helix_view::editor::Config;
//!
//! fn main() -> Result<(), io::Error> {
//! terminal::enable_raw_mode().unwrap();
//! let stdout = io::stdout();
//! let backend = CrosstermBackend::new(stdout);
//! let config = Config::default();
//! let backend = CrosstermBackend::new(stdout, &config);
//! let mut terminal = Terminal::new(backend)?;
//! // terminal.draw(|f| {
//! // let size = f.size();
@ -86,11 +90,13 @@
//! use helix_tui::backend::CrosstermBackend;
//! use helix_tui::widgets::{Widget, Block, Borders};
//! use helix_tui::layout::{Layout, Constraint, Direction};
//! use helix_view::editor::Config;
//!
//! fn main() -> Result<(), io::Error> {
//! terminal::enable_raw_mode().unwrap();
//! let stdout = io::stdout();
//! let backend = CrosstermBackend::new(stdout);
//! let config = Config::default();
//! let backend = CrosstermBackend::new(stdout, &config);
//! let mut terminal = Terminal::new(backend)?;
//! // terminal.draw(|f| {
//! // let chunks = Layout::default()

@ -17,7 +17,7 @@ tokio = { version = "1", features = ["rt", "rt-multi-thread", "time", "sync", "p
parking_lot = "0.12"
arc-swap = { version = "1.6.0" }
gix = { version = "0.39.0", default-features = false , optional = true }
gix = { version = "0.41.0", default-features = false , optional = true }
imara-diff = "0.1.5"
log = "0.4"

@ -307,6 +307,8 @@ pub struct Config {
pub cursor_shape: CursorShapeConfig,
/// Set to `true` to override automatic detection of terminal truecolor support in the event of a false negative. Defaults to `false`.
pub true_color: bool,
/// Set to `true` to override automatic detection of terminal undercurl support in the event of a false negative. Defaults to `false`.
pub undercurl: bool,
/// Search configuration.
#[serde(default)]
pub search: SearchConfig,
@ -783,6 +785,7 @@ impl Default for Config {
statusline: StatusLineConfig::default(),
cursor_shape: CursorShapeConfig::default(),
true_color: false,
undercurl: false,
search: SearchConfig::default(),
lsp: LspConfig::default(),
terminal: get_terminal_provider(),

@ -591,7 +591,7 @@ indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "nix"
source = { git = "https://github.com/cstrahan/tree-sitter-nix", rev = "6b71a810c0acd49b980c50fc79092561f7cee307" }
source = { git = "https://github.com/nix-community/tree-sitter-nix", rev = "6b71a810c0acd49b980c50fc79092561f7cee307" }
[[language]]
name = "ruby"
@ -1317,6 +1317,7 @@ scope = "source.erlang"
injection-regex = "erl(ang)?"
file-types = ["erl", "hrl", "app", "rebar.config", "rebar.lock"]
roots = ["rebar.config"]
shebangs = ["escript"]
comment-token = "%%"
indent = { tab-width = 4, unit = " " }
language-server = { command = "erlang_ls" }

@ -65,6 +65,16 @@
(function_capture module: (atom) @namespace)
(function_capture function: (atom) @function)
; Macros
(macro
"?"+ @constant
name: (_) @constant
!arguments)
(macro
"?"+ @keyword.directive
name: (_) @keyword.directive)
; Ignored variables
((variable) @comment.discard
(#match? @comment.discard "^_"))
@ -125,16 +135,6 @@
(unary_operator operator: _ @operator)
["/" ":" "->"] @operator
; Macros
(macro
"?"+ @constant
name: (_) @constant
!arguments)
(macro
"?"+ @keyword.directive
name: (_) @keyword.directive)
; Comments
(tripledot) @comment.discard

@ -95,6 +95,8 @@
"."
","
"="
":"
(ellipses)
] @punctuation.delimiter
[

@ -164,6 +164,8 @@
"private"
"protected"
"public"
"clone"
"unset"
] @keyword
[

@ -60,6 +60,7 @@
"ui.menu.selected" = { fg = "bg2", bg = "blue1", modifiers = ["bold"] }
"ui.virtual.whitespace" = "bg2"
"ui.virtual.ruler" = { bg = "bg1" }
"ui.virtual.inlay-hint" = { fg = "gray1" }
"diagnostic.warning" = { underline = { color = "orange1", style = "curl" } }
"diagnostic.error" = { underline = { color = "red1", style = "curl" } }

@ -2,106 +2,14 @@
# Author : Jakub Bartodziej <kubabartodziej@gmail.com>
# The theme uses the gruvbox dark palette with hard contrast: github.com/morhetz/gruvbox
"attribute" = "aqua1"
"keyword" = { fg = "red1" }
"keyword.directive" = "red0"
"namespace" = "aqua1"
"punctuation" = "orange1"
"punctuation.delimiter" = "orange1"
"operator" = "purple1"
"special" = "purple0"
"variable.other.member" = "blue1"
"variable" = "fg1"
"variable.builtin" = "orange1"
"variable.parameter" = "fg2"
"type" = "yellow1"
"type.builtin" = "yellow1"
"constructor" = { fg = "purple1", modifiers = ["bold"] }
"function" = { fg = "green1", modifiers = ["bold"] }
"function.macro" = "aqua1"
"function.builtin" = "yellow1"
"tag" = "red1"
"comment" = { fg = "gray1", modifiers = ["italic"] }
"constant" = { fg = "purple1" }
"constant.builtin" = { fg = "purple1", modifiers = ["bold"] }
"string" = "green1"
"constant.numeric" = "purple1"
"constant.character.escape" = { fg = "fg2", modifiers = ["bold"] }
"label" = "aqua1"
"module" = "aqua1"
inherits = "gruvbox"
"diff.plus" = "green1"
"diff.delta" = "orange1"
"diff.minus" = "red1"
"warning" = "orange1"
"error" = "red1"
"info" = "aqua1"
"hint" = "blue1"
"diagnostic.error" = { underline = { style = "curl", color = "red0" } }
"diagnostic.warning" = { underline = { style = "curl", color = "orange1" } }
"diagnostic.info" = { underline = { style = "curl", color = "aqua1" } }
"diagnostic.hint" = { underline = { style = "curl", color = "blue1" } }
"ui.background" = { bg = "bg0" }
"ui.linenr" = { fg = "bg4" }
"ui.linenr.selected" = { fg = "yellow1" }
"ui.cursorline" = { bg = "bg1" }
"ui.statusline" = { fg = "fg1", bg = "bg2" }
"ui.statusline.normal" = { fg = "fg1", bg = "bg2" }
"ui.statusline.insert" = { fg = "fg1", bg = "blue0" }
"ui.statusline.select" = { fg = "fg1", bg = "orange0" }
"ui.statusline.inactive" = { fg = "fg4", bg = "bg1" }
"ui.popup" = { bg = "bg1" }
"ui.window" = { bg = "bg1" }
"ui.help" = { bg = "bg1", fg = "fg1" }
"ui.text" = { fg = "fg1" }
"ui.text.focus" = { fg = "fg1" }
"ui.selection" = { bg = "bg3", modifiers = ["reversed"] }
"ui.selection.primary" = { bg = "bg4", modifiers = ["reversed"] }
"ui.cursor.primary" = { modifiers = ["reversed"] }
"ui.cursor.match" = { bg = "bg2" }
"ui.menu" = { fg = "fg1", bg = "bg2" }
"ui.menu.selected" = { fg = "bg2", bg = "blue1", modifiers = ["bold"] }
"ui.virtual.whitespace" = "bg2"
"ui.virtual.ruler" = { bg = "bg1" }
"markup.heading" = "aqua1"
"markup.bold" = { modifiers = ["bold"] }
"markup.italic" = { modifiers = ["italic"] }
"markup.strikethrough" = { modifiers = ["crossed_out"] }
"markup.link.url" = { fg = "green1", modifiers = ["underlined"] }
"markup.link.text" = "red1"
"markup.raw" = "red1"
"diagnostic.error" = { underline = { color = "red0", style = "curl"} }
[palette]
bg0 = "#1d2021" # main background
bg1 = "#3c3836"
bg2 = "#504945"
bg3 = "#665c54"
bg4 = "#7c6f64"
fg0 = "#fbf1c7"
fg1 = "#ebdbb2" # main foreground
fg2 = "#d5c4a1"
fg3 = "#bdae93"
fg4 = "#a89984" # gray0
gray0 = "#a89984"
gray1 = "#928374"
red0 = "#cc241d" # neutral
red1 = "#fb4934" # bright
green0 = "#98971a"
green1 = "#b8bb26"
yellow0 = "#d79921"
yellow1 = "#fabd2f"
blue0 = "#458588"
blue1 = "#83a598"
purple0 = "#b16286"
purple1 = "#d3869b"
aqua0 = "#689d6a"
aqua1 = "#8ec07c"
orange0 = "#d65d0e"
orange1 = "#fe8019"

@ -2,78 +2,12 @@
# Author : Jakub Bartodziej <kubabartodziej@gmail.com>
# The theme uses the gruvbox light palette with standard contrast: github.com/morhetz/gruvbox
"attribute" = "aqua1"
"keyword" = { fg = "red1" }
"keyword.directive" = "red0"
"namespace" = "aqua1"
"punctuation" = "orange1"
"punctuation.delimiter" = "orange1"
"operator" = "purple1"
"special" = "purple0"
"variable.other.member" = "blue1"
"variable" = "fg1"
"variable.builtin" = "orange1"
"variable.parameter" = "fg2"
"type" = "yellow1"
"type.builtin" = "yellow1"
"constructor" = { fg = "purple1", modifiers = ["bold"] }
"function" = { fg = "green1", modifiers = ["bold"] }
"function.macro" = "aqua1"
"function.builtin" = "yellow1"
"tag" = "red1"
"comment" = { fg = "gray1", modifiers = ["italic"] }
"constant" = { fg = "purple1" }
"constant.builtin" = { fg = "purple1", modifiers = ["bold"] }
"string" = "green1"
"constant.numeric" = "purple1"
"constant.character.escape" = { fg = "fg2", modifiers = ["bold"] }
"label" = "aqua1"
"module" = "aqua1"
inherits = "gruvbox"
"diff.plus" = "green1"
"diff.delta" = "orange1"
"diff.minus" = "red1"
"warning" = "orange1"
"error" = "red1"
"info" = "aqua1"
"hint" = "blue1"
"ui.background" = { bg = "bg0" }
"ui.linenr" = { fg = "bg4" }
"ui.linenr.selected" = { fg = "yellow1" }
"ui.cursorline" = { bg = "bg1" }
"ui.statusline" = { fg = "fg1", bg = "bg2" }
"ui.statusline.normal" = { fg = "fg1", bg = "bg2" }
"ui.statusline.insert" = { fg = "fg1", bg = "blue0" }
"ui.statusline.select" = { fg = "fg1", bg = "orange0" }
"ui.statusline.inactive" = { fg = "fg4", bg = "bg1" }
"ui.popup" = { bg = "bg1" }
"ui.window" = { bg = "bg1" }
"ui.help" = { bg = "bg1", fg = "fg1" }
"ui.text" = { fg = "fg1" }
"ui.text.focus" = { fg = "fg1" }
"ui.selection" = { bg = "bg3", modifiers = ["reversed"] }
"ui.selection.primary" = { bg = "bg4", modifiers = ["reversed"] }
"ui.cursor.primary" = { modifiers = ["reversed"] }
"ui.cursor.match" = { bg = "bg2" }
"ui.menu" = { fg = "fg1", bg = "bg2" }
"ui.menu.selected" = { fg = "bg2", bg = "blue1", modifiers = ["bold"] }
"ui.virtual.whitespace" = "bg2"
"ui.virtual.ruler" = { bg = "bg1" }
"diagnostic.warning" = { underline = { color = "orange1", style = "curl" } }
"diagnostic.error" = { underline = { color = "red1", style = "curl" } }
"diagnostic.info" = { underline = { color = "aqua1", style = "curl" } }
"diagnostic.hint" = { underline = { color = "blue1", style = "curl" } }
"markup.heading" = "aqua1"
"markup.bold" = { modifiers = ["bold"] }
"markup.italic" = { modifiers = ["italic"] }
"markup.strikethrough" = { modifiers = ["crossed_out"] }
"markup.link.url" = { fg = "green1", modifiers = ["underlined"] }
"markup.link.text" = "red1"
"markup.raw" = "red1"
[palette]
bg0 = "#fbf1c7" # main background
@ -89,19 +23,11 @@ fg3 = "#665c54"
fg4 = "#7c6f64" # gray0
gray0 = "#7c6f64"
gray1 = "#928374"
red0 = "#cc241d" # neutral
red1 = "#9d0006" # bright
green0 = "#98971a"
green1 = "#79740e"
yellow0 = "#d79921"
yellow1 = "#b57614"
blue0 = "#458588"
blue1 = "#076678"
purple0 = "#b16286"
purple1 = "#8f3f71"
aqua0 = "#689d6a"
aqua1 = "#427b58"
orange0 = "#d65d0e"
orange1 = "#af3a03"

@ -0,0 +1,48 @@
# Author : Maxwell Anderson <zaechus@pm.me>
inherits = "monokai"
"comment" = "comment"
"comment.block.documentation" = { fg = "comment", modifiers = ["bold"] }
"constant.character.escape" = { fg = "light-blue", modifiers = ["italic"] }
"function.macro" = { fg = "#c4be89", modifiers = ["italic"] }
"keyword" = { fg = "keyword", modifiers = ["bold"] }
"keyword.control" = { fg = "keyword", modifiers = ["bold"] }
"keyword.control.exception" = { fg = "fn_declaration", modifiers = ["bold"] }
"keyword.directive" = { fg = "fn_declaration", modifiers = ["bold"] }
"keyword.storage.modifier" = { fg = "#fd971f", modifiers = ["italic"] }
"label" = "#e6db74"
"operator" = "keyword"
"punctuation.delimeter" = "#8f8f8f"
"type" = "light-blue"
"variable.builtin" = { fg = "#ae81ff", modifiers = ["bold"] }
"tag.builtin" = { fg = "#ae81ff", modifiers = ["bold"] }
"variable.parameter" = "variable"
"diff.plus" = "text"
"diff.delta" = "#89807d"
"diff.minus" = "#960050"
"ui.cursor.primary" = { fg = "#000000", bg = "#f8f8f0" }
"ui.cursor.match" = { fg = "#000000", bg = "#fd971f", modifiers = ["bold"] }
"ui.selection" = { bg = "#403d3d" }
"ui.linenr" = "#465457"
"ui.linenr.selected" = "#fd971f"
"ui.help" = { fg = "light-blue", bg = "#000000" }
"ui.menu" = { fg = "light-blue", bg = "#000000" }
"ui.popup" = { fg = "light-blue", bg = "#000000" }
"ui.popup.info" = { fg = "light-blue", bg = "#000000" }
"ui.text.info" = { fg = "light-blue", bg = "#000000" }
"warning" = { fg = "#ffffff", modifiers = ["bold"] }
"error" = { fg = "#ffffff", modifiers = ["bold"] }
"info" = { fg = "#ffffff", modifiers = ["bold"] }
"hint" = { fg = "#ffffff", modifiers = ["bold"] }
[palette]
light-blue = "#66d9ef"
background = "#1b1d1e"
comment = "#7e8e91"

@ -84,12 +84,12 @@
"warning" = { fg = "#cca700" }
"error" = { fg = "#f48771" }
"info" = { fg = "#75beff" }
"hint" = { fg = "#eeeeeb3" }
"hint" = { fg = "#eeeeb3" }
"diagnostic.warning" = { underline = { color = "#cca700", style = "curl" } }
"diagnostic.error" = { underline = { color = "#f48771", style = "curl" } }
"diagnostic.info" = { underline = { color = "#75beff", style = "curl" } }
"diagnostic.hint" = { underline = { color = "#eeeeeb3", style = "curl" } }
"diagnostic.hint" = { underline = { color = "#eeeeb3", style = "curl" } }
[palette]
type = "#A6E22E"

@ -39,6 +39,7 @@ error = { fg = 'brownD', bg = 'redE', modifiers = ['bold'] }
'ui.virtual.ruler' = { bg = 'brownR' }
'ui.virtual.whitespace' = { fg = 'brownV' }
'ui.virtual.indent-guide' = { fg = 'brownR' }
'ui.virtual.inlay-hint' = {fg = 'brownD', bg = 'brownU'}
'ui.menu' = { fg = 'greyT', bg = 'brownD' }
'ui.menu.selected' = { fg = 'orangeH', bg = 'brownH' }
'ui.popup' = { bg = 'brownD' }

Loading…
Cancel
Save