on master help sign in
Update to rust 1.56 + 2021 edition
182a59bBlaž Hrastnik
flake.lock+52−16
@@ -2,11 +2,11 @@
2 "nodes": {
2 "nodes": {
3 "devshell": {
3 "devshell": {
4 "locked": {
4 "locked": {
5− "lastModified": 1630239564,
5+ "lastModified": 1632436039,
6− "narHash": "sha256-lv7atkVE1+dFw0llmzONsbSIo5ao85KpNSRoFk4K8vU=",
6+ "narHash": "sha256-OtITeVWcKXn1SpVEnImpTGH91FycCskGBPqmlxiykv4=",
7 "owner": "numtide",
7 "owner": "numtide",
8 "repo": "devshell",
8 "repo": "devshell",
9− "rev": "bd86d3a2bb28ce4d223315e0eca0d59fef8a0a73",
9+ "rev": "7a7a7aa0adebe5488e5abaec688fd9ae0f8ea9c6",
10 "type": "github"
10 "type": "github"
11 },
11 },
12 "original": {
12 "original": {
@@ -15,6 +15,21 @@
15 "type": "github"
15 "type": "github"
16 }
16 }
17 },
17 },
18+ "flake-utils": {
19+ "locked": {
20+ "lastModified": 1623875721,
21+ "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=",
22+ "owner": "numtide",
23+ "repo": "flake-utils",
24+ "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772",
25+ "type": "github"
26+ },
27+ "original": {
28+ "owner": "numtide",
29+ "repo": "flake-utils",
30+ "type": "github"
31+ }
32+ },
18 "flakeCompat": {
33 "flakeCompat": {
19 "flake": false,
34 "flake": false,
20 "locked": {
35 "locked": {
@@ -37,14 +52,16 @@
37 "nixpkgs": [
52 "nixpkgs": [
38 "nixpkgs"
53 "nixpkgs"
39 ],
54 ],
40− "rustOverlay": "rustOverlay"
55+ "rustOverlay": [
56+ "rust-overlay"
57+ ]
41 },
58 },
42 "locked": {
59 "locked": {
43− "lastModified": 1631254163,
60+ "lastModified": 1634796585,
44− "narHash": "sha256-8+nOGLH1fXwWnNMTQq/Igk434BzZF5Vld45xLDLiNDQ=",
61+ "narHash": "sha256-CW4yx6omk5qCXUIwXHp/sztA7u0SpyLq9NEACPnkiz8=",
45 "owner": "yusdacra",
62 "owner": "yusdacra",
46 "repo": "nix-cargo-integration",
63 "repo": "nix-cargo-integration",
47− "rev": "432d8504a32232e8d74710024d5bf5cc31767651",
64+ "rev": "a84a2137a396f303978f1d48341e0390b0e16a8b",
48 "type": "github"
65 "type": "github"
49 },
66 },
50 "original": {
67 "original": {
@@ -55,11 +72,11 @@
55 },
72 },
56 "nixpkgs": {
73 "nixpkgs": {
57 "locked": {
74 "locked": {
58− "lastModified": 1631206977,
75+ "lastModified": 1634782485,
59− "narHash": "sha256-o3Dct9aJ5ht5UaTUBzXrRcK1RZt2eG5/xSlWJuUCVZM=",
76+ "narHash": "sha256-psfh4OQSokGXG0lpq3zKFbhOo3QfoeudRcaUnwMRkQo=",
60 "owner": "nixos",
77 "owner": "nixos",
61 "repo": "nixpkgs",
78 "repo": "nixpkgs",
62− "rev": "4f6d8095fd51954120a1d08ea5896fe42dc3923b",
79+ "rev": "34ad3ffe08adfca17fcb4e4a47bb5f3b113687be",
63 "type": "github"
80 "type": "github"
64 },
81 },
65 "original": {
82 "original": {
@@ -69,21 +86,40 @@
69 "type": "github"
86 "type": "github"
70 }
87 }
71 },
88 },
89+ "nixpkgs_2": {
90+ "locked": {
91+ "lastModified": 1628186154,
92+ "narHash": "sha256-r2d0wvywFnL9z4iptztdFMhaUIAaGzrSs7kSok0PgmE=",
93+ "owner": "NixOS",
94+ "repo": "nixpkgs",
95+ "rev": "06552b72346632b6943c8032e57e702ea12413bf",
96+ "type": "github"
97+ },
98+ "original": {
99+ "owner": "NixOS",
100+ "repo": "nixpkgs",
101+ "type": "github"
102+ }
103+ },
72 "root": {
104 "root": {
73 "inputs": {
105 "inputs": {
74 "flakeCompat": "flakeCompat",
106 "flakeCompat": "flakeCompat",
75 "nixCargoIntegration": "nixCargoIntegration",
107 "nixCargoIntegration": "nixCargoIntegration",
76− "nixpkgs": "nixpkgs"
108+ "nixpkgs": "nixpkgs",
109+ "rust-overlay": "rust-overlay"
77 }
110 }
78 },
111 },
79− "rustOverlay": {
112+ "rust-overlay": {
80− "flake": false,
113+ "inputs": {
114+ "flake-utils": "flake-utils",
115+ "nixpkgs": "nixpkgs_2"
116+ },
81 "locked": {
117 "locked": {
82− "lastModified": 1631240108,
118+ "lastModified": 1634869268,
83− "narHash": "sha256-ffsTkAGyQLxu4E28nVcqwc8xFL/H1UEwrRw2ITI43Aw=",
119+ "narHash": "sha256-RVAcEFlFU3877Mm4q/nbXGEYTDg/wQNhzmXGMTV6wBs=",
84 "owner": "oxalica",
120 "owner": "oxalica",
85 "repo": "rust-overlay",
121 "repo": "rust-overlay",
86− "rev": "3a29d5e726b855d9463eb5dfe04f1ec14d413289",
122+ "rev": "c02c2d86354327317546501af001886fbb53d374",
87 "type": "github"
123 "type": "github"
88 },
124 },
89 "original": {
125 "original": {
flake.nix+2
@@ -3,9 +3,11 @@
3
3
4 inputs = {
4 inputs = {
5 nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
5 nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6+ rust-overlay.url = "github:oxalica/rust-overlay";
6 nixCargoIntegration = {
7 nixCargoIntegration = {
7 url = "github:yusdacra/nix-cargo-integration";
8 url = "github:yusdacra/nix-cargo-integration";
8 inputs.nixpkgs.follows = "nixpkgs";
9 inputs.nixpkgs.follows = "nixpkgs";
10+ inputs.rustOverlay.follows = "rust-overlay";
9 };
11 };
10 flakeCompat = {
12 flakeCompat = {
11 url = "github:edolstra/flake-compat";
13 url = "github:edolstra/flake-compat";
helix-core/Cargo.toml+1−1
@@ -2,7 +2,7 @@
2name = "helix-core"
2name = "helix-core"
3version = "0.4.1"
3version = "0.4.1"
4authors = ["Blaž Hrastnik <blaz@mxxn.io>"]
4authors = ["Blaž Hrastnik <blaz@mxxn.io>"]
5−edition = "2018"
5+edition = "2021"
6license = "MPL-2.0"
6license = "MPL-2.0"
7description = "Helix editor core editing primitives"
7description = "Helix editor core editing primitives"
8categories = ["editor"]
8categories = ["editor"]
helix-lsp/Cargo.toml+1−1
@@ -2,7 +2,7 @@
2name = "helix-lsp"
2name = "helix-lsp"
3version = "0.4.1"
3version = "0.4.1"
4authors = ["Blaž Hrastnik <blaz@mxxn.io>"]
4authors = ["Blaž Hrastnik <blaz@mxxn.io>"]
5−edition = "2018"
5+edition = "2021"
6license = "MPL-2.0"
6license = "MPL-2.0"
7description = "LSP client implementation for Helix project"
7description = "LSP client implementation for Helix project"
8categories = ["editor"]
8categories = ["editor"]
helix-syntax/Cargo.toml+1−1
@@ -2,7 +2,7 @@
2name = "helix-syntax"
2name = "helix-syntax"
3version = "0.4.1"
3version = "0.4.1"
4authors = ["Blaž Hrastnik <blaz@mxxn.io>"]
4authors = ["Blaž Hrastnik <blaz@mxxn.io>"]
5−edition = "2018"
5+edition = "2021"
6license = "MPL-2.0"
6license = "MPL-2.0"
7description = "Tree-sitter grammars support"
7description = "Tree-sitter grammars support"
8categories = ["editor"]
8categories = ["editor"]
helix-term/Cargo.toml+1−1
@@ -3,7 +3,7 @@ name = "helix-term"
3version = "0.4.1"
3version = "0.4.1"
4description = "A post-modern text editor."
4description = "A post-modern text editor."
5authors = ["Blaž Hrastnik <blaz@mxxn.io>"]
5authors = ["Blaž Hrastnik <blaz@mxxn.io>"]
6−edition = "2018"
6+edition = "2021"
7license = "MPL-2.0"
7license = "MPL-2.0"
8categories = ["editor", "command-line-utilities"]
8categories = ["editor", "command-line-utilities"]
9repository = "https://github.com/helix-editor/helix"
9repository = "https://github.com/helix-editor/helix"
helix-term/src/ui/menu.rs+15−17
@@ -64,25 +64,23 @@ impl<T: Item> Menu<T> {
64 }
64 }
65
65
66 pub fn score(&mut self, pattern: &str) {
66 pub fn score(&mut self, pattern: &str) {
67− // need to borrow via pattern match otherwise it complains about simultaneous borrow
68− let Self {
69− ref mut matcher,
70− ref mut matches,
71− ref options,
72− ..
73− } = *self;
74−
75 // reuse the matches allocation
67 // reuse the matches allocation
76− matches.clear();
68+ self.matches.clear();
69+ self.matches.extend(
70+ self.options
71+ .iter()
72+ .enumerate()
77− matches.extend(options.iter().enumerate().filter_map(|(index, option)| {
73+ .filter_map(|(index, option)| {
78− let text = option.filter_text();
74+ let text = option.filter_text();
79− // TODO: using fuzzy_indices could give us the char idx for match highlighting
75+ // TODO: using fuzzy_indices could give us the char idx for match highlighting
80− matcher
76+ self.matcher
81− .fuzzy_match(text, pattern)
77+ .fuzzy_match(text, pattern)
82− .map(|score| (index, score))
78+ .map(|score| (index, score))
79+ }),
83− }));
80+ );
84 // matches.sort_unstable_by_key(|(_, score)| -score);
81 // matches.sort_unstable_by_key(|(_, score)| -score);
82+ self.matches
85− matches.sort_unstable_by_key(|(index, _score)| options[*index].sort_text());
83+ .sort_unstable_by_key(|(index, _score)| self.options[*index].sort_text());
86
84
87 // reset cursor position
85 // reset cursor position
88 self.cursor = None;
86 self.cursor = None;
helix-term/src/ui/picker.rs+7−16
@@ -233,37 +233,28 @@ impl<T> Picker<T> {
233 }
233 }
234
234
235 pub fn score(&mut self) {
235 pub fn score(&mut self) {
236− // need to borrow via pattern match otherwise it complains about simultaneous borrow
237− let Self {
238− ref mut matcher,
239− ref mut matches,
240− ref filters,
241− ref format_fn,
242− ..
243− } = *self;
244−
245 let pattern = &self.prompt.line;
236 let pattern = &self.prompt.line;
246
237
247 // reuse the matches allocation
238 // reuse the matches allocation
248− matches.clear();
239+ self.matches.clear();
249− matches.extend(
240+ self.matches.extend(
250 self.options
241 self.options
251 .iter()
242 .iter()
252 .enumerate()
243 .enumerate()
253 .filter_map(|(index, option)| {
244 .filter_map(|(index, option)| {
254 // filter options first before matching
245 // filter options first before matching
255− if !filters.is_empty() {
246+ if !self.filters.is_empty() {
256− filters.binary_search(&index).ok()?;
247+ self.filters.binary_search(&index).ok()?;
257 }
248 }
258 // TODO: maybe using format_fn isn't the best idea here
249 // TODO: maybe using format_fn isn't the best idea here
259− let text = (format_fn)(option);
250+ let text = (self.format_fn)(option);
260 // TODO: using fuzzy_indices could give us the char idx for match highlighting
251 // TODO: using fuzzy_indices could give us the char idx for match highlighting
261− matcher
252+ self.matcher
262 .fuzzy_match(&text, pattern)
253 .fuzzy_match(&text, pattern)
263 .map(|score| (index, score))
254 .map(|score| (index, score))
264 }),
255 }),
265 );
256 );
266− matches.sort_unstable_by_key(|(_, score)| -score);
257+ self.matches.sort_unstable_by_key(|(_, score)| -score);
267
258
268 // reset cursor position
259 // reset cursor position
269 self.cursor = 0;
260 self.cursor = 0;
helix-tui/Cargo.toml+1−1
@@ -5,7 +5,7 @@ authors = ["Blaž Hrastnik <blaz@mxxn.io>"]
5description = """
5description = """
6A library to build rich terminal user interfaces or dashboards
6A library to build rich terminal user interfaces or dashboards
7"""
7"""
8−edition = "2018"
8+edition = "2021"
9license = "MPL-2.0"
9license = "MPL-2.0"
10categories = ["editor"]
10categories = ["editor"]
11repository = "https://github.com/helix-editor/helix"
11repository = "https://github.com/helix-editor/helix"
helix-view/Cargo.toml+1−1
@@ -2,7 +2,7 @@
2name = "helix-view"
2name = "helix-view"
3version = "0.4.1"
3version = "0.4.1"
4authors = ["Blaž Hrastnik <blaz@mxxn.io>"]
4authors = ["Blaž Hrastnik <blaz@mxxn.io>"]
5−edition = "2018"
5+edition = "2021"
6license = "MPL-2.0"
6license = "MPL-2.0"
7description = "UI abstractions for use in backends"
7description = "UI abstractions for use in backends"
8categories = ["editor"]
8categories = ["editor"]
helix-view/src/theme.rs−1
@@ -1,6 +1,5 @@
1use std::{
1use std::{
2 collections::HashMap,
2 collections::HashMap,
3− convert::TryFrom,
4 path::{Path, PathBuf},
3 path::{Path, PathBuf},
5};
4};
6
5