on master help sign in
Do not show (running) when opening picker (#8148)
0cfd46cPascal Kuthe
Cargo.lock+11−38
@@ -17,17 +17,6 @@ version = "1.0.2"
17source = "registry+https://github.com/rust-lang/crates.io-index"
17source = "registry+https://github.com/rust-lang/crates.io-index"
18checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
18checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
19
19
20−[[package]]
21−name = "ahash"
22−version = "0.7.6"
23−source = "registry+https://github.com/rust-lang/crates.io-index"
24−checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
25−dependencies = [
26− "getrandom",
27− "once_cell",
28− "version_check",
29−]
30−
31[[package]]
20[[package]]
32name = "ahash"
21name = "ahash"
33version = "0.8.3"
22version = "0.8.3"
@@ -107,7 +96,7 @@ dependencies = [
107 "cc",
96 "cc",
108 "cfg-if",
97 "cfg-if",
109 "libc",
98 "libc",
110− "miniz_oxide 0.7.1",
99+ "miniz_oxide",
111 "object",
100 "object",
112 "rustc-demangle",
101 "rustc-demangle",
113]
102]
@@ -495,12 +484,12 @@ dependencies = [
495
484
496[[package]]
485[[package]]
497name = "flate2"
486name = "flate2"
498−version = "1.0.25"
487+version = "1.0.27"
499source = "registry+https://github.com/rust-lang/crates.io-index"
488source = "registry+https://github.com/rust-lang/crates.io-index"
500−checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841"
489+checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010"
501dependencies = [
490dependencies = [
502 "crc32fast",
491 "crc32fast",
503− "miniz_oxide 0.6.2",
492+ "miniz_oxide",
504]
493]
505
494
506[[package]]
495[[package]]
@@ -1237,9 +1226,6 @@ name = "hashbrown"
1237version = "0.12.3"
1226version = "0.12.3"
1238source = "registry+https://github.com/rust-lang/crates.io-index"
1227source = "registry+https://github.com/rust-lang/crates.io-index"
1239checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
1228checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
1240−dependencies = [
1241− "ahash 0.7.6",
1242−]
1243
1229
1244[[package]]
1230[[package]]
1245name = "hashbrown"
1231name = "hashbrown"
@@ -1247,7 +1233,7 @@ version = "0.14.0"
1247source = "registry+https://github.com/rust-lang/crates.io-index"
1233source = "registry+https://github.com/rust-lang/crates.io-index"
1248checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a"
1234checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a"
1249dependencies = [
1235dependencies = [
1250− "ahash 0.8.3",
1236+ "ahash",
1251 "allocator-api2",
1237 "allocator-api2",
1252]
1238]
1253
1239
@@ -1255,7 +1241,7 @@ dependencies = [
1255name = "helix-core"
1241name = "helix-core"
1256version = "0.6.0"
1242version = "0.6.0"
1257dependencies = [
1243dependencies = [
1258− "ahash 0.8.3",
1244+ "ahash",
1259 "arc-swap",
1245 "arc-swap",
1260 "bitflags 2.4.0",
1246 "bitflags 2.4.0",
1261 "chrono",
1247 "chrono",
@@ -1546,7 +1532,7 @@ version = "0.1.5"
1546source = "registry+https://github.com/rust-lang/crates.io-index"
1532source = "registry+https://github.com/rust-lang/crates.io-index"
1547checksum = "e98c1d0ad70fc91b8b9654b1f33db55e59579d3b3de2bffdced0fdb810570cb8"
1533checksum = "e98c1d0ad70fc91b8b9654b1f33db55e59579d3b3de2bffdced0fdb810570cb8"
1548dependencies = [
1534dependencies = [
1549− "ahash 0.8.3",
1535+ "ahash",
1550 "hashbrown 0.12.3",
1536 "hashbrown 0.12.3",
1551]
1537]
1552
1538
@@ -1722,15 +1708,6 @@ version = "0.2.1"
1722source = "registry+https://github.com/rust-lang/crates.io-index"
1708source = "registry+https://github.com/rust-lang/crates.io-index"
1723checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
1709checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
1724
1710
1725−[[package]]
1726−name = "miniz_oxide"
1727−version = "0.6.2"
1728−source = "registry+https://github.com/rust-lang/crates.io-index"
1729−checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa"
1730−dependencies = [
1731− "adler",
1732−]
1733−
1734[[package]]
1711[[package]]
1735name = "miniz_oxide"
1712name = "miniz_oxide"
1736version = "0.7.1"
1713version = "0.7.1"
@@ -1764,9 +1741,9 @@ dependencies = [
1764
1741
1765[[package]]
1742[[package]]
1766name = "nucleo"
1743name = "nucleo"
1767−version = "0.2.0"
1744+version = "0.2.1"
1768source = "registry+https://github.com/rust-lang/crates.io-index"
1745source = "registry+https://github.com/rust-lang/crates.io-index"
1769−checksum = "0ccab936f2c8ad271bb31430944d98d358f74153566ea323265497f5639b11b6"
1746+checksum = "ae5331f4bcce475cf28cb29c95366c3091af4b0aa7703f1a6bc858f29718fdf3"
1770dependencies = [
1747dependencies = [
1771 "nucleo-matcher",
1748 "nucleo-matcher",
1772 "parking_lot",
1749 "parking_lot",
@@ -2509,13 +2486,9 @@ checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
2509
2486
2510[[package]]
2487[[package]]
2511name = "unicode-linebreak"
2488name = "unicode-linebreak"
2512−version = "0.1.4"
2489+version = "0.1.5"
2513source = "registry+https://github.com/rust-lang/crates.io-index"
2490source = "registry+https://github.com/rust-lang/crates.io-index"
2514−checksum = "c5faade31a542b8b35855fff6e8def199853b2da8da256da52f52f1316ee3137"
2491+checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f"
2515−dependencies = [
2516− "hashbrown 0.12.3",
2517− "regex",
2518−]
2519
2492
2520[[package]]
2493[[package]]
2521name = "unicode-normalization"
2494name = "unicode-normalization"
helix-term/src/ui/mod.rs+21−7
@@ -190,7 +190,7 @@ pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> Picker
190 .build()
190 .build()
191 .expect("failed to build excluded_types");
191 .expect("failed to build excluded_types");
192 walk_builder.types(excluded_types);
192 walk_builder.types(excluded_types);
193− let files = walk_builder.build().filter_map(|entry| {
193+ let mut files = walk_builder.build().filter_map(|entry| {
194 let entry = entry.ok()?;
194 let entry = entry.ok()?;
195 if !entry.file_type()?.is_file() {
195 if !entry.file_type()?.is_file() {
196 return None;
196 return None;
@@ -211,13 +211,27 @@ pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> Picker
211 })
211 })
212 .with_preview(|_editor, path| Some((path.clone().into(), None)));
212 .with_preview(|_editor, path| Some((path.clone().into(), None)));
213 let injector = picker.injector();
213 let injector = picker.injector();
214− std::thread::spawn(move || {
214+ let timeout = std::time::Instant::now() + std::time::Duration::from_millis(30);
215+
216+ let mut hit_timeout = false;
215− for file in files {
217+ for file in &mut files {
216− if injector.push(file).is_err() {
218+ if injector.push(file).is_err() {
217− break;
219+ break;
218− }
219 }
220 }
221+ if std::time::Instant::now() >= timeout {
222+ hit_timeout = true;
223+ break;
224+ }
225+ }
226+ if hit_timeout {
227+ std::thread::spawn(move || {
228+ for file in files {
229+ if injector.push(file).is_err() {
230+ break;
231+ }
232+ }
220− });
233+ });
234+ }
221 picker
235 picker
222}
236}
223
237