on master help sign in
View tree implementation: render multiple split views.
448c1abBlaž Hrastnik
Cargo.lock+90−72
@@ -11,9 +11,9 @@ dependencies = [
11
11
12[[package]]
12[[package]]
13name = "anyhow"
13name = "anyhow"
14−version = "1.0.37"
14+version = "1.0.38"
15source = "registry+https://github.com/rust-lang/crates.io-index"
15source = "registry+https://github.com/rust-lang/crates.io-index"
16−checksum = "ee67c11feeac938fae061b232e38e0b6d94f97a9df10e6271319325ac4c56a86"
16+checksum = "afddf7f520a80dbf76e6f50a35bca42a2331ef227a28b3b6dc5c2e2338d114b1"
17
17
18[[package]]
18[[package]]
19name = "async-channel"
19name = "async-channel"
@@ -321,9 +321,9 @@ dependencies = [
321
321
322[[package]]
322[[package]]
323name = "dirs-sys-next"
323name = "dirs-sys-next"
324−version = "0.1.1"
324+version = "0.1.2"
325source = "registry+https://github.com/rust-lang/crates.io-index"
325source = "registry+https://github.com/rust-lang/crates.io-index"
326−checksum = "99de365f605554ae33f115102a02057d4fc18b01f3284d6870be0938743cfe7d"
326+checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
327dependencies = [
327dependencies = [
328 "libc",
328 "libc",
329 "redox_users",
329 "redox_users",
@@ -388,9 +388,9 @@ dependencies = [
388
388
389[[package]]
389[[package]]
390name = "futures"
390name = "futures"
391−version = "0.3.9"
391+version = "0.3.12"
392source = "registry+https://github.com/rust-lang/crates.io-index"
392source = "registry+https://github.com/rust-lang/crates.io-index"
393−checksum = "c70be434c505aee38639abccb918163b63158a4b4bb791b45b7023044bdc3c9c"
393+checksum = "da9052a1a50244d8d5aa9bf55cbc2fb6f357c86cc52e46c62ed390a7180cf150"
394dependencies = [
394dependencies = [
395 "futures-channel",
395 "futures-channel",
396 "futures-core",
396 "futures-core",
@@ -403,9 +403,9 @@ dependencies = [
403
403
404[[package]]
404[[package]]
405name = "futures-channel"
405name = "futures-channel"
406−version = "0.3.9"
406+version = "0.3.12"
407source = "registry+https://github.com/rust-lang/crates.io-index"
407source = "registry+https://github.com/rust-lang/crates.io-index"
408−checksum = "f01c61843314e95f96cc9245702248733a3a3d744e43e2e755e3c7af8348a0a9"
408+checksum = "f2d31b7ec7efab6eefc7c57233bb10b847986139d88cc2f5a02a1ae6871a1846"
409dependencies = [
409dependencies = [
410 "futures-core",
410 "futures-core",
411 "futures-sink",
411 "futures-sink",
@@ -413,15 +413,15 @@ dependencies = [
413
413
414[[package]]
414[[package]]
415name = "futures-core"
415name = "futures-core"
416−version = "0.3.9"
416+version = "0.3.12"
417source = "registry+https://github.com/rust-lang/crates.io-index"
417source = "registry+https://github.com/rust-lang/crates.io-index"
418−checksum = "db8d3b0917ff63a2a96173133c02818fac4a746b0a57569d3baca9ec0e945e08"
418+checksum = "79e5145dde8da7d1b3892dad07a9c98fc04bc39892b1ecc9692cf53e2b780a65"
419
419
420[[package]]
420[[package]]
421name = "futures-executor"
421name = "futures-executor"
422−version = "0.3.9"
422+version = "0.3.12"
423source = "registry+https://github.com/rust-lang/crates.io-index"
423source = "registry+https://github.com/rust-lang/crates.io-index"
424−checksum = "9ee9ca2f7eb4475772cf39dd1cd06208dce2670ad38f4d9c7262b3e15f127068"
424+checksum = "e9e59fdc009a4b3096bf94f740a0f2424c082521f20a9b08c5c07c48d90fd9b9"
425dependencies = [
425dependencies = [
426 "futures-core",
426 "futures-core",
427 "futures-task",
427 "futures-task",
@@ -430,9 +430,9 @@ dependencies = [
430
430
431[[package]]
431[[package]]
432name = "futures-io"
432name = "futures-io"
433−version = "0.3.9"
433+version = "0.3.12"
434source = "registry+https://github.com/rust-lang/crates.io-index"
434source = "registry+https://github.com/rust-lang/crates.io-index"
435−checksum = "e37c1a51b037b80922864b8eed90692c5cd8abd4c71ce49b77146caa47f3253b"
435+checksum = "28be053525281ad8259d47e4de5de657b25e7bac113458555bb4b70bc6870500"
436
436
437[[package]]
437[[package]]
438name = "futures-lite"
438name = "futures-lite"
@@ -445,15 +445,15 @@ dependencies = [
445 "futures-io",
445 "futures-io",
446 "memchr",
446 "memchr",
447 "parking",
447 "parking",
448− "pin-project-lite 0.2.1",
448+ "pin-project-lite 0.2.4",
449 "waker-fn",
449 "waker-fn",
450]
450]
451
451
452[[package]]
452[[package]]
453name = "futures-macro"
453name = "futures-macro"
454−version = "0.3.9"
454+version = "0.3.12"
455source = "registry+https://github.com/rust-lang/crates.io-index"
455source = "registry+https://github.com/rust-lang/crates.io-index"
456−checksum = "0f8719ca0e1f3c5e34f3efe4570ef2c0610ca6da85ae7990d472e9cbfba13664"
456+checksum = "c287d25add322d9f9abdcdc5927ca398917996600182178774032e9f8258fedd"
457dependencies = [
457dependencies = [
458 "proc-macro-hack",
458 "proc-macro-hack",
459 "proc-macro2",
459 "proc-macro2",
@@ -463,24 +463,24 @@ dependencies = [
463
463
464[[package]]
464[[package]]
465name = "futures-sink"
465name = "futures-sink"
466−version = "0.3.9"
466+version = "0.3.12"
467source = "registry+https://github.com/rust-lang/crates.io-index"
467source = "registry+https://github.com/rust-lang/crates.io-index"
468−checksum = "f6adabac1290109cfa089f79192fb6244ad2c3f1cc2281f3e1dd987592b71feb"
468+checksum = "caf5c69029bda2e743fddd0582d1083951d65cc9539aebf8812f36c3491342d6"
469
469
470[[package]]
470[[package]]
471name = "futures-task"
471name = "futures-task"
472−version = "0.3.9"
472+version = "0.3.12"
473source = "registry+https://github.com/rust-lang/crates.io-index"
473source = "registry+https://github.com/rust-lang/crates.io-index"
474−checksum = "a92a0843a2ff66823a8f7c77bffe9a09be2b64e533562c412d63075643ec0038"
474+checksum = "13de07eb8ea81ae445aca7b69f5f7bf15d7bf4912d8ca37d6645c77ae8a58d86"
475dependencies = [
475dependencies = [
476 "once_cell",
476 "once_cell",
477]
477]
478
478
479[[package]]
479[[package]]
480name = "futures-util"
480name = "futures-util"
481−version = "0.3.9"
481+version = "0.3.12"
482source = "registry+https://github.com/rust-lang/crates.io-index"
482source = "registry+https://github.com/rust-lang/crates.io-index"
483−checksum = "036a2107cdeb57f6d7322f1b6c363dad67cd63ca3b7d1b925bdf75bd5d96cda9"
483+checksum = "632a8cd0f2a4b3fdea1657f08bde063848c3bd00f9bbf6e256b8be78802e624b"
484dependencies = [
484dependencies = [
485 "futures-channel",
485 "futures-channel",
486 "futures-core",
486 "futures-core",
@@ -489,7 +489,7 @@ dependencies = [
489 "futures-sink",
489 "futures-sink",
490 "futures-task",
490 "futures-task",
491 "memchr",
491 "memchr",
492− "pin-project-lite 0.2.1",
492+ "pin-project-lite 0.2.4",
493 "pin-utils",
493 "pin-utils",
494 "proc-macro-hack",
494 "proc-macro-hack",
495 "proc-macro-nested",
495 "proc-macro-nested",
@@ -507,13 +507,13 @@ dependencies = [
507
507
508[[package]]
508[[package]]
509name = "getrandom"
509name = "getrandom"
510−version = "0.1.16"
510+version = "0.2.2"
511source = "registry+https://github.com/rust-lang/crates.io-index"
511source = "registry+https://github.com/rust-lang/crates.io-index"
512−checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
512+checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
513dependencies = [
513dependencies = [
514 "cfg-if 1.0.0",
514 "cfg-if 1.0.0",
515 "libc",
515 "libc",
516− "wasi 0.9.0+wasi-snapshot-preview1",
516+ "wasi",
517]
517]
518
518
519[[package]]
519[[package]]
@@ -621,6 +621,7 @@ dependencies = [
621 "helix-core",
621 "helix-core",
622 "helix-lsp",
622 "helix-lsp",
623 "once_cell",
623 "once_cell",
624+ "slotmap",
624 "smol",
625 "smol",
625 "tui",
626 "tui",
626 "url",
627 "url",
@@ -628,9 +629,9 @@ dependencies = [
628
629
629[[package]]
630[[package]]
630name = "hermit-abi"
631name = "hermit-abi"
631−version = "0.1.17"
632+version = "0.1.18"
632source = "registry+https://github.com/rust-lang/crates.io-index"
633source = "registry+https://github.com/rust-lang/crates.io-index"
633−checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"
634+checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c"
634dependencies = [
635dependencies = [
635 "libc",
636 "libc",
636]
637]
@@ -719,9 +720,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
719
720
720[[package]]
721[[package]]
721name = "libc"
722name = "libc"
722−version = "0.2.82"
723+version = "0.2.85"
723source = "registry+https://github.com/rust-lang/crates.io-index"
724source = "registry+https://github.com/rust-lang/crates.io-index"
724−checksum = "89203f3fba0a3795506acaad8ebce3c80c0af93f994d5a1d7a0b1eeb23271929"
725+checksum = "7ccac4b00700875e6a07c6cde370d44d32fa01c5a65cdd2fca6858c479d28bb3"
725
726
726[[package]]
727[[package]]
727name = "lock_api"
728name = "lock_api"
@@ -734,11 +735,11 @@ dependencies = [
734
735
735[[package]]
736[[package]]
736name = "log"
737name = "log"
737−version = "0.4.11"
738+version = "0.4.14"
738source = "registry+https://github.com/rust-lang/crates.io-index"
739source = "registry+https://github.com/rust-lang/crates.io-index"
739−checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
740+checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
740dependencies = [
741dependencies = [
741− "cfg-if 0.1.10",
742+ "cfg-if 1.0.0",
742]
743]
743
744
744[[package]]
745[[package]]
@@ -897,7 +898,7 @@ dependencies = [
897 "cfg-if 1.0.0",
898 "cfg-if 1.0.0",
898 "instant",
899 "instant",
899 "libc",
900 "libc",
900− "redox_syscall",
901+ "redox_syscall 0.1.57",
901 "smallvec",
902 "smallvec",
902 "winapi",
903 "winapi",
903]
904]
@@ -922,9 +923,9 @@ checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b"
922
923
923[[package]]
924[[package]]
924name = "pin-project-lite"
925name = "pin-project-lite"
925−version = "0.2.1"
926+version = "0.2.4"
926source = "registry+https://github.com/rust-lang/crates.io-index"
927source = "registry+https://github.com/rust-lang/crates.io-index"
927−checksum = "e36743d754ccdf9954c2e352ce2d4b106e024c814f6499c2dadff80da9a442d8"
928+checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827"
928
929
929[[package]]
930[[package]]
930name = "pin-utils"
931name = "pin-utils"
@@ -953,9 +954,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
953
954
954[[package]]
955[[package]]
955name = "proc-macro-nested"
956name = "proc-macro-nested"
956−version = "0.1.6"
957+version = "0.1.7"
957source = "registry+https://github.com/rust-lang/crates.io-index"
958source = "registry+https://github.com/rust-lang/crates.io-index"
958−checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a"
959+checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
959
960
960[[package]]
961[[package]]
961name = "proc-macro2"
962name = "proc-macro2"
@@ -1006,21 +1007,30 @@ version = "0.1.57"
1006source = "registry+https://github.com/rust-lang/crates.io-index"
1007source = "registry+https://github.com/rust-lang/crates.io-index"
1007checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
1008checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
1008
1009
1010+[[package]]
1011+name = "redox_syscall"
1012+version = "0.2.4"
1013+source = "registry+https://github.com/rust-lang/crates.io-index"
1014+checksum = "05ec8ca9416c5ea37062b502703cd7fcb207736bc294f6e0cf367ac6fc234570"
1015+dependencies = [
1016+ "bitflags",
1017+]
1018+
1009[[package]]
1019[[package]]
1010name = "redox_users"
1020name = "redox_users"
1011−version = "0.3.5"
1021+version = "0.4.0"
1012source = "registry+https://github.com/rust-lang/crates.io-index"
1022source = "registry+https://github.com/rust-lang/crates.io-index"
1013−checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d"
1023+checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"
1014dependencies = [
1024dependencies = [
1015 "getrandom",
1025 "getrandom",
1016− "redox_syscall",
1026+ "redox_syscall 0.2.4",
1017]
1027]
1018
1028
1019[[package]]
1029[[package]]
1020name = "regex"
1030name = "regex"
1021−version = "1.4.2"
1031+version = "1.4.3"
1022source = "registry+https://github.com/rust-lang/crates.io-index"
1032source = "registry+https://github.com/rust-lang/crates.io-index"
1023−checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c"
1033+checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a"
1024dependencies = [
1034dependencies = [
1025 "aho-corasick",
1035 "aho-corasick",
1026 "memchr",
1036 "memchr",
@@ -1030,9 +1040,9 @@ dependencies = [
1030
1040
1031[[package]]
1041[[package]]
1032name = "regex-syntax"
1042name = "regex-syntax"
1033−version = "0.6.21"
1043+version = "0.6.22"
1034source = "registry+https://github.com/rust-lang/crates.io-index"
1044source = "registry+https://github.com/rust-lang/crates.io-index"
1035−checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189"
1045+checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581"
1036
1046
1037[[package]]
1047[[package]]
1038name = "ropey"
1048name = "ropey"
@@ -1066,18 +1076,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
1066
1076
1067[[package]]
1077[[package]]
1068name = "serde"
1078name = "serde"
1069−version = "1.0.118"
1079+version = "1.0.123"
1070source = "registry+https://github.com/rust-lang/crates.io-index"
1080source = "registry+https://github.com/rust-lang/crates.io-index"
1071−checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800"
1081+checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae"
1072dependencies = [
1082dependencies = [
1073 "serde_derive",
1083 "serde_derive",
1074]
1084]
1075
1085
1076[[package]]
1086[[package]]
1077name = "serde_derive"
1087name = "serde_derive"
1078−version = "1.0.118"
1088+version = "1.0.123"
1079source = "registry+https://github.com/rust-lang/crates.io-index"
1089source = "registry+https://github.com/rust-lang/crates.io-index"
1080−checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df"
1090+checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31"
1081dependencies = [
1091dependencies = [
1082 "proc-macro2",
1092 "proc-macro2",
1083 "quote",
1093 "quote",
@@ -1141,11 +1151,20 @@ version = "0.4.2"
1141source = "registry+https://github.com/rust-lang/crates.io-index"
1151source = "registry+https://github.com/rust-lang/crates.io-index"
1142checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
1152checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
1143
1153
1154+[[package]]
1155+name = "slotmap"
1156+version = "1.0.2"
1157+source = "registry+https://github.com/rust-lang/crates.io-index"
1158+checksum = "ab3003725ae562cf995f3dc82bb99e70926e09000396816765bb6d7adbe740b1"
1159+dependencies = [
1160+ "version_check",
1161+]
1162+
1144[[package]]
1163[[package]]
1145name = "smallvec"
1164name = "smallvec"
1146−version = "1.6.0"
1165+version = "1.6.1"
1147source = "registry+https://github.com/rust-lang/crates.io-index"
1166source = "registry+https://github.com/rust-lang/crates.io-index"
1148−checksum = "1a55ca5f3b68e41c979bf8c46a6f1da892ca4db8f94023ce0bd32407573b1ac0"
1167+checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
1149
1168
1150[[package]]
1169[[package]]
1151name = "smol"
1170name = "smol"
@@ -1188,9 +1207,9 @@ dependencies = [
1188
1207
1189[[package]]
1208[[package]]
1190name = "syn"
1209name = "syn"
1191−version = "1.0.58"
1210+version = "1.0.60"
1192source = "registry+https://github.com/rust-lang/crates.io-index"
1211source = "registry+https://github.com/rust-lang/crates.io-index"
1193−checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5"
1212+checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081"
1194dependencies = [
1213dependencies = [
1195 "proc-macro2",
1214 "proc-macro2",
1196 "quote",
1215 "quote",
@@ -1199,8 +1218,8 @@ dependencies = [
1199
1218
1200[[package]]
1219[[package]]
1201name = "tendril"
1220name = "tendril"
1202−version = "0.4.1"
1221+version = "0.4.2"
1203−source = "git+https://github.com/servo/tendril#9532724c32a0bf5e65acb56209373d97223bc530"
1222+source = "git+https://github.com/servo/tendril#548cfaab79a3db13f350621d5b18a81d351463ba"
1204dependencies = [
1223dependencies = [
1205 "futf",
1224 "futf",
1206 "mac",
1225 "mac",
@@ -1238,29 +1257,28 @@ dependencies = [
1238
1257
1239[[package]]
1258[[package]]
1240name = "thread_local"
1259name = "thread_local"
1241−version = "1.1.0"
1260+version = "1.1.2"
1242source = "registry+https://github.com/rust-lang/crates.io-index"
1261source = "registry+https://github.com/rust-lang/crates.io-index"
1243−checksum = "bb9bc092d0d51e76b2b19d9d85534ffc9ec2db959a2523cdae0697e2972cd447"
1262+checksum = "d8208a331e1cb318dd5bd76951d2b8fc48ca38a69f5f4e4af1b6a9f8c6236915"
1244dependencies = [
1263dependencies = [
1245− "lazy_static",
1264+ "once_cell",
1246]
1265]
1247
1266
1248[[package]]
1267[[package]]
1249name = "time"
1268name = "time"
1250−version = "0.1.44"
1269+version = "0.1.43"
1251source = "registry+https://github.com/rust-lang/crates.io-index"
1270source = "registry+https://github.com/rust-lang/crates.io-index"
1252−checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
1271+checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
1253dependencies = [
1272dependencies = [
1254 "libc",
1273 "libc",
1255− "wasi 0.10.0+wasi-snapshot-preview1",
1256 "winapi",
1274 "winapi",
1257]
1275]
1258
1276
1259[[package]]
1277[[package]]
1260name = "tinyvec"
1278name = "tinyvec"
1261−version = "1.1.0"
1279+version = "1.1.1"
1262source = "registry+https://github.com/rust-lang/crates.io-index"
1280source = "registry+https://github.com/rust-lang/crates.io-index"
1263−checksum = "ccf8dbc19eb42fba10e8feaaec282fb50e2c14b2726d6301dbfeed0f73306a6f"
1281+checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023"
1264dependencies = [
1282dependencies = [
1265 "tinyvec_macros",
1283 "tinyvec_macros",
1266]
1284]
@@ -1360,6 +1378,12 @@ version = "0.8.2"
1360source = "registry+https://github.com/rust-lang/crates.io-index"
1378source = "registry+https://github.com/rust-lang/crates.io-index"
1361checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
1379checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
1362
1380
1381+[[package]]
1382+name = "version_check"
1383+version = "0.9.2"
1384+source = "registry+https://github.com/rust-lang/crates.io-index"
1385+checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
1386+
1363[[package]]
1387[[package]]
1364name = "waker-fn"
1388name = "waker-fn"
1365version = "1.1.0"
1389version = "1.1.0"
@@ -1379,15 +1403,9 @@ dependencies = [
1379
1403
1380[[package]]
1404[[package]]
1381name = "wasi"
1405name = "wasi"
1382−version = "0.9.0+wasi-snapshot-preview1"
1383−source = "registry+https://github.com/rust-lang/crates.io-index"
1384−checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
1385−
1386−[[package]]
1387−name = "wasi"
1388−version = "0.10.0+wasi-snapshot-preview1"
1406+version = "0.10.2+wasi-snapshot-preview1"
1389source = "registry+https://github.com/rust-lang/crates.io-index"
1407source = "registry+https://github.com/rust-lang/crates.io-index"
1390−checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
1408+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
1391
1409
1392[[package]]
1410[[package]]
1393name = "wepoll-sys"
1411name = "wepoll-sys"
helix-term/src/application.rs+11−8
@@ -39,11 +39,12 @@ impl Application {
39 pub fn new(mut args: Args, executor: &'static smol::Executor<'static>) -> Result<Self, Error> {
39 pub fn new(mut args: Args, executor: &'static smol::Executor<'static>) -> Result<Self, Error> {
40 let backend = CrosstermBackend::new(stdout());
40 let backend = CrosstermBackend::new(stdout());
41 let mut terminal = Terminal::new(backend)?;
41 let mut terminal = Terminal::new(backend)?;
42− let mut editor = Editor::new();
43 let size = terminal.size()?;
42 let size = terminal.size()?;
43+ let mut editor = Editor::new(size);
44
44
45− if let Some(file) = args.values_of_t::<PathBuf>("files").unwrap().pop() {
45+ let files = args.values_of_t::<PathBuf>("files").unwrap();
46+ for file in files {
46− editor.open(file, (size.width, size.height), executor)?;
47+ editor.open(file, executor)?;
47 }
48 }
48
49
49 let mut compositor = Compositor::new();
50 let mut compositor = Compositor::new();
@@ -132,11 +133,13 @@ impl Application {
132 Notification::PublishDiagnostics(params) => {
133 Notification::PublishDiagnostics(params) => {
133 let path = Some(params.uri.to_file_path().unwrap());
134 let path = Some(params.uri.to_file_path().unwrap());
134
135
135− let view = self
136+ let view: Option<&mut View> = None;
137+ // TODO
138+ // let view = self
136− .editor
139+ // .editor
137− .views
140+ // .views
138− .iter_mut()
141+ // .iter_mut()
139− .find(|view| view.doc.path == path);
142+ // .find(|view| view.doc.path == path);
140
143
141 if let Some(view) = view {
144 if let Some(view) = view {
142 let doc = view.doc.text().slice(..);
145 let doc = view.doc.text().slice(..);
helix-term/src/commands.rs+54−57
@@ -183,7 +183,7 @@ pub fn check_cursor_in_view(view: &View) -> bool {
183 let doc = &view.doc;
183 let doc = &view.doc;
184 let cursor = doc.selection().cursor();
184 let cursor = doc.selection().cursor();
185 let line = doc.text().char_to_line(cursor);
185 let line = doc.text().char_to_line(cursor);
186− let document_end = view.first_line + view.size.1.saturating_sub(1) as usize;
186+ let document_end = view.first_line + view.area.height.saturating_sub(1) as usize;
187
187
188 if (line > document_end.saturating_sub(PADDING)) | (line < view.first_line + PADDING) {
188 if (line > document_end.saturating_sub(PADDING)) | (line < view.first_line + PADDING) {
189 return false;
189 return false;
@@ -197,7 +197,7 @@ pub fn page_up(cx: &mut Context) {
197 return;
197 return;
198 }
198 }
199
199
200− view.first_line = view.first_line.saturating_sub(view.size.1 as usize);
200+ view.first_line = view.first_line.saturating_sub(view.area.height as usize);
201
201
202 if !check_cursor_in_view(view) {
202 if !check_cursor_in_view(view) {
203 let text = view.doc.text();
203 let text = view.doc.text();
@@ -208,7 +208,7 @@ pub fn page_up(cx: &mut Context) {
208
208
209pub fn page_down(cx: &mut Context) {
209pub fn page_down(cx: &mut Context) {
210 let view = cx.view();
210 let view = cx.view();
211− view.first_line += view.size.1 as usize + PADDING;
211+ view.first_line += view.area.height as usize + PADDING;
212
212
213 if view.first_line < view.doc.text().len_lines() {
213 if view.first_line < view.doc.text().len_lines() {
214 let text = view.doc.text();
214 let text = view.doc.text();
@@ -223,7 +223,9 @@ pub fn half_page_up(cx: &mut Context) {
223 return;
223 return;
224 }
224 }
225
225
226+ view.first_line = view
227+ .first_line
226− view.first_line = view.first_line.saturating_sub(view.size.1 as usize / 2);
228+ .saturating_sub(view.area.height as usize / 2);
227
229
228 if !check_cursor_in_view(view) {
230 if !check_cursor_in_view(view) {
229 let text = &view.doc.text();
231 let text = &view.doc.text();
@@ -235,8 +237,8 @@ pub fn half_page_up(cx: &mut Context) {
235pub fn half_page_down(cx: &mut Context) {
237pub fn half_page_down(cx: &mut Context) {
236 let view = cx.view();
238 let view = cx.view();
237 let lines = view.doc.text().len_lines();
239 let lines = view.doc.text().len_lines();
238− if view.first_line < lines.saturating_sub(view.size.1 as usize) {
240+ if view.first_line < lines.saturating_sub(view.area.height as usize) {
239− view.first_line += view.size.1 as usize / 2;
241+ view.first_line += view.area.height as usize / 2;
240 }
242 }
241 if !check_cursor_in_view(view) {
243 if !check_cursor_in_view(view) {
242 let text = view.doc.text();
244 let text = view.doc.text();
@@ -367,8 +369,7 @@ pub fn change_selection(cx: &mut Context) {
367
369
368pub fn collapse_selection(cx: &mut Context) {
370pub fn collapse_selection(cx: &mut Context) {
369 let selection = cx
371 let selection = cx
370− .view()
372+ .doc()
371− .doc
372 .selection()
373 .selection()
373 .transform(|range| Range::new(range.head, range.head));
374 .transform(|range| Range::new(range.head, range.head));
374
375
@@ -377,8 +378,7 @@ pub fn collapse_selection(cx: &mut Context) {
377
378
378pub fn flip_selections(cx: &mut Context) {
379pub fn flip_selections(cx: &mut Context) {
379 let selection = cx
380 let selection = cx
380− .view()
381+ .doc()
381− .doc
382 .selection()
382 .selection()
383 .transform(|range| Range::new(range.head, range.anchor));
383 .transform(|range| Range::new(range.head, range.anchor));
384
384
@@ -396,8 +396,7 @@ pub fn insert_mode(cx: &mut Context) {
396 enter_insert_mode(cx);
396 enter_insert_mode(cx);
397
397
398 let selection = cx
398 let selection = cx
399− .view()
399+ .doc()
400− .doc
401 .selection()
400 .selection()
402 .transform(|range| Range::new(range.to(), range.from()));
401 .transform(|range| Range::new(range.to(), range.from()));
403 cx.doc().set_selection(selection);
402 cx.doc().set_selection(selection);
@@ -431,37 +430,40 @@ pub fn command_mode(cx: &mut Context) {
431 |_input: &str| {
430 |_input: &str| {
432 // TODO: i need this duplicate list right now to avoid borrow checker issues
431 // TODO: i need this duplicate list right now to avoid borrow checker issues
433 let command_list = vec![
432 let command_list = vec![
433+ "q".to_string(),
434+ "o".to_string(),
435+ "w".to_string(),
434− String::from("q"),
436+ // String::from("q"),
435− String::from("aaa"),
437+ // String::from("aaa"),
436− String::from("bbb"),
438+ // String::from("bbb"),
437− String::from("ccc"),
439+ // String::from("ccc"),
438− String::from("ddd"),
440+ // String::from("ddd"),
439− String::from("eee"),
441+ // String::from("eee"),
440− String::from("averylongcommandaverylongcommandaverylongcommandaverylongcommandaverylongcommand"),
442+ // String::from("averylongcommandaverylongcommandaverylongcommandaverylongcommandaverylongcommand"),
441− String::from("q"),
443+ // String::from("q"),
442− String::from("aaa"),
444+ // String::from("aaa"),
443− String::from("bbb"),
445+ // String::from("bbb"),
444− String::from("ccc"),
446+ // String::from("ccc"),
445− String::from("ddd"),
447+ // String::from("ddd"),
446− String::from("eee"),
448+ // String::from("eee"),
447− String::from("q"),
449+ // String::from("q"),
448− String::from("aaa"),
450+ // String::from("aaa"),
449− String::from("bbb"),
451+ // String::from("bbb"),
450− String::from("ccc"),
452+ // String::from("ccc"),
451− String::from("ddd"),
453+ // String::from("ddd"),
452− String::from("eee"),
454+ // String::from("eee"),
453− String::from("q"),
455+ // String::from("q"),
454− String::from("aaa"),
456+ // String::from("aaa"),
455− String::from("bbb"),
457+ // String::from("bbb"),
456− String::from("ccc"),
458+ // String::from("ccc"),
457− String::from("ddd"),
459+ // String::from("ddd"),
458− String::from("eee"),
460+ // String::from("eee"),
459− String::from("q"),
461+ // String::from("q"),
460− String::from("aaa"),
462+ // String::from("aaa"),
461− String::from("bbb"),
463+ // String::from("bbb"),
462− String::from("ccc"),
464+ // String::from("ccc"),
463− String::from("ddd"),
465+ // String::from("ddd"),
464− String::from("eee"),
466+ // String::from("eee"),
465 ];
467 ];
466 command_list
468 command_list
467 .into_iter()
469 .into_iter()
@@ -478,8 +480,7 @@ pub fn command_mode(cx: &mut Context) {
478 match *parts.as_slice() {
480 match *parts.as_slice() {
479 ["q"] => editor.should_close = true,
481 ["q"] => editor.should_close = true,
480 ["o", path] => {
482 ["o", path] => {
481− let size = editor.view().size;
482− editor.open(path.into(), size, executor);
483+ editor.open(path.into(), executor);
483 }
484 }
484 _ => (),
485 _ => (),
485 }
486 }
@@ -499,12 +500,13 @@ pub fn file_picker(cx: &mut Context) {
499}
500}
500
501
501pub fn buffer_picker(cx: &mut Context) {
502pub fn buffer_picker(cx: &mut Context) {
503+ unimplemented!()
502− cx.callback = Some(Box::new(
504+ // cx.callback = Some(Box::new(
503− |compositor: &mut Compositor, editor: &mut Editor| {
505+ // |compositor: &mut Compositor, editor: &mut Editor| {
504− let picker = ui::buffer_picker(&editor.views, editor.focus);
506+ // let picker = ui::buffer_picker(&editor.views, editor.focus);
505− compositor.push(Box::new(picker));
507+ // compositor.push(Box::new(picker));
506− },
508+ // },
507− ));
509+ // ));
508}
510}
509
511
510// calculate line numbers for each selection range
512// calculate line numbers for each selection range
@@ -617,12 +619,7 @@ fn append_changes_to_history(cx: &mut Context) {
617 // TODO: trigger lsp/documentDidChange with changes
619 // TODO: trigger lsp/documentDidChange with changes
618
620
619 // HAXX: we need to reconstruct the state as it was before the changes..
621 // HAXX: we need to reconstruct the state as it was before the changes..
620− let old_state = cx
621− .view()
622− .doc
623− .old_state
624− .take()
625− .expect("no old_state available");
622+ let old_state = cx.doc().old_state.take().expect("no old_state available");
626
623
627 // TODO: take transaction by value?
624 // TODO: take transaction by value?
628 cx.doc().history.commit_revision(&transaction, &old_state);
625 cx.doc().history.commit_revision(&transaction, &old_state);
helix-term/src/ui/editor.rs+34−16
@@ -37,15 +37,20 @@ impl EditorView {
37 surface: &mut Surface,
37 surface: &mut Surface,
38 theme: &Theme,
38 theme: &Theme,
39 ) {
39 ) {
40+ let area = Rect::new(
41+ viewport.x + OFFSET,
42+ viewport.y,
43+ viewport.width - OFFSET,
44+ viewport.height - 2,
40− let area = Rect::new(OFFSET, 0, viewport.width - OFFSET, viewport.height - 2); // - 2 for statusline and prompt
45+ ); // - 2 for statusline and prompt
41 self.render_buffer(view, area, surface, theme);
46 self.render_buffer(view, area, surface, theme);
42
47
43 // clear with background color
48 // clear with background color
44 // TODO: this seems to prevent setting style later
49 // TODO: this seems to prevent setting style later
45 // surface.set_style(viewport, theme.get("ui.background"));
50 // surface.set_style(viewport, theme.get("ui.background"));
46
51
47− let area = Rect::new(0, viewport.height - 2, viewport.width, 1);
52+ let area = Rect::new(viewport.x, viewport.height - 2, viewport.width, 1);
48− self.render_statusline(view, area, surface, theme);
53+ self.render_statusline(&view.doc, area, surface, theme);
49 }
54 }
50
55
51 // TODO: ideally not &mut View but highlights require it because of cursor cache
56 // TODO: ideally not &mut View but highlights require it because of cursor cache
@@ -203,34 +208,46 @@ impl EditorView {
203 let last_line = view.last_line();
208 let last_line = view.last_line();
204 for (i, line) in (view.first_line..last_line).enumerate() {
209 for (i, line) in (view.first_line..last_line).enumerate() {
205 if view.doc.diagnostics.iter().any(|d| d.line == line) {
210 if view.doc.diagnostics.iter().any(|d| d.line == line) {
206− surface.set_stringn(0, i as u16, "●", 1, warning);
211+ surface.set_stringn(
212+ viewport.x + 0 - OFFSET,
213+ viewport.y + i as u16,
214+ "●",
215+ 1,
216+ warning,
217+ );
207 }
218 }
208
219
209− surface.set_stringn(1, i as u16, format!("{:>5}", line + 1), 5, style);
220+ surface.set_stringn(
221+ viewport.x + 1 - OFFSET,
222+ viewport.y + i as u16,
223+ format!("{:>5}", line + 1),
224+ 5,
225+ style,
226+ );
210 }
227 }
211 }
228 }
212
229
213 pub fn render_statusline(
230 pub fn render_statusline(
214 &self,
231 &self,
215− view: &View,
232+ doc: &Document,
216 viewport: Rect,
233 viewport: Rect,
217 surface: &mut Surface,
234 surface: &mut Surface,
218 theme: &Theme,
235 theme: &Theme,
219 ) {
236 ) {
220 let text_color = text_color();
237 let text_color = text_color();
221− let mode = match view.doc.mode() {
238+ let mode = match doc.mode() {
222 Mode::Insert => "INS",
239 Mode::Insert => "INS",
223 Mode::Normal => "NOR",
240 Mode::Normal => "NOR",
224 Mode::Goto => "GOTO",
241 Mode::Goto => "GOTO",
225 };
242 };
226 // statusline
243 // statusline
227 surface.set_style(
244 surface.set_style(
228− Rect::new(0, viewport.y, viewport.width, 1),
245+ Rect::new(viewport.x, viewport.y, viewport.width, 1),
229 theme.get("ui.statusline"),
246 theme.get("ui.statusline"),
230 );
247 );
231− surface.set_string(1, viewport.y, mode, text_color);
248+ surface.set_string(viewport.x + 1, viewport.y, mode, text_color);
232
249
233− if let Some(path) = view.doc.relative_path() {
250+ if let Some(path) = doc.relative_path() {
234 let path = path.to_string_lossy();
251 let path = path.to_string_lossy();
235 surface.set_string(6, viewport.y, path, text_color);
252 surface.set_string(6, viewport.y, path, text_color);
236 // TODO: append [+] if modified
253 // TODO: append [+] if modified
@@ -239,7 +256,7 @@ impl EditorView {
239 surface.set_string(
256 surface.set_string(
240 viewport.width - 10,
257 viewport.width - 10,
241 viewport.y,
258 viewport.y,
242− format!("{}", view.doc.diagnostics.len()),
259+ format!("{}", doc.diagnostics.len()),
243 text_color,
260 text_color,
244 );
261 );
245 }
262 }
@@ -251,9 +268,8 @@ impl Component for EditorView {
251 Event::Resize(width, height) => {
268 Event::Resize(width, height) => {
252 // TODO: simplistic ensure cursor in view for now
269 // TODO: simplistic ensure cursor in view for now
253 // TODO: loop over views
270 // TODO: loop over views
254− let view = cx.editor.view_mut();
271+ cx.editor.tree.resize(Rect::new(0, 0, width, height));
255− view.size = (width, height);
256− view.ensure_cursor_in_view();
272+ // TODO: restore view.ensure_cursor_in_view();
257 EventResult::Consumed(None)
273 EventResult::Consumed(None)
258 }
274 }
259 Event::Key(event) => {
275 Event::Key(event) => {
@@ -306,8 +322,10 @@ impl Component for EditorView {
306 // SAFETY: we cheat around the view_mut() borrow because it doesn't allow us to also borrow
322 // SAFETY: we cheat around the view_mut() borrow because it doesn't allow us to also borrow
307 // theme. Theme is immutable mutating view won't disrupt theme_ref.
323 // theme. Theme is immutable mutating view won't disrupt theme_ref.
308 let theme_ref = unsafe { &*(&cx.editor.theme as *const Theme) };
324 let theme_ref = unsafe { &*(&cx.editor.theme as *const Theme) };
309− let view = cx.editor.view_mut();
325+ for view in cx.editor.tree.views() {
326+ // TODO: use parent area
310− self.render_view(view, area, surface, theme_ref);
327+ self.render_view(view, view.area, surface, theme_ref);
328+ }
311
329
312 // TODO: drop unwrap
330 // TODO: drop unwrap
313 }
331 }
helix-term/src/ui/mod.rs+28−28
@@ -82,38 +82,38 @@ pub fn file_picker(root: &str, ex: &'static smol::Executor) -> Picker<PathBuf> {
82 path.strip_prefix("./").unwrap().to_str().unwrap().into()
82 path.strip_prefix("./").unwrap().to_str().unwrap().into()
83 },
83 },
84 move |editor: &mut Editor, path: &PathBuf| {
84 move |editor: &mut Editor, path: &PathBuf| {
85− let size = editor.view().size;
86− editor.open(path.into(), size, ex);
85+ editor.open(path.into(), ex);
87 },
86 },
88 )
87 )
89}
88}
90
89
91use helix_view::View;
90use helix_view::View;
92pub fn buffer_picker(views: &[View], current: usize) -> Picker<(Option<PathBuf>, usize)> {
91pub fn buffer_picker(views: &[View], current: usize) -> Picker<(Option<PathBuf>, usize)> {
92+ unimplemented!();
93− use helix_view::Editor;
93+ // use helix_view::Editor;
94− Picker::new(
94+ // Picker::new(
95− views
95+ // views
96− .iter()
96+ // .iter()
97− .enumerate()
97+ // .enumerate()
98− .map(|(i, view)| (view.doc.relative_path().map(Path::to_path_buf), i))
98+ // .map(|(i, view)| (view.doc.relative_path().map(Path::to_path_buf), i))
99− .collect(),
99+ // .collect(),
100− move |(path, index): &(Option<PathBuf>, usize)| {
100+ // move |(path, index): &(Option<PathBuf>, usize)| {
101− // format_fn
101+ // // format_fn
102− match path {
102+ // match path {
103− Some(path) => {
103+ // Some(path) => {
104− if *index == current {
104+ // if *index == current {
105− format!("{} (*)", path.to_str().unwrap()).into()
105+ // format!("{} (*)", path.to_str().unwrap()).into()
106− } else {
106+ // } else {
107− path.to_str().unwrap().into()
107+ // path.to_str().unwrap().into()
108− }
108+ // }
109− }
109+ // }
110− None => "[NEW]".into(),
110+ // None => "[NEW]".into(),
111− }
111+ // }
112− },
112+ // },
113− |editor: &mut Editor, &(_, index): &(Option<PathBuf>, usize)| {
113+ // |editor: &mut Editor, &(_, index): &(Option<PathBuf>, usize)| {
114− if index < editor.views.len() {
114+ // if index < editor.views.len() {
115− editor.focus = index;
115+ // editor.focus = index;
116− }
116+ // }
117− },
117+ // },
118− )
118+ // )
119}
119}
helix-view/Cargo.toml+2
@@ -24,3 +24,5 @@ url = "2"
24
24
25smol = "1"
25smol = "1"
26futures-util = "0.3"
26futures-util = "0.3"
27+
28+slotmap = "1"
helix-view/src/editor.rs+13−21
@@ -1,45 +1,36 @@
1use crate::theme::Theme;
1use crate::theme::Theme;
2+use crate::tree::Tree;
2use crate::{Document, View};
3use crate::{Document, View};
4+use slotmap::DefaultKey as Key;
3
5
4use std::path::PathBuf;
6use std::path::PathBuf;
5
7
6use anyhow::Error;
8use anyhow::Error;
7
9
8pub struct Editor {
10pub struct Editor {
9− pub views: Vec<View>,
11+ pub tree: Tree,
12+ // pub documents: Vec<Document>,
10− pub focus: usize,
13+ pub focus: Key,
11 pub should_close: bool,
14 pub should_close: bool,
12 pub theme: Theme, // TODO: share one instance
15 pub theme: Theme, // TODO: share one instance
13 pub language_servers: helix_lsp::Registry,
16 pub language_servers: helix_lsp::Registry,
14}
17}
15
18
16−impl Default for Editor {
17− fn default() -> Self {
18− Self::new()
19− }
20−}
21−
22impl Editor {
19impl Editor {
23− pub fn new() -> Self {
20+ pub fn new(area: tui::layout::Rect) -> Self {
24 let theme = Theme::default();
21 let theme = Theme::default();
25 let language_servers = helix_lsp::Registry::new();
22 let language_servers = helix_lsp::Registry::new();
26
23
27 Self {
24 Self {
28− views: Vec::new(),
25+ tree: Tree::new(area),
29− focus: 0,
26+ focus: Key::default(),
30 should_close: false,
27 should_close: false,
31 theme,
28 theme,
32 language_servers,
29 language_servers,
33 }
30 }
34 }
31 }
35
32
36− pub fn open(
37− &mut self,
38− path: PathBuf,
39− size: (u16, u16),
40− executor: &smol::Executor,
33+ pub fn open(&mut self, path: PathBuf, executor: &smol::Executor) -> Result<(), Error> {
41− ) -> Result<(), Error> {
42− let pos = self.views.len();
43 let mut doc = Document::load(path, self.theme.scopes())?;
34 let mut doc = Document::load(path, self.theme.scopes())?;
44
35
45 // try to find a language server based on the language name
36 // try to find a language server based on the language name
@@ -60,16 +51,17 @@ impl Editor {
60 .unwrap();
51 .unwrap();
61 }
52 }
62
53
63− self.views.push(View::new(doc, size)?);
54+ let view = View::new(doc)?;
55+ let pos = self.tree.insert(view);
64 self.focus = pos;
56 self.focus = pos;
65 Ok(())
57 Ok(())
66 }
58 }
67
59
68 pub fn view(&self) -> &View {
60 pub fn view(&self) -> &View {
69− self.views.get(self.focus).unwrap()
61+ self.tree.get(self.focus)
70 }
62 }
71
63
72 pub fn view_mut(&mut self) -> &mut View {
64 pub fn view_mut(&mut self) -> &mut View {
73− self.views.get_mut(self.focus).unwrap()
65+ self.tree.get_mut(self.focus)
74 }
66 }
75}
67}
helix-view/src/lib.rs+1
@@ -1,6 +1,7 @@
1pub mod document;
1pub mod document;
2pub mod editor;
2pub mod editor;
3pub mod theme;
3pub mod theme;
4+pub mod tree;
4pub mod view;
5pub mod view;
5
6
6pub use document::Document;
7pub use document::Document;
helix-view/src/view.rs+5−5
@@ -17,15 +17,15 @@ pub const PADDING: usize = 5;
17pub struct View {
17pub struct View {
18 pub doc: Document,
18 pub doc: Document,
19 pub first_line: usize,
19 pub first_line: usize,
20− pub size: (u16, u16),
20+ pub area: Rect,
21}
21}
22
22
23impl View {
23impl View {
24− pub fn new(doc: Document, size: (u16, u16)) -> Result<Self, Error> {
24+ pub fn new(doc: Document) -> Result<Self, Error> {
25 let view = Self {
25 let view = Self {
26 doc,
26 doc,
27 first_line: 0,
27 first_line: 0,
28− size,
28+ area: Rect::default(), // will get calculated upon inserting into tree
29 };
29 };
30
30
31 Ok(view)
31 Ok(view)
@@ -34,7 +34,7 @@ impl View {
34 pub fn ensure_cursor_in_view(&mut self) {
34 pub fn ensure_cursor_in_view(&mut self) {
35 let cursor = self.doc.state.selection().cursor();
35 let cursor = self.doc.state.selection().cursor();
36 let line = self.doc.text().char_to_line(cursor);
36 let line = self.doc.text().char_to_line(cursor);
37− let document_end = self.first_line + (self.size.1 as usize).saturating_sub(2);
37+ let document_end = self.first_line + (self.area.height as usize).saturating_sub(2);
38
38
39 // TODO: side scroll
39 // TODO: side scroll
40
40
@@ -50,7 +50,7 @@ impl View {
50 /// Calculates the last visible line on screen
50 /// Calculates the last visible line on screen
51 #[inline]
51 #[inline]
52 pub fn last_line(&self) -> usize {
52 pub fn last_line(&self) -> usize {
53− let viewport = Rect::new(6, 0, self.size.0, self.size.1 - 2); // - 2 for statusline and prompt
53+ let viewport = Rect::new(6, 0, self.area.width, self.area.height - 2); // - 2 for statusline and prompt
54 std::cmp::min(
54 std::cmp::min(
55 self.first_line + (viewport.height as usize),
55 self.first_line + (viewport.height as usize),
56 self.doc.text().len_lines() - 1,
56 self.doc.text().len_lines() - 1,