From 75362dce8315c3fe20b9702d1ecdc0315112558e Mon Sep 17 00:00:00 2001 From: taupiqueur <93834534+taupiqueur@users.noreply.github.com> Date: Wed, 21 Sep 2022 20:51:48 +0200 Subject: [PATCH 01/25] =?UTF-8?q?Fix=20the=20picker=E2=80=99s=20keymap=20d?= =?UTF-8?q?ocumentation=20(#3925)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- book/src/keymap.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/src/keymap.md b/book/src/keymap.md index 99b0f0ba..6d90d802 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -381,9 +381,9 @@ Keys to use within picker. Remapping currently not supported. | Key | Description | | ----- | ------------- | -| `Tab`, `Up`, `Ctrl-p` | Previous entry | +| `Shift-Tab`, `Up`, `Ctrl-p` | Previous entry | +| `Tab`, `Down`, `Ctrl-n` | Next entry | | `PageUp`, `Ctrl-u` | Page up | -| `Shift-tab`, `Down`, `Ctrl-n`| Next entry | | `PageDown`, `Ctrl-d` | Page down | | `Home` | Go to first entry | | `End` | Go to last entry | From 1dd1476a9eea7f6cb7d66239782e032b3c8672aa Mon Sep 17 00:00:00 2001 From: gavincrawford <94875769+gavincrawford@users.noreply.github.com> Date: Wed, 21 Sep 2022 16:55:28 -0600 Subject: [PATCH 02/25] Fix highlighting on single-character Rust consts (#3927) Co-authored-by: Kirawi <67773714+kirawi@users.noreply.github.com> Co-authored-by: Gavin Crawford --- runtime/queries/rust/highlights.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm index 78a7abf0..7d0afcde 100644 --- a/runtime/queries/rust/highlights.scm +++ b/runtime/queries/rust/highlights.scm @@ -183,7 +183,7 @@ ; ------- ((identifier) @constant - (#match? @constant "^[A-Z][A-Z\\d_]+$")) + (#match? @constant "^[A-Z][A-Z\\d_]*$")) ; --- ; PascalCase identifiers in call_expressions (e.g. `Ok()`) From 6e168b5099c31d0681e3486d177a14d04dde4c20 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Wed, 21 Sep 2022 20:30:42 -0500 Subject: [PATCH 03/25] Improve keymap errors from command typos (#3931) * Improve keymap errors from command typos Currently, opening helix with a config containing a bad command mapping fails with a cryptic error. For example, say we have a config (bad.toml) with a command name that doesn't exist: [keys.normal] b = "buffer_close" # should be ":buffer-close" When we `hx -c bad.toml`, we get... > Bad config: data did not match any variant of untagged enum KeyTrie for key `keys.normal` at line 1 column 1 > Press to continue with default config This is because of the way that Serde tries to deserialize untagged enums such as `helix_term::keymap::KeyTrie`. From the Serde docs[^1]: > Serde will try to match the data against each variant in order and the > first one that deserializes successfully is the one returned. `MappableCommand::deserialize` fails (returns an Err variant) when a command does not exist. Serde interprets this as the `KeyTrie::Leaf` variant failing to match and declares that the input data doesn't "match any variant of untagged enum KeyTrie." Luckily the variants of KeyTrie are orthogonal in structure: we can tell them apart by the type hints from a `serde::de::Visitor`. This change uses a custom Deserialize implementation along with a Visitor that discerns which variant of the KeyTrie applies. With this change, the above failure becomes: > Bad config: No command named 'buffer_close' for key `keys.normal.b` at line 2 column 5 > Press to continue with default config We also provide more explicit information about the expectations on the field. A config with an unexpected type produces a message with that information and the expectation: [keys.normal] b = 1 > Bad config: invalid type: integer `1`, expected a command, list of commands, or sub-keymap for key `keys.normal.b` at line 2 column 5 > Press to continue with default config [^1]: https://serde.rs/enum-representations.html#untagged * Update helix-term/src/keymap.rs Co-authored-by: Ivan Tham Co-authored-by: Ivan Tham --- helix-term/src/keymap.rs | 60 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs index 59204889..088b3b6d 100644 --- a/helix-term/src/keymap.rs +++ b/helix-term/src/keymap.rs @@ -144,14 +144,70 @@ impl DerefMut for KeyTrieNode { } } -#[derive(Debug, Clone, PartialEq, Deserialize)] -#[serde(untagged)] +#[derive(Debug, Clone, PartialEq)] pub enum KeyTrie { Leaf(MappableCommand), Sequence(Vec), Node(KeyTrieNode), } +impl<'de> Deserialize<'de> for KeyTrie { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + deserializer.deserialize_any(KeyTrieVisitor) + } +} + +struct KeyTrieVisitor; + +impl<'de> serde::de::Visitor<'de> for KeyTrieVisitor { + type Value = KeyTrie; + + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(formatter, "a command, list of commands, or sub-keymap") + } + + fn visit_str(self, command: &str) -> Result + where + E: serde::de::Error, + { + command + .parse::() + .map(KeyTrie::Leaf) + .map_err(E::custom) + } + + fn visit_seq(self, mut seq: S) -> Result + where + S: serde::de::SeqAccess<'de>, + { + let mut commands = Vec::new(); + while let Some(command) = seq.next_element::<&str>()? { + commands.push( + command + .parse::() + .map_err(serde::de::Error::custom)?, + ) + } + Ok(KeyTrie::Sequence(commands)) + } + + fn visit_map(self, mut map: M) -> Result + where + M: serde::de::MapAccess<'de>, + { + let mut mapping = HashMap::new(); + let mut order = Vec::new(); + while let Some((key, value)) = map.next_entry::()? { + mapping.insert(key, value); + order.push(key); + } + Ok(KeyTrie::Node(KeyTrieNode::new("", mapping, order))) + } +} + impl KeyTrie { pub fn node(&self) -> Option<&KeyTrieNode> { match *self { From e621848d075c1751ab2be6f3a82ac67490ec7909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Thu, 22 Sep 2022 14:28:05 +0200 Subject: [PATCH 04/25] Theme: Papercolor: Tune inactive statusline (#3938) --- runtime/themes/papercolor-dark.toml | 2 +- runtime/themes/papercolor-light.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/themes/papercolor-dark.toml b/runtime/themes/papercolor-dark.toml index 20950469..18a47292 100644 --- a/runtime/themes/papercolor-dark.toml +++ b/runtime/themes/papercolor-dark.toml @@ -10,7 +10,7 @@ "ui.statusline" = {bg="paper_bar_bg", fg="regular0"} "ui.statusline.select" = {bg="background", fg="bright7"} "ui.statusline.normal" = {bg="background", fg="bright3"} -"ui.statusline.inactive" = {bg="background", fg="bright0"} +"ui.statusline.inactive" = {bg="selection_foreground", fg="foreground"} "ui.virtual.whitespace" = { fg = "regular5" } "ui.virtual.ruler" = {bg="cursorline_background"} "ui.cursor.match" = {bg = "regular5", fg = "regular0"} diff --git a/runtime/themes/papercolor-light.toml b/runtime/themes/papercolor-light.toml index dc4d7df5..70b973d3 100644 --- a/runtime/themes/papercolor-light.toml +++ b/runtime/themes/papercolor-light.toml @@ -10,7 +10,7 @@ "ui.statusline" = {bg="paper_bar_bg", fg="regular0"} "ui.statusline.select" = {bg="background", fg="bright7"} "ui.statusline.normal" = {bg="background", fg="bright3"} -"ui.statusline.inactive" = {bg="background", fg="bright0"} +"ui.statusline.inactive" = {bg="bright0", fg="foreground"} "ui.virtual" = "indent" "ui.virtual.whitespace" = { fg = "regular5" } "ui.virtual.ruler" = {bg="cursorline_background"} From eb6fd283dcf041ecf822fd8f2d4520abb2a26df9 Mon Sep 17 00:00:00 2001 From: A-Walrus <58790821+A-Walrus@users.noreply.github.com> Date: Thu, 22 Sep 2022 18:33:30 +0300 Subject: [PATCH 05/25] Deduplicate regexes in search_selection command (#3941) --- helix-term/src/commands.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index e869446e..a5203352 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1760,6 +1760,8 @@ fn search_selection(cx: &mut Context) { .selection(view.id) .iter() .map(|selection| regex::escape(&selection.fragment(contents))) + .collect::>() // Collect into hashset to deduplicate identical regexes + .into_iter() .collect::>() .join("|"); From 4133f1f424c6a9da71cab65dc9541e6d941ec603 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Fri, 23 Sep 2022 08:58:00 +0200 Subject: [PATCH 06/25] Document MSRV policy (#3913) --- .github/workflows/msrv-rust-toolchain.toml | 2 +- Cargo.lock | 7 ------- docs/CONTRIBUTING.md | 6 ++++++ helix-term/Cargo.toml | 3 --- helix-term/src/ui/picker.rs | 4 ---- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/msrv-rust-toolchain.toml b/.github/workflows/msrv-rust-toolchain.toml index 7a3ec50b..b169d31e 100644 --- a/.github/workflows/msrv-rust-toolchain.toml +++ b/.github/workflows/msrv-rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.59.0" +channel = "1.61.0" components = ["rustfmt", "rust-src"] diff --git a/Cargo.lock b/Cargo.lock index a26c92e4..cc9e69b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -485,7 +485,6 @@ dependencies = [ "log", "once_cell", "pulldown-cmark", - "retain_mut", "serde", "serde_json", "signal-hook", @@ -884,12 +883,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "retain_mut" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" - [[package]] name = "ropey" version = "1.5.0" diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index e7b39b06..353cb4fd 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -37,6 +37,12 @@ contributors are strongly encouraged to write integration tests for their code. Existing tests can be used as examples. Helpers can be found in [helpers.rs][helpers.rs] +## Minimum Stable Rust Version (MSRV) Policy + +Helix follows the MSRV of Firefox. +The current MSRV and future changes to the MSRV are listed in the [Firefox documentation]. + +[Firefox documentation]: https://firefox-source-docs.mozilla.org/writing-rust-code/update-policy.html [good-first-issue]: https://github.com/helix-editor/helix/labels/E-easy [log-file]: https://github.com/helix-editor/helix/wiki/FAQ#access-the-log-file [architecture.md]: ./architecture.md diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index 0ebcb24f..b36063e4 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -67,9 +67,6 @@ serde = { version = "1.0", features = ["derive"] } grep-regex = "0.1.10" grep-searcher = "0.1.10" -# Remove once retain_mut lands in stable rust -retain_mut = "0.1.7" - [target.'cfg(not(windows))'.dependencies] # https://github.com/vorner/signal-hook/issues/100 signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] } diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 24d3b288..d125a6aa 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -365,10 +365,6 @@ impl Picker { .map(|(index, _option)| (index, 0)), ); } else if pattern.starts_with(&self.previous_pattern) { - // TODO: remove when retain_mut is in stable rust - #[allow(unused_imports, deprecated)] - use retain_mut::RetainMut; - // optimization: if the pattern is a more specific version of the previous one // then we can score the filtered set. #[allow(unstable_name_collisions)] From 888f4fef6f975412c8215c4b76871ffba6e1b41d Mon Sep 17 00:00:00 2001 From: Riccardo Binetti Date: Fri, 23 Sep 2022 10:04:07 +0200 Subject: [PATCH 07/25] Split helix_core::find_root and helix_loader::find_local_config_dirs (#3929) * Split helix_core::find_root and helix_loader::find_local_config_dirs The documentation of find_root described the following priority for detecting a project root: - Top-most folder containing a root marker in current git repository - Git repository root if no marker detected - Top-most folder containing a root marker if not git repository detected - Current working directory as fallback The commit contained in https://github.com/helix-editor/helix/pull/1249 extracted and changed the implementation of find_root in find_root_impl, actually reversing its result order (since that is the order that made sense for the local configuration merge, from innermost to outermost ancestors). Since the two uses of find_root_impl have different requirements (and it's not a matter of reversing the order of results since, e.g., the top repository dir should be used by find_root only if there's not marker in other dirs), this PR splits the two implementations in two different specialized functions. In doing so, find_root_impl is removed and the implementation is moved back in find_root, moving it closer to the documented behaviour thus making it easier to verify it's actually correct * helix-core: remove Option from find_root return type It always returns some result, so Option is not needed --- helix-core/src/lib.rs | 40 ++++++++++++++++++++++++++++++++++---- helix-loader/src/lib.rs | 26 +++++-------------------- helix-lsp/src/client.rs | 11 +++-------- helix-term/src/commands.rs | 5 +++-- 4 files changed, 47 insertions(+), 35 deletions(-) diff --git a/helix-core/src/lib.rs b/helix-core/src/lib.rs index 735a62c1..8f869e35 100644 --- a/helix-core/src/lib.rs +++ b/helix-core/src/lib.rs @@ -46,10 +46,42 @@ pub fn find_first_non_whitespace_char(line: RopeSlice) -> Option { /// * Git repository root if no marker detected /// * Top-most folder containing a root marker if not git repository detected /// * Current working directory as fallback -pub fn find_root(root: Option<&str>, root_markers: &[String]) -> Option { - helix_loader::find_root_impl(root, root_markers) - .first() - .cloned() +pub fn find_root(root: Option<&str>, root_markers: &[String]) -> std::path::PathBuf { + let current_dir = std::env::current_dir().expect("unable to determine current directory"); + + let root = match root { + Some(root) => { + let root = std::path::Path::new(root); + if root.is_absolute() { + root.to_path_buf() + } else { + current_dir.join(root) + } + } + None => current_dir.clone(), + }; + + let mut top_marker = None; + for ancestor in root.ancestors() { + if root_markers + .iter() + .any(|marker| ancestor.join(marker).exists()) + { + top_marker = Some(ancestor); + } + + if ancestor.join(".git").is_dir() { + // Top marker is repo root if not root marker was detected yet + if top_marker.is_none() { + top_marker = Some(ancestor); + } + // Don't go higher than repo if we're in one + break; + } + } + + // Return the found top marker or the current_dir as fallback + top_marker.map_or(current_dir, |a| a.to_path_buf()) } pub use ropey::{str_utils, Rope, RopeBuilder, RopeSlice}; diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs index 3c9905f5..a02a59af 100644 --- a/helix-loader/src/lib.rs +++ b/helix-loader/src/lib.rs @@ -59,7 +59,7 @@ pub fn config_dir() -> PathBuf { } pub fn local_config_dirs() -> Vec { - let directories = find_root_impl(None, &[".helix".to_string()]) + let directories = find_local_config_dirs() .into_iter() .map(|path| path.join(".helix")) .collect(); @@ -90,32 +90,16 @@ pub fn log_file() -> PathBuf { cache_dir().join("helix.log") } -pub fn find_root_impl(root: Option<&str>, root_markers: &[String]) -> Vec { +pub fn find_local_config_dirs() -> Vec { let current_dir = std::env::current_dir().expect("unable to determine current directory"); let mut directories = Vec::new(); - let root = match root { - Some(root) => { - let root = std::path::Path::new(root); - if root.is_absolute() { - root.to_path_buf() - } else { - current_dir.join(root) - } - } - None => current_dir, - }; - - for ancestor in root.ancestors() { - // don't go higher than repo + for ancestor in current_dir.ancestors() { if ancestor.join(".git").is_dir() { - // Use workspace if detected from marker directories.push(ancestor.to_path_buf()); + // Don't go higher than repo if we're in one break; - } else if root_markers - .iter() - .any(|marker| ancestor.join(marker).exists()) - { + } else if ancestor.join(".helix").is_dir() { directories.push(ancestor.to_path_buf()); } } diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs index 9ae8f20e..497ce80c 100644 --- a/helix-lsp/src/client.rs +++ b/helix-lsp/src/client.rs @@ -34,7 +34,7 @@ pub struct Client { pub(crate) capabilities: OnceCell, offset_encoding: OffsetEncoding, config: Option, - root_path: Option, + root_path: std::path::PathBuf, root_uri: Option, workspace_folders: Vec, req_timeout: u64, @@ -74,9 +74,7 @@ impl Client { let root_path = find_root(None, root_markers); - let root_uri = root_path - .clone() - .and_then(|root| lsp::Url::from_file_path(root).ok()); + let root_uri = lsp::Url::from_file_path(root_path.clone()).ok(); // TODO: support multiple workspace folders let workspace_folders = root_uri @@ -281,10 +279,7 @@ impl Client { workspace_folders: Some(self.workspace_folders.clone()), // root_path is obsolete, but some clients like pyright still use it so we specify both. // clients will prefer _uri if possible - root_path: self - .root_path - .clone() - .and_then(|path| path.to_str().map(|path| path.to_owned())), + root_path: self.root_path.to_str().map(|path| path.to_owned()), root_uri: self.root_uri.clone(), initialization_options: self.config.clone(), capabilities: lsp::ClientCapabilities { diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index a5203352..c87ad0ca 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2225,8 +2225,9 @@ fn append_mode(cx: &mut Context) { } fn file_picker(cx: &mut Context) { - // We don't specify language markers, root will be the root of the current git repo - let root = find_root(None, &[]).unwrap_or_else(|| PathBuf::from("./")); + // We don't specify language markers, root will be the root of the current + // git repo or the current dir if we're not in a repo + let root = find_root(None, &[]); let picker = ui::file_picker(root, &cx.editor.config()); cx.push_layer(Box::new(overlayed(picker))); } From 3a245fe7928befaf9636604ef72d058e63ab35fc Mon Sep 17 00:00:00 2001 From: Riccardo Binetti Date: Fri, 23 Sep 2022 18:40:16 +0200 Subject: [PATCH 08/25] Add mix.exs and mix.lock as Elixir root markers (#3917) --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 949dd372..133b87ae 100644 --- a/languages.toml +++ b/languages.toml @@ -99,7 +99,7 @@ scope = "source.elixir" injection-regex = "(elixir|ex)" file-types = ["ex", "exs", "mix.lock"] shebangs = ["elixir"] -roots = [] +roots = ["mix.exs", "mix.lock"] comment-token = "#" language-server = { command = "elixir-ls" } config = { elixirLS.dialyzerEnabled = false } From 0d8d8a4ed60aac72e0d294717f71bec17a2a2f07 Mon Sep 17 00:00:00 2001 From: adrian5 Date: Fri, 23 Sep 2022 19:01:41 +0200 Subject: [PATCH 09/25] docs: Punctuation on tutor (#3888) --- runtime/tutor | 58 +++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/runtime/tutor b/runtime/tutor index dc0a345a..313a14a1 100644 --- a/runtime/tutor +++ b/runtime/tutor @@ -70,7 +70,7 @@ _________________________________________________________________ Type the d key to delete the character under the cursor. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Move the cursor to each extra character, and type d to delete it. @@ -92,7 +92,7 @@ _________________________________________________________________ Type the i key to enter Insert mode. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Move to a place in the line which is missing text and type i to enter Insert mode. Keys you type will now type text. 3. Enter the missing text. @@ -166,7 +166,7 @@ _________________________________________________________________ I - Insert at the start of the line. A - Insert at the end of the line. - 1. Move to anywhere in the line below marked -->. + 1. Move to anywhere in the line marked '-->' below. 2. Type A ( + a), your cursor will move to the end of the line and you will be able to type. 3. Type the text necessary to match the line below. @@ -181,7 +181,7 @@ _________________________________________________________________ Type o to add a newline and insert below the cursor. Type O to add a newline and insert above the cursor. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Type o to open a line below and type your answer. --> What is the best editor? @@ -228,7 +228,7 @@ _________________________________________________________________ it deletes all selected text. Your cursor is like a single-character selection. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Move to the beginning of a word that needs to be deleted. 3. Type w to select until the beginning of the next word. 4. Type d to delete the selection. @@ -271,7 +271,7 @@ _________________________________________________________________ The change command deletes the current selection and enters Insert mode, so it is a very common shorthand for di. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Move to the start of an incorrect word and type w to select it. 3. Type c to delete the word and enter Insert mode. @@ -290,7 +290,7 @@ _________________________________________________________________ Type a number before a motion to repeat it that many times. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Type 2w to move 2 words forward. 3. Type 3e to move to the end of the third word forward. 4. Type 2b to move 2 words backwards @@ -315,7 +315,7 @@ _________________________________________________________________ In Select mode every movement will extend the selection, as opposed to replacing it. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Move to the F of FOO and type v2w to select the two words. 3. Type d to remove the two words. Notice d returns you to Normal mode. @@ -334,7 +334,7 @@ _________________________________________________________________ Type x to select a whole line. Type x again to select the next. - 1. Move the cursor to the second line below marked -->. + 1. Move the cursor to the second line marked '-->' below. 2. Type x to select the line, and d to delete it. 3. Move to the fourth line. 4. Type x twice or type 2x to select 2 lines, and d to delete. @@ -359,7 +359,7 @@ _________________________________________________________________ Sometimes, you want to deselect without having to move the cursor(s). This can be done using the ; key. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Use the motions you have learned to move around the line, and try using ; to deselect the text after it is selected by the motions. @@ -400,7 +400,7 @@ _________________________________________________________________ Type u to undo. Type U to redo. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Move to the first error, and type d to delete it. 3. Type u to undo your deletion. 4. Fix all the errors on the line. @@ -424,7 +424,7 @@ _________________________________________________________________ Type p to paste the yanked selection after the cursor. Type P to paste the yanked text before the cursor. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. Make sure your cursor is on the "b" of banana. 2. Type w to select "banana" and y to yank it. 3. Move to the space between "2" and "3" and type p to paste. @@ -488,7 +488,7 @@ _________________________________________________________________ Type C to duplicate the cursor to the next suitable line. - 1. Move the cursor to the first line below marked -->. + 1. Move the cursor to the first line marked '-->' below. 2. Type C to duplicate the cursor to the next suitable line. Notice how it skips the line in the middle. Keys you type will now affect both cursors. @@ -510,7 +510,7 @@ _________________________________________________________________ Type s to select matches in the selection. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Type x to select the line. 3. Type s. A prompt will appear. 4. Type 'apples' and type . Both occurrences of @@ -533,7 +533,7 @@ _________________________________________________________________ The select command selects regular expressions, not just exact matches, allowing you to target more complex patterns. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Select the line with x and then type s. 3. Enter ' +' to select any amount of consecutive spaces >1. 4. Type c and change the matches to single spaces. @@ -554,7 +554,7 @@ _________________________________________________________________ Type & to align the contents of the selections. - 1. Move the cursor to the first line below marked -->. Place + 1. Move the cursor to the first line marked '-->' below. Place the cursor on the whitespace just after the arrow. 2. Type C four times or 4C. 3. Type W to select the numbers and brackets. @@ -622,7 +622,7 @@ _________________________________________________________________ Type t to do the same, but not including (till) a character. Type uppercase F / T to do the same backwards. - 1. Move the cursor to the line below marked -->. Place the + 1. Move the cursor to the line marked '-->' below. Place the cursor on the first dash. 2. Type f[ to select to the square bracket. 3. Type d to delete your selection. @@ -633,7 +633,7 @@ _________________________________________________________________ --> -----[Free this sentence of its brackets!]----- --> ------Free this sentence of its dashes!------ - Note: Unlike Vim, Helix doesn't limit these commands to the + Note: Unlike Vim, Helix doesn't limit these commands to the current line. It searches for the character in the file. ================================================================= @@ -665,7 +665,7 @@ _________________________________________________________________ Type . to repeat the last insert command. Type A-. to repeat the last f / t selection. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Make a change, insertion or appendage and repeat it with . . 3. Try using A-. with f and t, to select multiple sentences for instance. @@ -708,7 +708,7 @@ _________________________________________________________________ Type R to replace the selection with previously yanked text. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Type w to select "watermelons" and then y to yank it. 3. Select "oranges" with w. 4. Type R to replace "oranges" with "watermelons" @@ -730,7 +730,7 @@ _________________________________________________________________ Type J to join together lines in selection. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Type x four times or 4x to select all four lines. 3. Type J to join the lines together. @@ -752,7 +752,7 @@ lines. Type > to indent a line and < to outdent it. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Move down to the second line and type > to indent it. 3. Move to the third line and type < to outdent it. @@ -775,7 +775,7 @@ lines. Type C-a to increment the number under selection. Type C-x to decrement the number under selection. - 1. Move the cursor to the third line below marked -->. + 1. Move the cursor to the third line marked '-->' below. 2. Type C-a to increment the second point marked 2. 3. Repeat for the point marked 3. 4. Move to the last point and type C-x to decrement the 6. @@ -823,7 +823,7 @@ lines. Type " to select register . - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Type w to select "watermelons" and yank with y. 3. Type w to select "bananas". 4. Change to register b with "b and yank with y. @@ -844,7 +844,7 @@ lines. the bottom of your screen. Type Q again to stop recording. Type q to repeat the macro from register @ (the default). - 1. Move the cursor to the first line below marked -->. + 1. Move the cursor to the first line marked '-->' below. Ensure your cursor is on the > of the arrow. 2. Type Q to start recording. 3. Edit the line to look like the bottom one. @@ -889,7 +889,7 @@ lines. Type * to copy the primary selection into register /, setting the search term to the selection. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Select "horse" with e and type *. 3. Use n and N to jump between the instances of "horse". @@ -908,7 +908,7 @@ lines. of moving the selection to the next match, it adds a new selection on each match. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Select the first "bat" and type * to set it to search. 3. Type v to enter select mode. 4. Type n to select the other "bat". @@ -975,7 +975,7 @@ lines. Type A-, to remove the primary selection. - 1. Move the cursor to the line below marked -->. + 1. Move the cursor to the line marked '-->' below. 2. Select both lines with xx or 2x. 3. Type s to select, type "would" and enter. 4. Use ( and ) to cycle the primary selection and remove the @@ -996,7 +996,7 @@ lines. Type ` to set all selected letters to lowercase. Type Alt-` to set all selected letters to uppercase. - 1. Move the cursor to the first line below marked -->. + 1. Move the cursor to the first line marked '-->' below. 2. Select each wrongly capitalised or lowercase letter and type ~ over them. 3. Move to the second line marked -->. From 42e30e7afaead4fc10a155802e168d2acc0afe81 Mon Sep 17 00:00:00 2001 From: Invader Zim <85027668+zim0369@users.noreply.github.com> Date: Sat, 24 Sep 2022 01:02:37 +0530 Subject: [PATCH 10/25] Add bufferline colors to 15 themes (#3881) Themes: * acme * ayu_dark * ayu_light * ayu_mirage * base16_default_dark * base16_default_light * bogster * catppuccin_frappe * catppuccin_latte * catppuccin_macchiato * catppuccin_mocha * darcula * dark_plus * doom_acario_dark * emacs --- runtime/themes/acme.toml | 2 ++ runtime/themes/ayu_dark.toml | 2 ++ runtime/themes/ayu_light.toml | 3 +++ runtime/themes/ayu_mirage.toml | 2 ++ runtime/themes/base16_default_dark.toml | 3 +++ runtime/themes/base16_default_light.toml | 3 +++ runtime/themes/bogster.toml | 2 ++ runtime/themes/catppuccin_frappe.toml | 5 ++++- runtime/themes/catppuccin_latte.toml | 6 +++++- runtime/themes/catppuccin_macchiato.toml | 5 ++++- runtime/themes/catppuccin_mocha.toml | 5 ++++- runtime/themes/darcula.toml | 2 ++ runtime/themes/dark_plus.toml | 4 ++++ runtime/themes/doom_acario_dark.toml | 3 +++ runtime/themes/emacs.toml | 3 +++ 15 files changed, 46 insertions(+), 4 deletions(-) diff --git a/runtime/themes/acme.toml b/runtime/themes/acme.toml index 3bd5987a..d3be695c 100644 --- a/runtime/themes/acme.toml +++ b/runtime/themes/acme.toml @@ -20,6 +20,8 @@ "diagnostic.error" = {bg="white", modifiers=["bold"]} "diagnostic.warning" = {bg="white", modifiers=["bold"]} "diagnostic.hint" = {bg="white", modifiers=["bold"]} +"ui.bufferline" = { fg = "indent", bg = "acme_bar_bg" } +"ui.bufferline.active" = { fg = "black", bg = "acme_bg" } [palette] white = "#ffffff" diff --git a/runtime/themes/ayu_dark.toml b/runtime/themes/ayu_dark.toml index f6dc1c81..43fffee8 100644 --- a/runtime/themes/ayu_dark.toml +++ b/runtime/themes/ayu_dark.toml @@ -59,6 +59,8 @@ "diagnostic.info"= { fg = "blue", modifiers = ["underlined"] } "diagnostic.warning"= { fg = "yellow", modifiers = ["underlined"] } "diagnostic.error"= { fg = "red", modifiers = ["underlined"] } +"ui.bufferline" = { fg = "gray", bg = "background" } +"ui.bufferline.active" = { fg = "foreground", bg = "dark_gray" } "special" = { fg = "orange" } diff --git a/runtime/themes/ayu_light.toml b/runtime/themes/ayu_light.toml index 3a543f5f..7ea4ef58 100644 --- a/runtime/themes/ayu_light.toml +++ b/runtime/themes/ayu_light.toml @@ -59,6 +59,8 @@ "diagnostic.info"= { fg = "blue", modifiers = ["underlined"] } "diagnostic.warning"= { fg = "yellow", modifiers = ["underlined"] } "diagnostic.error"= { fg = "red", modifiers = ["underlined"] } +"ui.bufferline" = { fg = "gray", bg = "dark_gray" } +"ui.bufferline.active" = { fg = "dark", bg = "background" } "special" = { fg = "orange" } @@ -76,3 +78,4 @@ magenta = "#a37acc" orange = "#fa8d3e" red = "#f07171" yellow = "#ffaa33" +dark = "#131721" diff --git a/runtime/themes/ayu_mirage.toml b/runtime/themes/ayu_mirage.toml index d6c9410d..f3b49d87 100644 --- a/runtime/themes/ayu_mirage.toml +++ b/runtime/themes/ayu_mirage.toml @@ -59,6 +59,8 @@ "diagnostic.info"= { fg = "blue", modifiers = ["underlined"] } "diagnostic.warning"= { fg = "yellow", modifiers = ["underlined"] } "diagnostic.error"= { fg = "red", modifiers = ["underlined"] } +"ui.bufferline" = { fg = "gray", bg = "black" } +"ui.bufferline.active" = { fg = "foreground", bg = "background" } "special" = { fg = "orange" } diff --git a/runtime/themes/base16_default_dark.toml b/runtime/themes/base16_default_dark.toml index 460e7363..74bbcd2e 100644 --- a/runtime/themes/base16_default_dark.toml +++ b/runtime/themes/base16_default_dark.toml @@ -54,6 +54,9 @@ "warning" = "base09" "error" = "base08" +"ui.bufferline" = { fg = "base04", bg = "base00" } +"ui.bufferline.active" = { fg = "base06", bg = "base01" } + [palette] base00 = "#181818" # Default Background base01 = "#282828" # Lighter Background (Used for status bars, line number and folding marks) diff --git a/runtime/themes/base16_default_light.toml b/runtime/themes/base16_default_light.toml index 6874c39e..3784670f 100644 --- a/runtime/themes/base16_default_light.toml +++ b/runtime/themes/base16_default_light.toml @@ -54,6 +54,9 @@ "warning" = "base09" "error" = "base08" +"ui.bufferline" = { fg = "base04", bg = "base01" } +"ui.bufferline.active" = { fg = "base07", bg = "base00" } + [palette] base00 = "#f8f8f8" # Default Background base01 = "#e8e8e8" # Lighter Background (Used for status bars, line number and folding marks) diff --git a/runtime/themes/bogster.toml b/runtime/themes/bogster.toml index 44bbaf92..c1902b9b 100644 --- a/runtime/themes/bogster.toml +++ b/runtime/themes/bogster.toml @@ -48,6 +48,8 @@ "ui.cursorline" = { bg = "#131920" } "ui.statusline" = { fg = "#e5ded6", bg = "#232d38" } "ui.statusline.inactive" = { fg = "#c6b8ad", bg = "#232d38" } +"ui.bufferline" = { fg = "#627d9d", bg = "#131920" } +"ui.bufferline.active" = { fg = "#e5ded6", bg = "#232d38" } "ui.popup" = { bg = "#232d38" } "ui.window" = { bg = "#232d38" } "ui.help" = { bg = "#232d38", fg = "#e5ded6" } diff --git a/runtime/themes/catppuccin_frappe.toml b/runtime/themes/catppuccin_frappe.toml index e7db8b16..89ae77c8 100644 --- a/runtime/themes/catppuccin_frappe.toml +++ b/runtime/themes/catppuccin_frappe.toml @@ -70,6 +70,9 @@ "ui.statusline.insert" = { fg = "surface0", bg = "green", modifiers = ["bold"] } "ui.statusline.select" = { fg = "surface0", bg = "flamingo", modifiers = ["bold"] } +"ui.bufferline" = { fg = "subtext1", bg = "mantle" } +"ui.bufferline.active" = { fg = "text", bg = "surface0", modifiers = ["bold"] } + "ui.popup" = { fg = "text", bg = "surface0" } "ui.window" = { fg = "crust" } "ui.help" = { fg = "overlay2", bg = "surface0" } @@ -134,4 +137,4 @@ crust = "#232634" # derived colors by blending existing palette colors cursorline = "#3b3f52" -secondary_cursor = "#b8a5a6" \ No newline at end of file +secondary_cursor = "#b8a5a6" diff --git a/runtime/themes/catppuccin_latte.toml b/runtime/themes/catppuccin_latte.toml index 4cd8b3c1..8e8780f9 100644 --- a/runtime/themes/catppuccin_latte.toml +++ b/runtime/themes/catppuccin_latte.toml @@ -70,6 +70,10 @@ "ui.statusline.insert" = { fg = "surface0", bg = "green", modifiers = ["bold"] } "ui.statusline.select" = { fg = "surface0", bg = "flamingo", modifiers = ["bold"] } +"ui.bufferline" = { fg = "overlay2", bg = "surface1", modifiers = ["italic"] } +"ui.bufferline.active" = { fg = "text", bg = "surface0", modifiers = ["bold"] } +"ui.bufferline.background" = { bg = "surface1" } + "ui.popup" = { fg = "text", bg = "surface0" } "ui.window" = { fg = "crust" } "ui.help" = { fg = "overlay2", bg = "surface0" } @@ -134,4 +138,4 @@ crust = "#dce0e8" # derived colors by blending existing palette colors cursorline = "#e9ebf1" -secondary_cursor = "#e2a99e" \ No newline at end of file +secondary_cursor = "#e2a99e" diff --git a/runtime/themes/catppuccin_macchiato.toml b/runtime/themes/catppuccin_macchiato.toml index da589101..c2fe3184 100644 --- a/runtime/themes/catppuccin_macchiato.toml +++ b/runtime/themes/catppuccin_macchiato.toml @@ -70,6 +70,9 @@ "ui.statusline.insert" = { fg = "surface0", bg = "green", modifiers = ["bold"] } "ui.statusline.select" = { fg = "surface0", bg = "flamingo", modifiers = ["bold"] } +"ui.bufferline.active" = { fg = "text", bg = "base", modifiers = ["bold"] } +"ui.bufferline" = { fg = "overlay1", bg = "mantle" } + "ui.popup" = { fg = "text", bg = "surface0" } "ui.window" = { fg = "crust" } "ui.help" = { fg = "overlay2", bg = "surface0" } @@ -134,4 +137,4 @@ crust = "#181926" # derived colors by blending existing palette colors cursorline = "#303347" -secondary_cursor = "#b6a5a7" \ No newline at end of file +secondary_cursor = "#b6a5a7" diff --git a/runtime/themes/catppuccin_mocha.toml b/runtime/themes/catppuccin_mocha.toml index 279859b2..c4750b28 100644 --- a/runtime/themes/catppuccin_mocha.toml +++ b/runtime/themes/catppuccin_mocha.toml @@ -70,6 +70,9 @@ "ui.statusline.insert" = { fg = "surface0", bg = "green", modifiers = ["bold"] } "ui.statusline.select" = { fg = "surface0", bg = "flamingo", modifiers = ["bold"] } +"ui.bufferline.active" = { fg = "text", bg = "base", modifiers = ["bold"] } +"ui.bufferline" = { fg = "overlay1", bg = "mantle" } + "ui.popup" = { fg = "text", bg = "surface0" } "ui.window" = { fg = "crust" } "ui.help" = { fg = "overlay2", bg = "surface0" } @@ -134,4 +137,4 @@ crust = "#11111b" # derived colors by blending existing palette colors cursorline = "#2a2b3c" -secondary_cursor = "#b5a6a8" \ No newline at end of file +secondary_cursor = "#b5a6a8" diff --git a/runtime/themes/darcula.toml b/runtime/themes/darcula.toml index 00176ff2..5e88438e 100644 --- a/runtime/themes/darcula.toml +++ b/runtime/themes/darcula.toml @@ -23,6 +23,8 @@ "ui.virtual.ruler" = { bg = "grey02" } "ui.virtual.indent-guide" = "grey02" "ui.virtual.whitespace" = "grey03" +"ui.bufferline" = { fg = "grey04", bg = "grey00" } +"ui.bufferline.active" = { fg = "grey07", bg = "grey02" } "operator" = "grey05" "variable" = "white" diff --git a/runtime/themes/dark_plus.toml b/runtime/themes/dark_plus.toml index 29a55281..f99da4fb 100644 --- a/runtime/themes/dark_plus.toml +++ b/runtime/themes/dark_plus.toml @@ -76,6 +76,10 @@ "ui.statusline" = { fg = "white", bg = "blue" } "ui.statusline.inactive" = { fg = "white", bg = "blue" } +"ui.bufferline" = { fg = "text", bg = "widget" } +"ui.bufferline.active" = { fg = "white", bg = "blue" } +"ui.bufferline.background" = { bg = "background" } + "ui.text" = { fg = "text" } "ui.text.focus" = { fg = "white" } diff --git a/runtime/themes/doom_acario_dark.toml b/runtime/themes/doom_acario_dark.toml index 4ff90476..c38c93ee 100644 --- a/runtime/themes/doom_acario_dark.toml +++ b/runtime/themes/doom_acario_dark.toml @@ -53,6 +53,9 @@ 'ui.statusline.normal' = { bg = 'base3' } 'ui.statusline.insert' = { bg = 'base3' } 'ui.statusline.select' = { bg = 'base3' } +'ui.bufferline' = { fg = 'gray', bg = 'base2' } +'ui.bufferline.active' = { fg = 'white', bg = 'base4' } +'ui.bufferline.background' = { bg = 'bg' } 'ui.popup' = { bg = 'bg-alt' } 'ui.window' = { fg = 'gray' } 'ui.help' = { fg = 'fg', bg = 'base2' } diff --git a/runtime/themes/emacs.toml b/runtime/themes/emacs.toml index 598020bd..cc725df8 100644 --- a/runtime/themes/emacs.toml +++ b/runtime/themes/emacs.toml @@ -54,6 +54,9 @@ "ui.linenr.selected" = { fg = "gray80" } "ui.statusline" = { fg = "black", bg = "gray75" } "ui.statusline.inactive" = { fg = "gray20", bg = "gray90" } +"ui.bufferline" = { fg = "gray36", bg = "gray90", modifiers = ["underlined"] } +"ui.bufferline.active" = { fg = "gray0", bg = "gray99" } +"ui.bufferline.background" = { bg = "gray75" } "ui.popup" = { fg = "black", bg = "gray97" } "ui.popup.info" = { fg = "black", bg = "gray97" } "ui.window" = { fg = "black" } From 1a4a9b86d74eade2a8df4ae68d97433323f22fac Mon Sep 17 00:00:00 2001 From: Clay Date: Sat, 24 Sep 2022 23:51:25 -0700 Subject: [PATCH 11/25] heex: upgrade grammar, add roots matching elixir (#3959) --- languages.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/languages.toml b/languages.toml index 133b87ae..a7b8f93d 100644 --- a/languages.toml +++ b/languages.toml @@ -1287,7 +1287,7 @@ name = "eex" scope = "source.eex" injection-regex = "eex" file-types = ["eex"] -roots = [] +roots = ["mix.exs", "mix.lock"] indent = { tab-width = 2, unit = " " } [[grammar]] @@ -1299,12 +1299,12 @@ name = "heex" scope = "source.heex" injection-regex = "heex" file-types = ["heex"] -roots = [] +roots = ["mix.exs", "mix.lock"] indent = { tab-width = 2, unit = " " } [[grammar]] name = "heex" -source = { git = "https://github.com/phoenixframework/tree-sitter-heex", rev = "961bc4d2937cfd24ceb0a5a6b2da607809f8822e" } +source = { git = "https://github.com/phoenixframework/tree-sitter-heex", rev = "881f1c805f51485a26ecd7865d15c9ef8d606a78" } [[language]] name = "sql" From e8f0886b21d279fedce53d85f53bb537c1ad808e Mon Sep 17 00:00:00 2001 From: Poliorcetics Date: Sun, 25 Sep 2022 15:12:33 +0200 Subject: [PATCH 12/25] chore: remove unneeded attribute after MSRV bump to 1.61 (#3961) --- helix-term/src/ui/picker.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index d125a6aa..a56455d7 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -367,7 +367,6 @@ impl Picker { } else if pattern.starts_with(&self.previous_pattern) { // optimization: if the pattern is a more specific version of the previous one // then we can score the filtered set. - #[allow(unstable_name_collisions)] self.matches.retain_mut(|(index, score)| { let option = &self.options[*index]; let text = option.sort_text(&self.editor_data); From c196a90684d8b798aa90c60c3777f316966757b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20K=C3=B6=C3=B6k?= Date: Mon, 26 Sep 2022 15:56:07 +0300 Subject: [PATCH 13/25] Add documentation for `max-line-length` (#3974) --- book/src/languages.md | 1 + 1 file changed, 1 insertion(+) diff --git a/book/src/languages.md b/book/src/languages.md index 841b1377..73c81213 100644 --- a/book/src/languages.md +++ b/book/src/languages.md @@ -61,6 +61,7 @@ These configuration keys are available: | `config` | Language Server configuration | | `grammar` | The tree-sitter grammar to use (defaults to the value of `name`) | | `formatter` | The formatter for the language, it will take precedence over the lsp when defined. The formatter must be able to take the original file as input from stdin and write the formatted file to stdout | +| `max-line-length` | Maximum line length. Used for the `:reflow` command | ### Language Server configuration From 98dd9c4f2bf71e9afb72f61af9d45100fda0526e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20K=C3=B6=C3=B6k?= Date: Mon, 26 Sep 2022 20:04:32 +0300 Subject: [PATCH 14/25] Remove `do_block` from Ruby indents (#3976) `do_block` and `block` seem to conflict, causing double-indentation in some cases. Removing `do_block` does not seem to have any negative effect, while fixing the double-indentation issue. --- runtime/queries/ruby/indents.scm | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/queries/ruby/indents.scm b/runtime/queries/ruby/indents.scm index f5a6d19b..7fcf59f5 100644 --- a/runtime/queries/ruby/indents.scm +++ b/runtime/queries/ruby/indents.scm @@ -6,7 +6,6 @@ (call) (class) (case) - (do_block) (elsif) (if) (hash) From fd4cdf0b1f32c5ef6d8725aac971a94bdfd41a30 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 18:19:50 -0500 Subject: [PATCH 15/25] build(deps): bump once_cell from 1.14.0 to 1.15.0 (#3987) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- helix-core/Cargo.toml | 2 +- helix-loader/Cargo.toml | 2 +- helix-term/Cargo.toml | 2 +- helix-view/Cargo.toml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cc9e69b4..7715fabc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -730,9 +730,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "parking_lot" diff --git a/helix-core/Cargo.toml b/helix-core/Cargo.toml index 0ec58af9..0a4790a3 100644 --- a/helix-core/Cargo.toml +++ b/helix-core/Cargo.toml @@ -26,7 +26,7 @@ unicode-general-category = "0.5" # slab = "0.4.2" slotmap = "1.0" tree-sitter = "0.20" -once_cell = "1.14" +once_cell = "1.15" arc-swap = "1" regex = "1" diff --git a/helix-loader/Cargo.toml b/helix-loader/Cargo.toml index e23e0290..b4541de5 100644 --- a/helix-loader/Cargo.toml +++ b/helix-loader/Cargo.toml @@ -19,7 +19,7 @@ serde = { version = "1.0", features = ["derive"] } toml = "0.5" etcetera = "0.4" tree-sitter = "0.20" -once_cell = "1.14" +once_cell = "1.15" log = "0.4" # TODO: these two should be on !wasm32 only diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index b36063e4..ac50b610 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -32,7 +32,7 @@ helix-dap = { version = "0.6", path = "../helix-dap" } helix-loader = { version = "0.6", path = "../helix-loader" } anyhow = "1" -once_cell = "1.14" +once_cell = "1.15" which = "4.2" diff --git a/helix-view/Cargo.toml b/helix-view/Cargo.toml index 9182ce23..266a5732 100644 --- a/helix-view/Cargo.toml +++ b/helix-view/Cargo.toml @@ -22,7 +22,7 @@ helix-dap = { version = "0.6", path = "../helix-dap" } crossterm = { version = "0.25", optional = true } # Conversion traits -once_cell = "1.14" +once_cell = "1.15" url = "2" arc-swap = { version = "1.5.1" } From d2bb7f5a09c8f46fbf963772e8a6d713d86229fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 18:22:48 -0500 Subject: [PATCH 16/25] build(deps): bump tokio-stream from 0.1.9 to 0.1.10 (#3988) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- helix-lsp/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7715fabc..279577bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1196,9 +1196,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +checksum = "f6edf2d6bc038a43d31353570e27270603f4648d18f5ed10c0e179abe43255af" dependencies = [ "futures-core", "pin-project-lite", diff --git a/helix-lsp/Cargo.toml b/helix-lsp/Cargo.toml index 2e5b8139..536a6ba6 100644 --- a/helix-lsp/Cargo.toml +++ b/helix-lsp/Cargo.toml @@ -23,5 +23,5 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" thiserror = "1.0" tokio = { version = "1.21", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot", "sync"] } -tokio-stream = "0.1.9" +tokio-stream = "0.1.10" which = "4.2" From 90468ad6c592c9a93e30b0809b42552e3b24f1e7 Mon Sep 17 00:00:00 2001 From: Jacob Chandler Date: Mon, 26 Sep 2022 19:27:54 -0400 Subject: [PATCH 17/25] fix: Improve JSX and TSX tag highlighting (#3973) --- runtime/queries/jsx/highlights.scm | 16 +++++++++++++--- runtime/queries/tsx/highlights.scm | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/runtime/queries/jsx/highlights.scm b/runtime/queries/jsx/highlights.scm index d7054336..a1eb2d0e 100644 --- a/runtime/queries/jsx/highlights.scm +++ b/runtime/queries/jsx/highlights.scm @@ -1,5 +1,3 @@ -; inherits: ecma - ; Highlight component names differently (jsx_opening_element ((identifier) @constructor (#match? @constructor "^[A-Z]"))) @@ -7,21 +5,33 @@ ; Handle the dot operator effectively - (jsx_opening_element ((nested_identifier (identifier) @tag (identifier) @constructor))) +; Highlight brackets differently +(jsx_opening_element ["<" ">"] @punctuation.bracket) + (jsx_closing_element ((identifier) @constructor (#match? @constructor "^[A-Z]"))) ; Handle the dot operator effectively - (jsx_closing_element ((nested_identifier (identifier) @tag (identifier) @constructor))) +; Highlight brackets differently +(jsx_closing_element ["<" "/" ">"] @punctuation.bracket) + (jsx_self_closing_element ((identifier) @constructor (#match? @constructor "^[A-Z]"))) ; Handle the dot operator effectively - (jsx_self_closing_element ((nested_identifier (identifier) @tag (identifier) @constructor))) -; TODO: also tag @punctuation.delimiter? +; Highlight brackets differently +(jsx_self_closing_element ["<" "/" ">"] @punctuation.bracket) + +; Handle attribute delimiter +(jsx_attribute "=" @punctuation.delimiter) (jsx_opening_element (identifier) @tag) (jsx_closing_element (identifier) @tag) (jsx_self_closing_element (identifier) @tag) (jsx_attribute (property_identifier) @variable.other.member) + +; inherits: ecma diff --git a/runtime/queries/tsx/highlights.scm b/runtime/queries/tsx/highlights.scm index 1b61e36d..100c7cc7 100644 --- a/runtime/queries/tsx/highlights.scm +++ b/runtime/queries/tsx/highlights.scm @@ -1 +1 @@ -; inherits: typescript +; inherits: jsx,typescript From e3fbeeb7893b73508d2cb2fee5271403b1e227c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 18:36:40 -0500 Subject: [PATCH 18/25] build(deps): bump unicode-general-category from 0.5.1 to 0.6.0 (#3990) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- helix-core/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 279577bb..b829efd2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1241,9 +1241,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-general-category" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1218098468b8085b19a2824104c70d976491d247ce194bbd9dc77181150cdfd6" +checksum = "2281c8c1d221438e373249e065ca4989c4c36952c211ff21a0ee91c44a3869e7" [[package]] name = "unicode-ident" diff --git a/helix-core/Cargo.toml b/helix-core/Cargo.toml index 0a4790a3..ba6901ba 100644 --- a/helix-core/Cargo.toml +++ b/helix-core/Cargo.toml @@ -22,7 +22,7 @@ smallvec = "1.9" smartstring = "1.0.1" unicode-segmentation = "1.10" unicode-width = "0.1" -unicode-general-category = "0.5" +unicode-general-category = "0.6" # slab = "0.4.2" slotmap = "1.0" tree-sitter = "0.20" From cc0018a7d307e67fe2151930ab395f8532639d18 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 18:43:14 -0500 Subject: [PATCH 19/25] build(deps): bump thiserror from 1.0.35 to 1.0.36 (#3991) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b829efd2..3a2dbc51 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1111,18 +1111,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85" +checksum = "0a99cb8c4b9a8ef0e7907cd3b617cc8dc04d571c4e73c8ae403d80ac160bb122" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" +checksum = "3a891860d3c8d66fec8e73ddb3765f90082374dbaaa833407b904a94f1a7eb43" dependencies = [ "proc-macro2", "quote", From 8fc493137d159c4b1fbf964ed52dc6d53f6fcaf8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 18:43:30 -0500 Subject: [PATCH 20/25] build(deps): bump serde from 1.0.144 to 1.0.145 (#3989) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3a2dbc51..e5edcaac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -916,18 +916,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.144" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" +checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.144" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" +checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" dependencies = [ "proc-macro2", "quote", From bdc7b35214ec12a013941f7f6753331d47952bb2 Mon Sep 17 00:00:00 2001 From: Erin Kim <79354991+oati@users.noreply.github.com> Date: Tue, 27 Sep 2022 13:01:58 +0000 Subject: [PATCH 21/25] nix: replace `runCommandNoCC` with `runCommand` (#3992) --- grammars.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grammars.nix b/grammars.nix index 066fa69d..9ca0cf3d 100644 --- a/grammars.nix +++ b/grammars.nix @@ -2,7 +2,7 @@ stdenv, lib, runCommandLocal, - runCommandNoCC, + runCommand, yj, includeGrammarIf ? _: true, ... @@ -115,7 +115,7 @@ builtins.map (grammar: "ln -s ${grammar.artifact}/${grammar.name}.so $out/${grammar.name}.so") builtGrammars; in - runCommandNoCC "consolidated-helix-grammars" {} '' + runCommand "consolidated-helix-grammars" {} '' mkdir -p $out ${builtins.concatStringsSep "\n" grammarLinks} '' From 5dbca0fc089b3bfdd58162eabc4ee1c3fd2a52bd Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Wed, 28 Sep 2022 16:50:53 +0200 Subject: [PATCH 22/25] Add gruvbox dark (#3948) * Add gruvbox dark * fixup! Add gruvbox dark --- runtime/themes/gruvbox_dark_hard.toml | 102 ++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 runtime/themes/gruvbox_dark_hard.toml diff --git a/runtime/themes/gruvbox_dark_hard.toml b/runtime/themes/gruvbox_dark_hard.toml new file mode 100644 index 00000000..708ca2b2 --- /dev/null +++ b/runtime/themes/gruvbox_dark_hard.toml @@ -0,0 +1,102 @@ +# Author : Sven-Hendrik Haase +# Author : Jakub Bartodziej +# 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" + +"diff.plus" = "green1" +"diff.delta" = "orange1" +"diff.minus" = "red1" + +"warning" = { fg = "orange1", bg = "bg1" } +"error" = { fg = "red1", bg = "bg1" } +"info" = { fg = "aqua1", bg = "bg1" } +"hint" = { fg = "blue1", bg = "bg1" } + +"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.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" = { modifiers = ["underlined"] } + +"markup.heading" = "aqua1" +"markup.bold" = { modifiers = ["bold"] } +"markup.italic" = { modifiers = ["italic"] } +"markup.link.url" = { fg = "green1", modifiers = ["underlined"] } +"markup.link.text" = "red1" +"markup.raw" = "red1" + +[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" From 038ad6289f7d5e84d17da2dfb5723116641c62e1 Mon Sep 17 00:00:00 2001 From: Sora Date: Thu, 29 Sep 2022 01:50:24 +0200 Subject: [PATCH 23/25] Fix tutor typo `favourite` to `favorite` (#4007) --- runtime/tutor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/tutor b/runtime/tutor index 313a14a1..04ea8fcd 100644 --- a/runtime/tutor +++ b/runtime/tutor @@ -520,7 +520,7 @@ _________________________________________________________________ 6. Type , to remove the second cursor. --> I like to eat apples since my favorite fruit is apples. - I like to eat oranges since my favourite fruit is oranges. + I like to eat oranges since my favorite fruit is oranges. From c4aec0a5c573bca755a49e3031c483422031874f Mon Sep 17 00:00:00 2001 From: joleaf <71190322+joleaf@users.noreply.github.com> Date: Thu, 29 Sep 2022 17:02:55 +0200 Subject: [PATCH 24/25] tutor: missing before removing the second cursor (#4027) This step was missing in section 5.2 of tutor. --- runtime/tutor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/tutor b/runtime/tutor index 04ea8fcd..8eef33af 100644 --- a/runtime/tutor +++ b/runtime/tutor @@ -517,7 +517,8 @@ _________________________________________________________________ 'apples' in the line will be selected. 5. You can now type c and change 'apples' to something else, like 'oranges'. - 6. Type , to remove the second cursor. + 6. Type to exit Insert mode. + 7. Type , to remove the second cursor. --> I like to eat apples since my favorite fruit is apples. I like to eat oranges since my favorite fruit is oranges. @@ -525,7 +526,6 @@ _________________________________________________________________ - ================================================================= = 5.3 SELECTING VIA REGEX = ================================================================= From 8a7a6e4cff1db3ef65a2c20e0e90c60b44516e27 Mon Sep 17 00:00:00 2001 From: Maximilian Muecke Date: Thu, 29 Sep 2022 20:11:45 +0200 Subject: [PATCH 25/25] Add comment injection for R (#4031) --- runtime/queries/r/injections.scm | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 runtime/queries/r/injections.scm diff --git a/runtime/queries/r/injections.scm b/runtime/queries/r/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/r/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment"))