on master help sign in
argh -> clap to speed up compilation (no syn/proc_macro)
e39bd21Blaž Hrastnik
Cargo.lock+91−163
@@ -21,35 +21,6 @@ version = "0.4.7"
21source = "registry+https://github.com/rust-lang/crates.io-index"
21source = "registry+https://github.com/rust-lang/crates.io-index"
22checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034"
22checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034"
23
23
24−[[package]]
25−name = "argh"
26−version = "0.1.3"
27−source = "registry+https://github.com/rust-lang/crates.io-index"
28−checksum = "ca1877e24cecacd700d469066e0160c4f8497cc5635367163f50c8beec820154"
29−dependencies = [
30− "argh_derive",
31− "argh_shared",
32−]
33−
34−[[package]]
35−name = "argh_derive"
36−version = "0.1.1"
37−source = "registry+https://github.com/rust-lang/crates.io-index"
38−checksum = "e742194e0f43fc932bcb801708c2b279d3ec8f527e3acda05a6a9f342c5ef764"
39−dependencies = [
40− "argh_shared",
41− "heck",
42− "proc-macro2",
43− "quote",
44− "syn",
45−]
46−
47−[[package]]
48−name = "argh_shared"
49−version = "0.1.1"
50−source = "registry+https://github.com/rust-lang/crates.io-index"
51−checksum = "e1ba68f4276a778591e36a0c348a269888f3a177c8d2054969389e3b59611ff5"
52−
53[[package]]
24[[package]]
54name = "async-barrier"
25name = "async-barrier"
55version = "1.1.0"
26version = "1.1.0"
@@ -97,9 +68,9 @@ dependencies = [
97
68
98[[package]]
69[[package]]
99name = "async-io"
70name = "async-io"
100−version = "1.1.3"
71+version = "1.1.5"
101source = "registry+https://github.com/rust-lang/crates.io-index"
72source = "registry+https://github.com/rust-lang/crates.io-index"
102−checksum = "a9951f92a2b4f7793f8fc06a80bdb89b62c618c993497d4606474fb8c34941b5"
73+checksum = "6e727cebd055ab2861a854f79def078c4b99ea722d54c6800a0e274389882d4c"
103dependencies = [
74dependencies = [
104 "concurrent-queue",
75 "concurrent-queue",
105 "fastrand",
76 "fastrand",
@@ -136,9 +107,9 @@ dependencies = [
136
107
137[[package]]
108[[package]]
138name = "async-net"
109name = "async-net"
139−version = "1.4.3"
110+version = "1.4.6"
140source = "registry+https://github.com/rust-lang/crates.io-index"
111source = "registry+https://github.com/rust-lang/crates.io-index"
141−checksum = "fb04482b77baa38d59d56aee0a7b4266600ab28e2b8be7af03508f6a30ecbdcf"
112+checksum = "14a5335056541826f855bf95b936df9788adbacf94b15ef7104029f7fff3e82a"
142dependencies = [
113dependencies = [
143 "async-io",
114 "async-io",
144 "blocking",
115 "blocking",
@@ -193,6 +164,12 @@ version = "1.0.0"
193source = "registry+https://github.com/rust-lang/crates.io-index"
164source = "registry+https://github.com/rust-lang/crates.io-index"
194checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a"
165checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a"
195
166
167+[[package]]
168+name = "autocfg"
169+version = "1.0.1"
170+source = "registry+https://github.com/rust-lang/crates.io-index"
171+checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
172+
196[[package]]
173[[package]]
197name = "bitflags"
174name = "bitflags"
198version = "1.2.1"
175version = "1.2.1"
@@ -240,11 +217,25 @@ version = "0.1.10"
240source = "registry+https://github.com/rust-lang/crates.io-index"
217source = "registry+https://github.com/rust-lang/crates.io-index"
241checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
218checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
242
219
220+[[package]]
221+name = "clap"
222+version = "3.0.0-beta.2"
223+source = "registry+https://github.com/rust-lang/crates.io-index"
224+checksum = "4bd1061998a501ee7d4b6d449020df3266ca3124b941ec56cf2005c3779ca142"
225+dependencies = [
226+ "bitflags",
227+ "indexmap",
228+ "os_str_bytes",
229+ "textwrap",
230+ "unicode-width",
231+ "vec_map",
232+]
233+
243[[package]]
234[[package]]
244name = "cloudabi"
235name = "cloudabi"
245−version = "0.0.3"
236+version = "0.1.0"
246source = "registry+https://github.com/rust-lang/crates.io-index"
237source = "registry+https://github.com/rust-lang/crates.io-index"
247−checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
238+checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467"
248dependencies = [
239dependencies = [
249 "bitflags",
240 "bitflags",
250]
241]
@@ -260,13 +251,13 @@ dependencies = [
260
251
261[[package]]
252[[package]]
262name = "crossterm"
253name = "crossterm"
263−version = "0.17.7"
254+version = "0.18.0"
264source = "registry+https://github.com/rust-lang/crates.io-index"
255source = "registry+https://github.com/rust-lang/crates.io-index"
265−checksum = "6f4919d60f26ae233e14233cc39746c8c8bb8cd7b05840ace83604917b51b6c7"
256+checksum = "c2fcdc3c9cf8ee446222e8ee8691a6d21b563b8fe1a64b1873080db7b5b23cf0"
266dependencies = [
257dependencies = [
267 "bitflags",
258 "bitflags",
268 "crossterm_winapi",
259 "crossterm_winapi",
269− "futures-util",
260+ "futures-core",
270 "lazy_static",
261 "lazy_static",
271 "libc",
262 "libc",
272 "mio",
263 "mio",
@@ -284,26 +275,6 @@ dependencies = [
284 "winapi",
275 "winapi",
285]
276]
286
277
287−[[package]]
288−name = "enum-iterator"
289−version = "0.6.0"
290−source = "registry+https://github.com/rust-lang/crates.io-index"
291−checksum = "c79a6321a1197d7730510c7e3f6cb80432dfefecb32426de8cea0aa19b4bb8d7"
292−dependencies = [
293− "enum-iterator-derive",
294−]
295−
296−[[package]]
297−name = "enum-iterator-derive"
298−version = "0.6.0"
299−source = "registry+https://github.com/rust-lang/crates.io-index"
300−checksum = "1e94aa31f7c0dc764f57896dc615ddd76fc13b0d5dca7eb6cc5e018a5a09ec06"
301−dependencies = [
302− "proc-macro2",
303− "quote",
304− "syn",
305−]
306−
307[[package]]
278[[package]]
308name = "event-listener"
279name = "event-listener"
309version = "2.5.1"
280version = "2.5.1"
@@ -354,31 +325,10 @@ dependencies = [
354]
325]
355
326
356[[package]]
327[[package]]
357−name = "futures-task"
328+name = "hashbrown"
358−version = "0.3.5"
359−source = "registry+https://github.com/rust-lang/crates.io-index"
360−checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626"
361−
362−[[package]]
363−name = "futures-util"
364−version = "0.3.5"
329+version = "0.9.1"
365−source = "registry+https://github.com/rust-lang/crates.io-index"
366−checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6"
367−dependencies = [
368− "futures-core",
369− "futures-task",
370− "pin-project",
371− "pin-utils",
372−]
373−
374−[[package]]
375−name = "heck"
376−version = "0.3.1"
377source = "registry+https://github.com/rust-lang/crates.io-index"
330source = "registry+https://github.com/rust-lang/crates.io-index"
378−checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
331+checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
379−dependencies = [
380− "unicode-segmentation",
381−]
382
332
383[[package]]
333[[package]]
384name = "helix-core"
334name = "helix-core"
@@ -401,7 +351,6 @@ name = "helix-syntax"
401version = "0.1.0"
351version = "0.1.0"
402dependencies = [
352dependencies = [
403 "cc",
353 "cc",
404− "enum-iterator",
405 "tree-sitter",
354 "tree-sitter",
406]
355]
407
356
@@ -410,7 +359,7 @@ name = "helix-term"
410version = "0.1.0"
359version = "0.1.0"
411dependencies = [
360dependencies = [
412 "anyhow",
361 "anyhow",
413− "argh",
362+ "clap",
414 "crossterm",
363 "crossterm",
415 "helix-core",
364 "helix-core",
416 "helix-view",
365 "helix-view",
@@ -439,6 +388,25 @@ dependencies = [
439 "libc",
388 "libc",
440]
389]
441
390
391+[[package]]
392+name = "indexmap"
393+version = "1.6.0"
394+source = "registry+https://github.com/rust-lang/crates.io-index"
395+checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2"
396+dependencies = [
397+ "autocfg",
398+ "hashbrown",
399+]
400+
401+[[package]]
402+name = "instant"
403+version = "0.1.7"
404+source = "registry+https://github.com/rust-lang/crates.io-index"
405+checksum = "63312a18f7ea8760cdd0a7c5aac1a619752a246b833545e3e36d1f81f7cd9e66"
406+dependencies = [
407+ "cfg-if",
408+]
409+
442[[package]]
410[[package]]
443name = "jobserver"
411name = "jobserver"
444version = "0.1.21"
412version = "0.1.21"
@@ -462,9 +430,9 @@ checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235"
462
430
463[[package]]
431[[package]]
464name = "lock_api"
432name = "lock_api"
465−version = "0.3.4"
433+version = "0.4.1"
466source = "registry+https://github.com/rust-lang/crates.io-index"
434source = "registry+https://github.com/rust-lang/crates.io-index"
467−checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75"
435+checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c"
468dependencies = [
436dependencies = [
469 "scopeguard",
437 "scopeguard",
470]
438]
@@ -492,11 +460,10 @@ checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
492
460
493[[package]]
461[[package]]
494name = "mio"
462name = "mio"
495−version = "0.7.0"
463+version = "0.7.1"
496source = "registry+https://github.com/rust-lang/crates.io-index"
464source = "registry+https://github.com/rust-lang/crates.io-index"
497−checksum = "6e9971bc8349a361217a8f2a41f5d011274686bd4436465ba51730921039d7fb"
465+checksum = "d1bb17be6a300845baad6dc2062a31de575e9148696df52f040aea6398627350"
498dependencies = [
466dependencies = [
499− "lazy_static",
500 "libc",
467 "libc",
501 "log",
468 "log",
502 "miow",
469 "miow",
@@ -516,9 +483,9 @@ dependencies = [
516
483
517[[package]]
484[[package]]
518name = "nb-connect"
485name = "nb-connect"
519−version = "1.0.0"
486+version = "1.0.1"
520source = "registry+https://github.com/rust-lang/crates.io-index"
487source = "registry+https://github.com/rust-lang/crates.io-index"
521−checksum = "e847c76b390f44529c2071ef06d0b52fbb4bdb04cc8987a5cfa63954c000abca"
488+checksum = "701f47aeb98466d0a7fea67e2c2f667c33efa1f2e4fd7f76743aac1153196f72"
522dependencies = [
489dependencies = [
523 "libc",
490 "libc",
524 "winapi",
491 "winapi",
@@ -555,6 +522,12 @@ version = "1.4.1"
555source = "registry+https://github.com/rust-lang/crates.io-index"
522source = "registry+https://github.com/rust-lang/crates.io-index"
556checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad"
523checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad"
557
524
525+[[package]]
526+name = "os_str_bytes"
527+version = "2.3.2"
528+source = "registry+https://github.com/rust-lang/crates.io-index"
529+checksum = "2ac6fe3538f701e339953a3ebbe4f39941aababa8a3f6964635b24ab526daeac"
530+
558[[package]]
531[[package]]
559name = "parking"
532name = "parking"
560version = "2.0.0"
533version = "2.0.0"
@@ -563,59 +536,35 @@ checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72"
563
536
564[[package]]
537[[package]]
565name = "parking_lot"
538name = "parking_lot"
566−version = "0.10.2"
539+version = "0.11.0"
567source = "registry+https://github.com/rust-lang/crates.io-index"
540source = "registry+https://github.com/rust-lang/crates.io-index"
568−checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e"
541+checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733"
569dependencies = [
542dependencies = [
543+ "instant",
570 "lock_api",
544 "lock_api",
571 "parking_lot_core",
545 "parking_lot_core",
572]
546]
573
547
574[[package]]
548[[package]]
575name = "parking_lot_core"
549name = "parking_lot_core"
576−version = "0.7.2"
550+version = "0.8.0"
577source = "registry+https://github.com/rust-lang/crates.io-index"
551source = "registry+https://github.com/rust-lang/crates.io-index"
578−checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3"
552+checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
579dependencies = [
553dependencies = [
580 "cfg-if",
554 "cfg-if",
581 "cloudabi",
555 "cloudabi",
556+ "instant",
582 "libc",
557 "libc",
583 "redox_syscall",
558 "redox_syscall",
584 "smallvec",
559 "smallvec",
585 "winapi",
560 "winapi",
586]
561]
587
562
588−[[package]]
589−name = "pin-project"
590−version = "0.4.23"
591−source = "registry+https://github.com/rust-lang/crates.io-index"
592−checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa"
593−dependencies = [
594− "pin-project-internal",
595−]
596−
597−[[package]]
598−name = "pin-project-internal"
599−version = "0.4.23"
600−source = "registry+https://github.com/rust-lang/crates.io-index"
601−checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f"
602−dependencies = [
603− "proc-macro2",
604− "quote",
605− "syn",
606−]
607−
608[[package]]
563[[package]]
609name = "pin-project-lite"
564name = "pin-project-lite"
610−version = "0.1.7"
565+version = "0.1.9"
611source = "registry+https://github.com/rust-lang/crates.io-index"
566source = "registry+https://github.com/rust-lang/crates.io-index"
612−checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715"
567+checksum = "4fe74897791e156a0cd8cce0db31b9b2198e67877316bf3086c3acd187f719f0"
613−
614−[[package]]
615−name = "pin-utils"
616−version = "0.1.0"
617−source = "registry+https://github.com/rust-lang/crates.io-index"
618−checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
619
568
620[[package]]
569[[package]]
621name = "polling"
570name = "polling"
@@ -630,24 +579,6 @@ dependencies = [
630 "winapi",
579 "winapi",
631]
580]
632
581
633−[[package]]
634−name = "proc-macro2"
635−version = "1.0.21"
636−source = "registry+https://github.com/rust-lang/crates.io-index"
637−checksum = "36e28516df94f3dd551a587da5357459d9b36d945a7c37c3557928c1c2ff2a2c"
638−dependencies = [
639− "unicode-xid",
640−]
641−
642−[[package]]
643−name = "quote"
644−version = "1.0.7"
645−source = "registry+https://github.com/rust-lang/crates.io-index"
646−checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
647−dependencies = [
648− "proc-macro2",
649−]
650−
651[[package]]
582[[package]]
652name = "redox_syscall"
583name = "redox_syscall"
653version = "0.1.57"
584version = "0.1.57"
@@ -716,9 +647,9 @@ checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"
716
647
717[[package]]
648[[package]]
718name = "smol"
649name = "smol"
719−version = "1.2.1"
650+version = "1.2.2"
720source = "registry+https://github.com/rust-lang/crates.io-index"
651source = "registry+https://github.com/rust-lang/crates.io-index"
721−checksum = "d41237ba3e3ada55ff3515d37becc8fa90e5e4af2b13a011ec3f932d9f1b2405"
652+checksum = "7ca2722989073e89917a575862fb49dba3321af152f0cf4a4164d9482aabdf28"
722dependencies = [
653dependencies = [
723 "async-channel",
654 "async-channel",
724 "async-executor",
655 "async-executor",
@@ -744,17 +675,6 @@ dependencies = [
744 "winapi",
675 "winapi",
745]
676]
746
677
747−[[package]]
748−name = "syn"
749−version = "1.0.41"
750−source = "registry+https://github.com/rust-lang/crates.io-index"
751−checksum = "6690e3e9f692504b941dc6c3b188fd28df054f7fb8469ab40680df52fdcc842b"
752−dependencies = [
753− "proc-macro2",
754− "quote",
755− "unicode-xid",
756−]
757−
758[[package]]
678[[package]]
759name = "tendril"
679name = "tendril"
760version = "0.4.1"
680version = "0.4.1"
@@ -765,6 +685,15 @@ dependencies = [
765 "utf-8",
685 "utf-8",
766]
686]
767
687
688+[[package]]
689+name = "textwrap"
690+version = "0.12.1"
691+source = "registry+https://github.com/rust-lang/crates.io-index"
692+checksum = "203008d98caf094106cfaba70acfed15e18ed3ddb7d94e49baec153a2b462789"
693+dependencies = [
694+ "unicode-width",
695+]
696+
768[[package]]
697[[package]]
769name = "thread_local"
698name = "thread_local"
770version = "1.0.1"
699version = "1.0.1"
@@ -786,9 +715,8 @@ dependencies = [
786
715
787[[package]]
716[[package]]
788name = "tui"
717name = "tui"
789−version = "0.11.0"
718+version = "0.12.0"
790−source = "registry+https://github.com/rust-lang/crates.io-index"
719+source = "git+https://github.com/fdehau/tui-rs#25ff2e5e61f8902101e485743992db2412f77aad"
791−checksum = "36626dee5ede9fd34015e9fb4fd7eedf3f3d05bdf1436aaef15b7d0a24233778"
792dependencies = [
720dependencies = [
793 "bitflags",
721 "bitflags",
794 "cassowary",
722 "cassowary",
@@ -809,12 +737,6 @@ version = "0.1.8"
809source = "registry+https://github.com/rust-lang/crates.io-index"
737source = "registry+https://github.com/rust-lang/crates.io-index"
810checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
738checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
811
739
812−[[package]]
813−name = "unicode-xid"
814−version = "0.2.1"
815−source = "registry+https://github.com/rust-lang/crates.io-index"
816−checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
817−
818[[package]]
740[[package]]
819name = "utf-8"
741name = "utf-8"
820version = "0.7.5"
742version = "0.7.5"
@@ -827,6 +749,12 @@ version = "1.0.0"
827source = "registry+https://github.com/rust-lang/crates.io-index"
749source = "registry+https://github.com/rust-lang/crates.io-index"
828checksum = "eafc1b9b2dfc6f5529177b62cf806484db55b32dc7c9658a118e11bbeb33061d"
750checksum = "eafc1b9b2dfc6f5529177b62cf806484db55b32dc7c9658a118e11bbeb33061d"
829
751
752+[[package]]
753+name = "vec_map"
754+version = "0.8.2"
755+source = "registry+https://github.com/rust-lang/crates.io-index"
756+checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
757+
830[[package]]
758[[package]]
831name = "waker-fn"
759name = "waker-fn"
832version = "1.1.0"
760version = "1.1.0"
helix-core/src/state.rs−2
@@ -244,8 +244,6 @@ impl State {
244 skip_over_next(slice, &mut pos, |ch| ch.is_ascii_punctuation());
244 skip_over_next(slice, &mut pos, |ch| ch.is_ascii_punctuation());
245 }
245 }
246
246
247− // TODO: stops on spaces
248−
249 pos.saturating_sub(1)
247 pos.saturating_sub(1)
250 }
248 }
251
249
helix-syntax/Cargo.toml−1
@@ -8,7 +8,6 @@ edition = "2018"
8
8
9[dependencies]
9[dependencies]
10tree-sitter = "0.17"
10tree-sitter = "0.17"
11−enum-iterator = "0.6"
12
11
13[build-dependencies]
12[build-dependencies]
14cc = { version = "1", features = ["parallel"] }
13cc = { version = "1", features = ["parallel"] }
helix-syntax/src/lib.rs+1−2
@@ -1,4 +1,3 @@
1−use enum_iterator::IntoEnumIterator;
2use tree_sitter::Language;
1use tree_sitter::Language;
3
2
4#[macro_export]
3#[macro_export]
@@ -13,7 +12,7 @@ macro_rules! mk_extern {
13#[macro_export]
12#[macro_export]
14macro_rules! mk_enum {
13macro_rules! mk_enum {
15 ( $( $camel:ident ),* ) => {
14 ( $( $camel:ident ),* ) => {
16− #[derive(Clone, Copy, Debug, IntoEnumIterator, PartialEq)]
15+ #[derive(Clone, Copy, Debug, PartialEq)]
17 pub enum LANG {
16 pub enum LANG {
18 $(
17 $(
19 $camel,
18 $camel,
helix-term/Cargo.toml+4−3
@@ -15,9 +15,10 @@ helix-core = { path = "../helix-core" }
15helix-view = { path = "../helix-view", features = ["term"]}
15helix-view = { path = "../helix-view", features = ["term"]}
16
16
17anyhow = "1"
17anyhow = "1"
18−argh = "0.1"
19
18
20smol = "1"
19smol = "1"
21num_cpus = "1.13"
20num_cpus = "1.13"
21+# tui = { version = "0.12", default-features = false, features = ["crossterm"] }
22−tui = { version = "0.11", default-features = false, features = ["crossterm"] }
22+tui = { git = "https://github.com/fdehau/tui-rs", default-features = false, features = ["crossterm"] }
23−crossterm = { version = "0.17", features = ["event-stream"] }
23+crossterm = { version = "0.18", features = ["event-stream"] }
24+clap = { version = "3.0.0-beta.2 ", default-features = false, features = ["std"] }
helix-term/src/editor.rs+2−2
@@ -1,4 +1,4 @@
1−use crate::Args;
1+use clap::ArgMatches as Args;
2use helix_core::{state::coords_at_pos, state::Mode, syntax::HighlightEvent, Range, State};
2use helix_core::{state::coords_at_pos, state::Mode, syntax::HighlightEvent, Range, State};
3use helix_view::{commands, keymap, View};
3use helix_view::{commands, keymap, View};
4
4
@@ -53,7 +53,7 @@ impl Editor {
53 // TODO; move to state
53 // TODO; move to state
54 };
54 };
55
55
56− if let Some(file) = args.files.pop() {
56+ if let Some(file) = args.values_of_t::<PathBuf>("files").unwrap().pop() {
57 editor.open(file)?;
57 editor.open(file)?;
58 }
58 }
59
59
helix-term/src/main.rs+12−9
@@ -4,22 +4,25 @@ mod editor;
4
4
5use editor::Editor;
5use editor::Editor;
6
6
7−use argh::FromArgs;
7+use clap::{App, Arg};
8use std::path::PathBuf;
8use std::path::PathBuf;
9
9
10use anyhow::Error;
10use anyhow::Error;
11
11
12−#[derive(FromArgs)]
13−/// A post-modern text editor.
14−pub struct Args {
15− #[argh(positional)]
16− files: Vec<PathBuf>,
17−}
18−
19static EX: smol::Executor = smol::Executor::new();
12static EX: smol::Executor = smol::Executor::new();
20
13
21fn main() -> Result<(), Error> {
14fn main() -> Result<(), Error> {
22− let args: Args = argh::from_env();
15+ let args = App::new("helix")
16+ .version("0.1")
17+ .about("A post-modern text editor.")
18+ .arg(
19+ Arg::new("files")
20+ .about("Sets the input file to use")
21+ .required(true)
22+ .multiple(true)
23+ .index(1),
24+ )
25+ .get_matches();
23
26
24 for _ in 0..num_cpus::get() {
27 for _ in 0..num_cpus::get() {
25 std::thread::spawn(move || smol::block_on(EX.run(smol::future::pending::<()>())));
28 std::thread::spawn(move || smol::block_on(EX.run(smol::future::pending::<()>())));
helix-view/Cargo.toml+3−2
@@ -15,6 +15,7 @@ anyhow = "1"
15helix-core = { path = "../helix-core" }
15helix-core = { path = "../helix-core" }
16
16
17# Conversion traits
17# Conversion traits
18+# tui = { version = "0.12", default-features = false, features = ["crossterm"], optional = true}
18−tui = { version = "0.11", default-features = false, features = ["crossterm"], optional = true}
19+tui = { git = "https://github.com/fdehau/tui-rs", default-features = false, features = ["crossterm"], optional = true}
19−crossterm = { version = "0.17", features = ["event-stream"], optional = true}
20+crossterm = { version = "0.18", features = ["event-stream"], optional = true}
20once_cell = "1.4"
21once_cell = "1.4"
helix-view/src/commands.rs+1
@@ -151,6 +151,7 @@ pub fn extend_line_down(view: &mut View, count: usize) {
151pub fn split_selection_on_newline(view: &mut View, _count: usize) {
151pub fn split_selection_on_newline(view: &mut View, _count: usize) {
152 let text = &view.state.doc.slice(..);
152 let text = &view.state.doc.slice(..);
153 // only compile the regex once
153 // only compile the regex once
154+ #[allow(clippy::trivial_regex)]
154 static REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"\n").unwrap());
155 static REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"\n").unwrap());
155 // TODO: use a transaction
156 // TODO: use a transaction
156 view.state.selection = selection::split_on_matches(text, view.state.selection(), &REGEX)
157 view.state.selection = selection::split_on_matches(text, view.state.selection(), &REGEX)