From c74b97447f7a84f7728ce41c796f435371563a68 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sun, 13 Nov 2022 18:45:52 -0600 Subject: [PATCH 001/352] Fix range offsets for multiple shell insertions (#4619) d6323b7cbc21a9d3ba29738c76581dad93f9f415 introduced a regression for shell commands like `|`, `!`, and `` which caused the new selections to be incorrect. This caused a panic when piping (`|`) would cause the new range to extend past the document end. The paste version of this bug was fixed in 48a3965ab43718ce2a49724cbcc294b04c328b81. This change also inherits the direction of the new range from the old range and adds integration tests to ensure that the behavior isn't broken in the future. --- helix-term/src/commands.rs | 24 ++++++++--- helix-term/tests/test/commands.rs | 68 +++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 6 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index c74dfb39cefc..5498a4377162 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -4773,6 +4773,8 @@ fn shell(cx: &mut compositor::Context, cmd: &str, behavior: &ShellBehavior) { let mut ranges = SmallVec::with_capacity(selection.len()); let text = doc.text().slice(..); + let mut offset = 0isize; + for range in selection.ranges() { let fragment = range.slice(text); let (output, success) = match shell_impl(shell, cmd, pipe.then(|| fragment.into())) { @@ -4788,13 +4790,23 @@ fn shell(cx: &mut compositor::Context, cmd: &str, behavior: &ShellBehavior) { return; } - let (from, to) = match behavior { - ShellBehavior::Replace => (range.from(), range.to()), - ShellBehavior::Insert => (range.from(), range.from()), - ShellBehavior::Append => (range.to(), range.to()), - _ => (range.from(), range.from()), + let output_len = output.chars().count(); + + let (from, to, deleted_len) = match behavior { + ShellBehavior::Replace => (range.from(), range.to(), range.len()), + ShellBehavior::Insert => (range.from(), range.from(), 0), + ShellBehavior::Append => (range.to(), range.to(), 0), + _ => (range.from(), range.from(), 0), }; - ranges.push(Range::new(to, to + output.chars().count())); + + // These `usize`s cannot underflow because selection ranges cannot overlap. + // Once the MSRV is 1.66.0 (mixed_integer_ops is stabilized), we can use checked + // arithmetic to assert this. + let anchor = (to as isize + offset - deleted_len as isize) as usize; + let new_range = Range::new(anchor, anchor + output_len).with_direction(range.direction()); + ranges.push(new_range); + offset = offset + output_len as isize - deleted_len as isize; + changes.push((from, to, Some(output))); } diff --git a/helix-term/tests/test/commands.rs b/helix-term/tests/test/commands.rs index e78e6c9f9964..114bf22211a5 100644 --- a/helix-term/tests/test/commands.rs +++ b/helix-term/tests/test/commands.rs @@ -215,3 +215,71 @@ async fn test_multi_selection_paste() -> anyhow::Result<()> { Ok(()) } + +#[tokio::test(flavor = "multi_thread")] +async fn test_multi_selection_shell_commands() -> anyhow::Result<()> { + // pipe + test(( + platform_line(indoc! {"\ + #[|lorem]# + #(|ipsum)# + #(|dolor)# + "}) + .as_str(), + "|echo foo", + platform_line(indoc! {"\ + #[|foo + ]# + #(|foo + )# + #(|foo + )# + "}) + .as_str(), + )) + .await?; + + // insert-output + test(( + platform_line(indoc! {"\ + #[|lorem]# + #(|ipsum)# + #(|dolor)# + "}) + .as_str(), + "!echo foo", + platform_line(indoc! {"\ + #[|foo + ]#lorem + #(|foo + )#ipsum + #(|foo + )#dolor + "}) + .as_str(), + )) + .await?; + + // append-output + test(( + platform_line(indoc! {"\ + #[|lorem]# + #(|ipsum)# + #(|dolor)# + "}) + .as_str(), + "echo foo", + platform_line(indoc! {"\ + lorem#[|foo + ]# + ipsum#(|foo + )# + dolor#(|foo + )# + "}) + .as_str(), + )) + .await?; + + Ok(()) +} From 4f924f47710e504d66be0c599ce34221a310df3c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 18:23:17 -0600 Subject: [PATCH 002/352] build(deps): bump similar from 2.2.0 to 2.2.1 (#4746) Bumps [similar](https://github.com/mitsuhiko/similar) from 2.2.0 to 2.2.1. - [Release notes](https://github.com/mitsuhiko/similar/releases) - [Changelog](https://github.com/mitsuhiko/similar/blob/main/CHANGELOG.md) - [Commits](https://github.com/mitsuhiko/similar/compare/2.2.0...2.2.1) --- updated-dependencies: - dependency-name: similar dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f0bf11f2b686..59108a9932fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1023,9 +1023,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ac7f900db32bf3fd12e0117dd3dc4da74bc52ebaac97f39668446d89694803" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" [[package]] name = "slab" From 4791bd66b719423cf03e0046ae5f08ab2afafad1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 18:24:32 -0600 Subject: [PATCH 003/352] build(deps): bump cc from 1.0.74 to 1.0.76 (#4748) Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.0.74 to 1.0.76. - [Release notes](https://github.com/rust-lang/cc-rs/releases) - [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.74...1.0.76) --- updated-dependencies: - dependency-name: cc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 59108a9932fd..122f361005be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -92,9 +92,9 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" [[package]] name = "cc" -version = "1.0.74" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581f5dba903aac52ea3feb5ec4810848460ee833876f1f9b0fdeab1f19091574" +checksum = "76a284da2e6fe2092f2353e51713435363112dfd60030e22add80be333fb928f" [[package]] name = "cfg-if" From 1233c9a989f419315a9fc2ed0bc10f9338aa8322 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 15 Nov 2022 02:43:22 +0100 Subject: [PATCH 004/352] Add support for Bicep files (#4403) --- book/src/generated/lang-support.md | 1 + languages.toml | 14 ++++++ runtime/queries/bicep/highlights.scm | 73 ++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 runtime/queries/bicep/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 086cd3c68f43..1c2ffdc62b8c 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -5,6 +5,7 @@ | bash | ✓ | | | `bash-language-server` | | bass | ✓ | | | `bass` | | beancount | ✓ | | | | +| bicep | ✓ | | | `bicep-langserver` | | c | ✓ | ✓ | ✓ | `clangd` | | c-sharp | ✓ | ✓ | | `OmniSharp` | | cairo | ✓ | | | | diff --git a/languages.toml b/languages.toml index 839b6223af99..78e3a35d999a 100644 --- a/languages.toml +++ b/languages.toml @@ -1966,3 +1966,17 @@ roots = [] [[grammar]] name = "ini" source = { git = "https://github.com/justinmk/tree-sitter-ini", rev = "4d247fb876b4ae6b347687de4a179511bf67fcbc" } + +[[language]] +name = "bicep" +scope = "source.bicep" +file-types = ["bicep"] +roots = [] +auto-format = true +comment-token = "//" +indent = { tab-width = 2, unit = " "} +language-server = { command = "bicep-langserver" } + +[[grammar]] +name = "bicep" +source = { git = "https://github.com/Sjord/tree-sitter-bicep", rev = "60795d3a1b493e064b263a64cb4f7f758a3394d7" } diff --git a/runtime/queries/bicep/highlights.scm b/runtime/queries/bicep/highlights.scm new file mode 100644 index 000000000000..b6f928726333 --- /dev/null +++ b/runtime/queries/bicep/highlights.scm @@ -0,0 +1,73 @@ +; Keywords + +[ + "module" + "var" + "param" + "import" + "resource" + "existing" + "if" + "targetScope" + "output" +] @keyword + +; Functions + +(decorator) @function.builtin + +(functionCall) @function + +(functionCall + (functionArgument + (variableAccess) @variable)) + +; Literals/Types + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +(resourceDeclaration + (string + (stringLiteral) @string.special)) + +(moduleDeclaration + (string + (stringLiteral) @string.special)) + +[ + (string) + (stringLiteral) +] @string + +(nullLiteral) @keyword +(booleanLiteral) @constant.builtin.boolean +(integerLiteral) @constant.numeric.integer +(comment) @comment + +(string + (variableAccess + (identifier) @variable)) + +(type) @type + +; Variables + +(localVariable) @variable + +; Statements + +(object + (objectProperty + (identifier) @identifier)) + +(propertyAccess + (identifier) @identifier) + +(ifCondition) @keyword.control.conditional From 91ff903bf3867f112d242d6ecbe0b417b900656f Mon Sep 17 00:00:00 2001 From: Gaurav Tyagi Date: Tue, 15 Nov 2022 07:16:07 +0530 Subject: [PATCH 005/352] Add global error/warning count statusline element (#4569) --- book/src/configuration.md | 1 + helix-term/src/ui/statusline.rs | 44 +++++++++++++++++++++++++++++++++ helix-view/src/editor.rs | 3 +++ 3 files changed, 48 insertions(+) diff --git a/book/src/configuration.md b/book/src/configuration.md index 8713c3ffe85d..e4854cda1a70 100644 --- a/book/src/configuration.md +++ b/book/src/configuration.md @@ -102,6 +102,7 @@ The following statusline elements can be configured: | `total-line-numbers` | The total line numbers of the opened file | | `file-type` | The type of the opened file | | `diagnostics` | The number of warnings and/or errors | +| `workspace-diagnostics` | The number of warnings and/or errors on workspace | | `selections` | The number of active selections | | `primary-selection-length` | The number of characters currently in primary selection | | `position` | The cursor position | diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs index 47bb11290a3c..6ea0570df3d0 100644 --- a/helix-term/src/ui/statusline.rs +++ b/helix-term/src/ui/statusline.rs @@ -1,4 +1,5 @@ use helix_core::{coords_at_pos, encoding, Position}; +use helix_lsp::lsp::DiagnosticSeverity; use helix_view::{ document::{Mode, SCRATCH_BUFFER_NAME}, graphics::Rect, @@ -141,6 +142,7 @@ where helix_view::editor::StatusLineElement::FileLineEnding => render_file_line_ending, helix_view::editor::StatusLineElement::FileType => render_file_type, helix_view::editor::StatusLineElement::Diagnostics => render_diagnostics, + helix_view::editor::StatusLineElement::WorkspaceDiagnostics => render_workspace_diagnostics, helix_view::editor::StatusLineElement::Selections => render_selections, helix_view::editor::StatusLineElement::PrimarySelectionLength => { render_primary_selection_length @@ -245,6 +247,48 @@ where } } +fn render_workspace_diagnostics(context: &mut RenderContext, write: F) +where + F: Fn(&mut RenderContext, String, Option - - - + \ No newline at end of file From 39ce82b7a59de8adcb1626151b1ce8fe7b7a4a8e Mon Sep 17 00:00:00 2001 From: lesleyrs <19632758+lesleyrs@users.noreply.github.com> Date: Fri, 2 Dec 2022 15:02:29 +0100 Subject: [PATCH 105/352] Add Ctrl-i alias for Windows (#4961) --- helix-term/src/keymap/default.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-term/src/keymap/default.rs b/helix-term/src/keymap/default.rs index 118764d97585..c0d17a87e065 100644 --- a/helix-term/src/keymap/default.rs +++ b/helix-term/src/keymap/default.rs @@ -198,7 +198,7 @@ pub fn default() -> HashMap { // z family for save/restore/combine from/to sels from register - "tab" => jump_forward, // tab == + "C-i" | "tab" => jump_forward, // tab == "C-o" => jump_backward, "C-s" => save_selection, From d0bc38d6fa60e36ef317e8bbbaa11aeb30470ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Dzivjak?= Date: Fri, 2 Dec 2022 15:06:35 +0100 Subject: [PATCH 106/352] feat(lang): bump tree-sitter-go (#4969) Update tree-sitter-go to latest with updated support for generics. See: https://github.com/tree-sitter/tree-sitter-go/compare/0fa917a7022d1cd2e9b779a6a8fc5dc7fad69c75..05900faa3cdb5d2d8c8bd5e77ee698487e0a8611 for full diff. --- languages.toml | 2 +- runtime/queries/go/indents.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/languages.toml b/languages.toml index 4eb8a4dab1d5..9664d93a654b 100644 --- a/languages.toml +++ b/languages.toml @@ -301,7 +301,7 @@ args = { mode = "local", processId = "{0}" } [[grammar]] name = "go" -source = { git = "https://github.com/tree-sitter/tree-sitter-go", rev = "0fa917a7022d1cd2e9b779a6a8fc5dc7fad69c75" } +source = { git = "https://github.com/tree-sitter/tree-sitter-go", rev = "05900faa3cdb5d2d8c8bd5e77ee698487e0a8611" } [[language]] name = "gomod" diff --git a/runtime/queries/go/indents.scm b/runtime/queries/go/indents.scm index 8bfc7c3fe14a..f72ec9e827b0 100644 --- a/runtime/queries/go/indents.scm +++ b/runtime/queries/go/indents.scm @@ -5,7 +5,7 @@ (type_spec) (func_literal) (literal_value) - (element) + (literal_element) (keyed_element) (expression_case) (default_case) From 59b886cf5e89dadfd73d93b638b2c552ce5537f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?alex=20=E5=AD=99=E6=AC=A3=E4=B9=90?= Date: Fri, 2 Dec 2022 22:24:00 +0800 Subject: [PATCH 107/352] nightfox theme: Use brighter colors for diff scopes (#4966) --- runtime/themes/nightfox.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/themes/nightfox.toml b/runtime/themes/nightfox.toml index 131cab190870..c4cbbce0f726 100644 --- a/runtime/themes/nightfox.toml +++ b/runtime/themes/nightfox.toml @@ -140,10 +140,10 @@ # Diff ============================== # Version control changes. -"diff.plus" = "green-dim" # Additions. -"diff.minus" = "red-dim" # Deletions. -"diff.delta" = "blue-dim" # Modifications. -"diff.delta.moved" = "cyan-dim" # Renamed or moved files. +"diff.plus" = "green" # Additions. +"diff.minus" = "red" # Deletions. +"diff.delta" = "blue" # Modifications. +"diff.delta.moved" = "cyan" # Renamed or moved files. # color palette [palette] From b677c6a019f893c7ed8b9b84d136c50e5445315a Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Sat, 3 Dec 2022 03:05:15 +0100 Subject: [PATCH 108/352] Add logo with text included (#4973) --- README.md | 10 +++-- logo_dark.svg | 115 +++++++++++++++++++++++++++++++++++++++++++++++++ logo_light.svg | 115 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 237 insertions(+), 3 deletions(-) create mode 100644 logo_dark.svg create mode 100644 logo_light.svg diff --git a/README.md b/README.md index 3555b53916a4..b06e8222702c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,12 @@
-Logo - -# Helix +

+ + + + Helix + +

[![Build status](https://github.com/helix-editor/helix/actions/workflows/build.yml/badge.svg)](https://github.com/helix-editor/helix/actions) [![GitHub Release](https://img.shields.io/github/v/release/helix-editor/helix)](https://github.com/helix-editor/helix/releases/latest) diff --git a/logo_dark.svg b/logo_dark.svg new file mode 100644 index 000000000000..f6e94f1b4c39 --- /dev/null +++ b/logo_dark.svg @@ -0,0 +1,115 @@ + + diff --git a/logo_light.svg b/logo_light.svg new file mode 100644 index 000000000000..cdd5ddb8b0a6 --- /dev/null +++ b/logo_light.svg @@ -0,0 +1,115 @@ + + From 224a024d3997035d04bf7b2f7424a472ff9936b8 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Fri, 2 Dec 2022 18:26:01 -0800 Subject: [PATCH 109/352] Update zenburn theme for git gutters (#4977) --- runtime/themes/zenburn.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/themes/zenburn.toml b/runtime/themes/zenburn.toml index affb9f56deda..63f4ac72251e 100644 --- a/runtime/themes/zenburn.toml +++ b/runtime/themes/zenburn.toml @@ -37,9 +37,9 @@ "ui.virtual.indent-guide" = "#4f4f4f" -"diff.plus" = {fg = "#709080", bg = "#313c36", modifiers = ["bold"] } -"diff.delta" = "#333333" -"diff.minus" = {fg = "#333333", bg = "#464646"} +"diff.plus" = {fg = "#709080"} +"diff.delta" = {fg = "#464646"} +"diff.minus" = {fg = "#cc9393"} "diagnostic" = {bg = "statusbg"} "diagnostic.error" = { fg = "errorfg", bg = "errorbg"} From dc00291b4888f7ffad43fd544259227d0dbbf6fb Mon Sep 17 00:00:00 2001 From: Luna Date: Sat, 3 Dec 2022 03:26:10 +0100 Subject: [PATCH 110/352] Update Doom Acario for git gutters (#4979) Edited the diff.delta from green to blue. --- runtime/themes/doom_acario_dark.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/themes/doom_acario_dark.toml b/runtime/themes/doom_acario_dark.toml index c38c93eed5b2..95dc78e0dbb6 100644 --- a/runtime/themes/doom_acario_dark.toml +++ b/runtime/themes/doom_acario_dark.toml @@ -41,7 +41,7 @@ 'diff.plus' = { fg = 'green' } 'diff.minus' = { fg = 'red' } -'diff.delta' = { fg = 'green' } +'diff.delta' = { fg = 'blue' } 'ui.background'= { bg = 'bg' } 'ui.cursor' = { bg = 'orange', fg = 'bg-alt' } From bcdb475b71b0fbabce57344ac8d2575c23b1bbe0 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Fri, 2 Dec 2022 21:09:08 -0600 Subject: [PATCH 111/352] Fix transaction composition order in History::changes_since (#4981) * Add a undo/redo split test case for crossing branches * history: Switch up/down transaction chaining order The old code tends to work in practice because, usually, either up_txns or down_txns are empty. When both have contents though, we can run into a panic trying to compose them all since they will disagree on the length of the text. This fixes the panic test case in the parent commit. --- helix-core/src/history.rs | 2 +- helix-term/tests/test/splits.rs | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/helix-core/src/history.rs b/helix-core/src/history.rs index b99e969f93ba..1aac38d934c7 100644 --- a/helix-core/src/history.rs +++ b/helix-core/src/history.rs @@ -131,7 +131,7 @@ impl History { .map(|&n| self.revisions[n].inversion.clone()); let down_txns = down.iter().map(|&n| self.revisions[n].transaction.clone()); - up_txns.chain(down_txns).reduce(|acc, tx| tx.compose(acc)) + down_txns.chain(up_txns).reduce(|acc, tx| tx.compose(acc)) } /// Undo the last edit. diff --git a/helix-term/tests/test/splits.rs b/helix-term/tests/test/splits.rs index a34a24b7cbdf..96ced21a57cd 100644 --- a/helix-term/tests/test/splits.rs +++ b/helix-term/tests/test/splits.rs @@ -161,5 +161,30 @@ async fn test_changes_in_splits_apply_to_all_views() -> anyhow::Result<()> { )) .await?; + // See . + // This sequence undoes part of the history and then adds new changes, creating a + // new branch in the history tree. `View::sync_changes` applies transactions down + // and up to the lowest common ancestor in the path between old and new revision + // numbers. If we apply these up/down transactions in the wrong order, this case + // panics. + // The key sequence: + // * 3[ Create three empty lines so we are at the end of the document. + // * v Create a split and save that point at the end of the document + // in the jumplist. + // * w Switch back to the first window. + // * uu Undo twice (not three times which would bring us back to the + // root of the tree). + // * 3[ Create three empty lines. Now the end of the document is past + // where it was on step 1. + // * q Close window 1, focusing window 2 and causing a sync. This step + // panics if we don't apply in the right order. + // * %d Clean up the buffer. + test(( + "#[|]#", + "3[vwuu3[q%d", + "#[|]#", + )) + .await?; + Ok(()) } From 2123e91e56caccf60b9285f30bc2f2f12952520a Mon Sep 17 00:00:00 2001 From: Aleksey Kuznetsov Date: Sat, 3 Dec 2022 19:24:43 +0500 Subject: [PATCH 112/352] Enable auto format for css and scss files (#4987) provideFormatter enables capability in LS and auto-format performs format on save --- languages.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/languages.toml b/languages.toml index 9664d93a654b..d214a082fcc3 100644 --- a/languages.toml +++ b/languages.toml @@ -422,6 +422,8 @@ injection-regex = "css" file-types = ["css", "scss"] roots = [] language-server = { command = "vscode-css-language-server", args = ["--stdio"] } +auto-format = true +config = { "provideFormatter" = true } indent = { tab-width = 2, unit = " " } [[grammar]] @@ -435,6 +437,8 @@ injection-regex = "scss" file-types = ["scss"] roots = [] language-server = { command = "vscode-css-language-server", args = ["--stdio"] } +auto-format = true +config = { "provideFormatter" = true } indent = { tab-width = 2, unit = " " } [[grammar]] From 326a0dab069b65463db90e2647287c1e5b6b66aa Mon Sep 17 00:00:00 2001 From: Jens Getreu Date: Sun, 4 Dec 2022 03:03:42 +0100 Subject: [PATCH 113/352] Autumn theme: adjust some gray colors (#4996) --- runtime/themes/autumn.toml | 12 ++++++------ runtime/themes/autumn_night.toml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/runtime/themes/autumn.toml b/runtime/themes/autumn.toml index b13aeef2bd8d..fe80261af294 100644 --- a/runtime/themes/autumn.toml +++ b/runtime/themes/autumn.toml @@ -10,13 +10,13 @@ "ui.background" = { bg = "my_gray0" } "ui.menu" = { fg = "my_white", bg = "my_gray2" } "ui.menu.selected" = { fg = "my_gray2", bg = "my_gray5" } -"ui.linenr" = { fg = "my_gray4", bg = "my_gray2" } +"ui.linenr" = { fg = "my_gray3", bg = "my_gray0" } "ui.popup" = { bg = "my_gray2" } -"ui.window" = { fg = "my_gray4", bg = "my_gray2" } -"ui.linenr.selected" = { fg = "my_gray6", bg = "my_gray1"} +"ui.window" = { fg = "my_gray3", bg = "my_gray2" } +"ui.linenr.selected" = { fg = "my_gray6", bg = "my_gray0"} "ui.selection" = { bg = "my_gray3" } "comment" = { fg = "my_gray4", modifiers = ["italic"] } -"ui.cursorline" = { bg = "my_gray2" } +"ui.cursorline" = { bg = "my_gray3" } "ui.statusline" = { fg = "my_gray6", bg = "my_gray2" } "ui.statusline.inactive" = { fg = 'my_gray4', bg = 'my_gray2' } "ui.statusline.insert" = {fg = "my_black", bg = "my_gray5", modifiers = ["bold"]} @@ -62,7 +62,7 @@ "diff.minus" = "my_red" "diagnostic" = { modifiers = ["underlined"] } -"ui.gutter" = { bg = "my_gray2" } +"ui.gutter" = { bg = "my_gray0" } "hint" = "my_gray5" "debug" = "my_yellow2" "info" = "my_yellow2" @@ -77,7 +77,7 @@ my_gray2 = "#323232" # Lighter Background (Used for status bars, line numbe my_gray3 = "#505050" # Selection Background my_gray4 = "#7c7c7c" # Comments, Invisibles, Line Highlighting my_gray5 = "#a8a8a8" # Dark Foreground (Used for status bars) -my_gray6 = "#c0c0c0" # Light Foreground (Not often used) +my_gray6 = "#c8c8c8" # Light Foreground (Not often used) my_gray7 = "#e8e8e8" # Light Background (Not often used) my_white = "#F3F2CC" # Default Foreground, Caret, Delimiters, Operators my_white2 = "#F3F2CC" # Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted diff --git a/runtime/themes/autumn_night.toml b/runtime/themes/autumn_night.toml index 2f398dc96468..d01f5356931e 100644 --- a/runtime/themes/autumn_night.toml +++ b/runtime/themes/autumn_night.toml @@ -10,13 +10,13 @@ "ui.background" = { bg = "my_gray0" } "ui.menu" = { fg = "my_white", bg = "my_gray2" } "ui.menu.selected" = { fg = "my_gray2", bg = "my_gray5" } -"ui.linenr" = { fg = "my_gray4", bg = "my_gray2" } +"ui.linenr" = { fg = "my_gray3", bg = "my_gray0" } "ui.popup" = { bg = "my_gray2" } -"ui.window" = { fg = "my_gray4", bg = "my_gray2" } -"ui.linenr.selected" = { fg = "my_gray6", bg = "my_gray1"} +"ui.window" = { fg = "my_gray3", bg = "my_gray2" } +"ui.linenr.selected" = { fg = "my_gray6", bg = "my_gray0"} "ui.selection" = { bg = "my_gray3" } "comment" = { fg = "my_gray4", modifiers = ["italic"] } -"ui.cursorline" = { bg = "my_gray2" } +"ui.cursorline" = { bg = "my_gray3" } "ui.statusline" = { fg = "my_gray6", bg = "my_gray2" } "ui.statusline.inactive" = { fg = 'my_gray4', bg = 'my_gray2' } "ui.statusline.insert" = {fg = "my_black", bg = "my_gray5", modifiers = ["bold"]} @@ -62,7 +62,7 @@ "diff.minus" = "my_red" "diagnostic" = { modifiers = ["underlined"] } -"ui.gutter" = { bg = "my_gray2" } +"ui.gutter" = { bg = "my_gray0" } "hint" = "my_gray5" "debug" = "my_yellow2" "info" = "my_yellow2" @@ -77,7 +77,7 @@ my_gray2 = "#1a1a1a" # Lighter Background (Used for status bars, line numbe my_gray3 = "#323232" # Selection Background my_gray4 = "#7c7c7c" # Comments, Invisibles, Line Highlighting my_gray5 = "#aaaaaa" # Dark Foreground (Used for status bars) -my_gray6 = "#c0c0c0" # Light Foreground (Not often used) +my_gray6 = "#c4c4c4" # Light Foreground (Not often used) my_gray7 = "#e8e8e8" # Light Background (Not often used) my_white = "#F3F2CC" # Default Foreground, Caret, Delimiters, Operators my_white2 = "#F3F2CC" # Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted From e9d0645f66c6254e82c2b50000eb5660c128f26b Mon Sep 17 00:00:00 2001 From: PORTALSURFER <41680373+PORTALSURFER@users.noreply.github.com> Date: Sun, 4 Dec 2022 03:06:40 +0100 Subject: [PATCH 114/352] Adjusted hex themes for new gutter diff colors (#4990) * added 2 themes * diff feature fixes adjusted the skin to better work with the new diff coloring features propagates to child skins like - hex_toxic * fine tuning so it all is a bit softer * fine tuning to be softer * added new version, lavender --- runtime/themes/hex_lavender.toml | 31 ++++++++++++++++++++++++++++++ runtime/themes/hex_steel.toml | 33 ++++++++++++++++++-------------- runtime/themes/hex_toxic.toml | 10 +++++----- 3 files changed, 55 insertions(+), 19 deletions(-) create mode 100644 runtime/themes/hex_lavender.toml diff --git a/runtime/themes/hex_lavender.toml b/runtime/themes/hex_lavender.toml new file mode 100644 index 000000000000..974c486ce06e --- /dev/null +++ b/runtime/themes/hex_lavender.toml @@ -0,0 +1,31 @@ +inherits = "hex_steel" + +[palette] +t1 = "#0e0e0d" +t2 = "#121311" +t3 = "#2b3444" # +t4 = "#61586f" +t5 = "#686e73" +t6 = "#878480" +t7 = "#897dca" +t8 = "#7b89a3" +t9 = "#bcb6ba" +t10 = "#9db2b8" +t11 = "#a0c7cf" + +highlight = "#ff2e5f" +highlight_two = "#0affa9" +highlight_three = "#29bbff" + +black = "#000000" + +selection = "#290019" + +comment = "#9aacfe" +comment_doc = "#0affa9" + +error = "#ff0900" +warning = "#ffbf00" +display = "#57ff89" +info = "#dad7d5" +# diff --git a/runtime/themes/hex_steel.toml b/runtime/themes/hex_steel.toml index 06e91d01374e..7a2183f8f8aa 100644 --- a/runtime/themes/hex_steel.toml +++ b/runtime/themes/hex_steel.toml @@ -1,5 +1,5 @@ -"comment" = { fg = "highlight_three" } -"comment.block.documentation" = { bg = "t4", modifiers = ["italic"] } +"comment" = { fg = "comment" } +"comment.block.documentation" = { bg = "comment_doc", modifiers = ["italic"] } "constant" = { fg = "t11" } "function" = { fg = "t10" } @@ -20,18 +20,19 @@ "variable" = { fg = "t4" } "label" = { fg = "t4" } -"diff.plus" = { fg = "t4" } -"diff.delta" = { fg = "t4" } -"diff.minus" = { fg = "t4" } +"diff.plus" = { fg = "diff_plus" } +"diff.delta" = { fg = "diff_delta" } +"diff.delta.moved" = { fg = "diff_delta_moved" } +"diff.minus" = { fg = "diff_minus" } "ui.cursor.insert" = { fg = "t2", bg = "highlight" } "ui.cursor.select" = { fg = "t2", bg = "highlight_two" } "ui.cursor" = { fg = "t1", bg = "highlight_three" } -"ui.cursor.match" = { fg = "highlight", bg = "t1", modifiers = ["bold"] } +"ui.cursor.match" = { fg = "highlight", bg = "selection", modifiers = ["bold"] } -"ui.linenr" = { fg = "t3", bg = "t1" } -"ui.linenr.selected" = { fg = "highlight_three", bg = "t1" } -"ui.gutter" = { bg = "t1" } +"ui.linenr" = { fg = "t3", bg = "t2" } +"ui.linenr.selected" = { fg = "highlight_three", bg = "t2" } +"ui.gutter" = { bg = "t2" } "ui.background" = { fg = "t4", bg = "t2" } "ui.background.separator" = { fg = "t3" } @@ -76,8 +77,8 @@ "markup.raw" = { fg = "t4" } [palette] -t1 = "#0f0b0b" -t2 = "#161010" +t1 = "#0e0e0d" +t2 = "#1d1e1b" t3 = "#5b5555" t4 = "#656869" t5 = "#727b7c" @@ -95,11 +96,15 @@ highlight_three = "#d4d987" selection = "#032d4a" black = "#000000" - -comment = "#396884" +comment = "#d4d987" comment_doc = "#234048" error = "#ff0900" warning = "#ffbf00" -display = "#57ff89" +display = "#42baff" info = "#dad7d5" + +diff_minus = "#ff0900" +diff_delta = "#0078bd" +diff_plus = "#87a800" +diff_delta_moved = "#0048bd" diff --git a/runtime/themes/hex_toxic.toml b/runtime/themes/hex_toxic.toml index 3cd878bef7ea..33bfa6e5fa2f 100644 --- a/runtime/themes/hex_toxic.toml +++ b/runtime/themes/hex_toxic.toml @@ -2,7 +2,7 @@ inherits = "hex_steel" [palette] t1 = "#101719" -t2 = "#152432" +t2 = "#1b2a32" t3 = "#4b5968" t4 = "#8792ab" t5 = "#6f91bc" @@ -13,15 +13,15 @@ t9 = "#b3ccd0" t10 = "#b0d4d8" t11 = "#ffbf52" -highlight = "#ff2e5f" +highlight = "#ff0a50" highlight_two = "#0affa9" -highlight_three = "#d7ff52" +highlight_three = "#f8ed8b" black = "#000000" -selection = "#290019" +selection = "#382e1e" -comment = "#396884" +comment = "#61bdd1" comment_doc = "#234048" error = "#ff0900" From c13c6d56b6eb0e117cb92ba4011155b519befde6 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sat, 3 Dec 2022 20:07:17 -0600 Subject: [PATCH 115/352] Use logo for contrib icon (#4982) --- contrib/helix.png | Bin 1838 -> 15785 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/contrib/helix.png b/contrib/helix.png index bef00b98418a3fefcf56a5d45fafb1403e26e996..a9b699a4606926465926e8020eb5ce94cffb2ddb 100644 GIT binary patch literal 15785 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 Xz Date: Sun, 4 Dec 2022 16:45:31 +0100 Subject: [PATCH 116/352] Add support for single-line comments to scss (#5003) --- runtime/queries/scss/highlights.scm | 2 +- runtime/queries/scss/injections.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/queries/scss/highlights.scm b/runtime/queries/scss/highlights.scm index 89cce49442c2..8ba00a881c33 100644 --- a/runtime/queries/scss/highlights.scm +++ b/runtime/queries/scss/highlights.scm @@ -1,4 +1,4 @@ -(comment) @comment +[(comment) (single_line_comment)] @comment "~" @operator ">" @operator diff --git a/runtime/queries/scss/injections.scm b/runtime/queries/scss/injections.scm index 321c90add371..350ea9e78a76 100644 --- a/runtime/queries/scss/injections.scm +++ b/runtime/queries/scss/injections.scm @@ -1,2 +1,2 @@ -((comment) @injection.content +([(comment) (single_line_comment)] @injection.content (#set! injection.language "comment")) From 417676953bce6a4be91f4b8da35ed0e361b585ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Mon, 5 Dec 2022 14:40:41 +0900 Subject: [PATCH 117/352] Add basic support for common lisp --- languages.toml | 15 +++++++++++++-- runtime/queries/common-lisp/highlights.scm | 1 + runtime/queries/common-lisp/injections.scm | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 runtime/queries/common-lisp/highlights.scm create mode 100644 runtime/queries/common-lisp/injections.scm diff --git a/languages.toml b/languages.toml index d214a082fcc3..325a39dfc4c6 100644 --- a/languages.toml +++ b/languages.toml @@ -878,14 +878,25 @@ source = { git = "https://github.com/ganezdragon/tree-sitter-perl", rev = "0ac2c [[language]] name = "racket" -scope = "source.rkt" +scope = "source.racket" roots = [] -file-types = ["rkt"] +file-types = ["rkt", "rktd", "rktl", "scrbl"] shebangs = ["racket"] comment-token = ";" language-server = { command = "racket", args = ["-l", "racket-langserver"] } grammar = "scheme" +[[language]] +name = "common-lisp" +scope = "source.lisp" +roots = [] +file-types = ["lisp", "asd", "cl", "l", "lsp", "ny"," podsl", "sexp"] +shebangs = ["lisp", "sbcl", "ccl", "clisp", "ecl"] +comment-token = ";" +indent = { tab-width = 2, unit = " " } +language-server = { command = "cl-lsp", args = [ "stdio" ] } +grammar = "scheme" + [[language]] name = "comment" scope = "scope.comment" diff --git a/runtime/queries/common-lisp/highlights.scm b/runtime/queries/common-lisp/highlights.scm new file mode 100644 index 000000000000..e11eb7881081 --- /dev/null +++ b/runtime/queries/common-lisp/highlights.scm @@ -0,0 +1 @@ +; inherits: scheme diff --git a/runtime/queries/common-lisp/injections.scm b/runtime/queries/common-lisp/injections.scm new file mode 100644 index 000000000000..e11eb7881081 --- /dev/null +++ b/runtime/queries/common-lisp/injections.scm @@ -0,0 +1 @@ +; inherits: scheme From 03ca18b377c1dfd78e8ff6bfac6d418de237923b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Mon, 5 Dec 2022 15:02:13 +0900 Subject: [PATCH 118/352] Update language support docs --- book/src/generated/lang-support.md | 1 + 1 file changed, 1 insertion(+) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index b1fde0016abb..ccfd18c00fca 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -12,6 +12,7 @@ | clojure | ✓ | | | `clojure-lsp` | | cmake | ✓ | ✓ | ✓ | `cmake-language-server` | | comment | ✓ | | | | +| common-lisp | ✓ | | | `cl-lsp` | | cpon | ✓ | | ✓ | | | cpp | ✓ | ✓ | ✓ | `clangd` | | css | ✓ | | | `vscode-css-language-server` | From 1e31bc3f77040d4a3663b8b6bf72d8d3a632b88a Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Mon, 5 Dec 2022 14:18:42 +0100 Subject: [PATCH 119/352] Reduce log message about diff timeout from warn to info (#5012) --- helix-vcs/src/diff/worker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-vcs/src/diff/worker.rs b/helix-vcs/src/diff/worker.rs index b8659c9b3bc2..f4bb4dbfb07c 100644 --- a/helix-vcs/src/diff/worker.rs +++ b/helix-vcs/src/diff/worker.rs @@ -185,7 +185,7 @@ impl<'a> EventAccumulator { } // Diff failed to complete in time log the event // and wait until the diff occurs to trigger an async redraw - log::warn!("Diff computation timed out, update of diffs might appear delayed"); + log::info!("Diff computation timed out, update of diffs might appear delayed"); diff_finished_notify.notified().await; redraw_notify.notify_one(); }); From b0f20f13e3a606cba35cc70144f045a22b5b38bc Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Mon, 5 Dec 2022 14:46:59 +0100 Subject: [PATCH 120/352] fix git diff when core.autocrlf is enabled (#4995) --- helix-vcs/src/git.rs | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/helix-vcs/src/git.rs b/helix-vcs/src/git.rs index 82b2b5587fc4..432159b6cdb8 100644 --- a/helix-vcs/src/git.rs +++ b/helix-vcs/src/git.rs @@ -17,14 +17,17 @@ impl Git { // custom open options let mut git_open_opts_map = git::sec::trust::Mapping::::default(); - // don't use the global git configs (not needed) + // On windows various configuration options are bundled as part of the installations + // This path depends on the install location of git and therefore requires some overhead to lookup + // This is basically only used on windows and has some overhead hence it's disabled on other platforms. + // `gitoxide` doesn't use this as default let config = git::permissions::Config { - system: false, - git: false, - user: false, + system: true, + git: true, + user: true, env: true, includes: true, - git_binary: false, + git_binary: cfg!(windows), }; // change options for config permissions without touching anything else git_open_opts_map.reduced = git_open_opts_map.reduced.permissions(git::Permissions { @@ -61,7 +64,29 @@ impl DiffProvider for Git { let file_oid = find_file_in_commit(&repo, &head, file)?; let file_object = repo.find_object(file_oid).ok()?; - Some(file_object.detach().data) + let mut data = file_object.detach().data; + // convert LF to CRLF if configured to avoid showing every line as changed + if repo + .config_snapshot() + .boolean("core.autocrlf") + .unwrap_or(false) + { + let mut normalized_file = Vec::with_capacity(data.len()); + let mut at_cr = false; + for &byte in &data { + if byte == b'\n' { + // if this is a LF instead of a CRLF (last byte was not a CR) + // insert a new CR to generate a CRLF + if !at_cr { + normalized_file.push(b'\r'); + } + } + at_cr = byte == b'\r'; + normalized_file.push(byte) + } + data = normalized_file + } + Some(data) } } From f712d316e5d210e95f9d297651f1d753646c26d2 Mon Sep 17 00:00:00 2001 From: two-six Date: Mon, 5 Dec 2022 14:48:20 +0100 Subject: [PATCH 121/352] Update Acme and Nord Light for git gutters (#4999) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update acme.toml * Update nord_light.toml * Update runtime/themes/nord_light.toml Co-authored-by: Blaž Hrastnik * Update acme.toml Co-authored-by: Blaž Hrastnik --- runtime/themes/acme.toml | 3 +++ runtime/themes/nord_light.toml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/runtime/themes/acme.toml b/runtime/themes/acme.toml index d3be695cb944..696a4a9b2633 100644 --- a/runtime/themes/acme.toml +++ b/runtime/themes/acme.toml @@ -22,6 +22,9 @@ "diagnostic.hint" = {bg="white", modifiers=["bold"]} "ui.bufferline" = { fg = "indent", bg = "acme_bar_bg" } "ui.bufferline.active" = { fg = "black", bg = "acme_bg" } +"diff.plus" = {fg = "green"} +"diff.delta" = {fg = "acme_bar_bg"} +"diff.minus" = {fg = "red"} [palette] white = "#ffffff" diff --git a/runtime/themes/nord_light.toml b/runtime/themes/nord_light.toml index 5270fe34ea39..eb947d034fc3 100644 --- a/runtime/themes/nord_light.toml +++ b/runtime/themes/nord_light.toml @@ -58,6 +58,10 @@ "markup.link.text" = {fg="nord12"} "markup.quote" = {fg="nord3", modifiers=["italic"]} +"diff.plus" = {fg = "nord14"} +"diff.delta" = {fg = "nord13"} +"diff.minus" = {fg = "nord11"} + [palette] nord0 = "#2E3440" From 5781aa026417bc6539b80b451da4a99a7057bbe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Dzivjak?= Date: Mon, 5 Dec 2022 16:16:25 +0100 Subject: [PATCH 122/352] feat(highlights): go builtin funcs and types (#5010) Add highlight scopes for golang built-in functions and types. Based on https://pkg.go.dev/builtin. --- runtime/queries/go/highlights.scm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime/queries/go/highlights.scm b/runtime/queries/go/highlights.scm index 4ff8675b1d5f..927bd95b06a7 100644 --- a/runtime/queries/go/highlights.scm +++ b/runtime/queries/go/highlights.scm @@ -1,5 +1,9 @@ ; Function calls +(call_expression + function: (identifier) @function.builtin + (match? @function.builtin "^(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)$")) + (call_expression function: (identifier) @function) @@ -24,6 +28,9 @@ (parameter_declaration (identifier) @variable.parameter) (variadic_parameter_declaration (identifier) @variable.parameter) +((type_identifier) @type.builtin + (match? @type.builtin "^(any|bool|byte|comparable|complex128|complex64|error|float32|float64|int|int16|int32|int64|int8|rune|string|uint|uint16|uint32|uint64|uint8|uintptr)$")) + (type_identifier) @type (field_identifier) @variable.other.member (identifier) @variable From 5691ada822a7c6e27f8890ee25f52a9262caddd2 Mon Sep 17 00:00:00 2001 From: VuiMuich Date: Mon, 5 Dec 2022 23:28:20 +0100 Subject: [PATCH 123/352] Change diff colors for serika themes (#5015) --- runtime/themes/serika-dark.toml | 2 +- runtime/themes/serika-light.toml | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/runtime/themes/serika-dark.toml b/runtime/themes/serika-dark.toml index 88e4cf6d5e82..2b4000ac215f 100644 --- a/runtime/themes/serika-dark.toml +++ b/runtime/themes/serika-dark.toml @@ -61,7 +61,7 @@ "diff.plus" = { fg = "green" } "diff.delta" = { fg = "orange" } -"diff.minus" = { fg = "red" } +"diff.minus" = { fg = "nasty-red" } "markup.heading" = { fg = "purple", modifiers = ["bold"] } "markup.list" = "cyan" diff --git a/runtime/themes/serika-light.toml b/runtime/themes/serika-light.toml index a00274bb9f60..ad830d92c148 100644 --- a/runtime/themes/serika-light.toml +++ b/runtime/themes/serika-light.toml @@ -59,9 +59,9 @@ "error" = "nasty-red" "diagnostic" = { fg = "nasty-red", modifiers = ["underlined"] } -"diff.plus" = { fg = "green" } -"diff.delta" = { fg = "orange" } -"diff.minus" = { fg = "red" } +"diff.plus" = { fg = "bg_green" +"diff.delta" = { fg = "bg_blue" } +"diff.minus" = { fg = "nasty-red" } "markup.heading" = { fg = "purple", modifiers = ["bold"] } "markup.list" = "cyan" @@ -72,7 +72,6 @@ "markup.quote" = { fg = "yellow", modifiers = ["italic"] } "markup.raw" = { fg = "fg" } - [palette] bg0 = "#e1e1e3" From 7210c58a51a16c0ae3c9d77211ed1a25e039bd9e Mon Sep 17 00:00:00 2001 From: nosa <96927121+n0s4@users.noreply.github.com> Date: Tue, 6 Dec 2022 01:13:41 +0000 Subject: [PATCH 124/352] Change default TS object bindings (#3782) * Change default TS object bindings Changes 'match inside/around' bindings for: - type definition from `c` to `t` - comments from `o` to `c` - tests from `t` to `T` Also changes those for the `]` / `[` bindings. * Update docs for changed keybinds Co-authored-by: Michael Davis --- book/src/keymap.md | 14 +++++++------- helix-term/src/commands.rs | 16 ++++++++-------- helix-term/src/keymap/default.rs | 12 ++++++------ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/book/src/keymap.md b/book/src/keymap.md index 6523b09fb88c..c3c09f4ca3b9 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -297,7 +297,7 @@ Displays documentation for item under cursor. | ---- | ----------- | | `Ctrl-u` | Scroll up | | `Ctrl-d` | Scroll down | - + #### Unimpaired Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaired). @@ -310,14 +310,14 @@ Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaire | `]D` | Go to last diagnostic in document (**LSP**) | `goto_last_diag` | | `]f` | Go to next function (**TS**) | `goto_next_function` | | `[f` | Go to previous function (**TS**) | `goto_prev_function` | -| `]c` | Go to next class (**TS**) | `goto_next_class` | -| `[c` | Go to previous class (**TS**) | `goto_prev_class` | +| `]t` | Go to next type definition (**TS**) | `goto_next_class` | +| `[t` | Go to previous type definition (**TS**) | `goto_prev_class` | | `]a` | Go to next argument/parameter (**TS**) | `goto_next_parameter` | | `[a` | Go to previous argument/parameter (**TS**) | `goto_prev_parameter` | -| `]o` | Go to next comment (**TS**) | `goto_next_comment` | -| `[o` | Go to previous comment (**TS**) | `goto_prev_comment` | -| `]t` | Go to next test (**TS**) | `goto_next_test` | -| `]t` | Go to previous test (**TS**) | `goto_prev_test` | +| `]c` | Go to next comment (**TS**) | `goto_next_comment` | +| `[c` | Go to previous comment (**TS**) | `goto_prev_comment` | +| `]T` | Go to next test (**TS**) | `goto_next_test` | +| `]T` | Go to previous test (**TS**) | `goto_prev_test` | | `]p` | Go to next paragraph | `goto_next_paragraph` | | `[p` | Go to previous paragraph | `goto_prev_paragraph` | | `[Space` | Add newline above | `add_newline_above` | diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 4cd271194959..31a2f58274d1 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -402,8 +402,8 @@ impl MappableCommand { select_textobject_inner, "Select inside object", goto_next_function, "Goto next function", goto_prev_function, "Goto previous function", - goto_next_class, "Goto next class", - goto_prev_class, "Goto previous class", + goto_next_class, "Goto next type definition", + goto_prev_class, "Goto previous type definition", goto_next_parameter, "Goto next parameter", goto_prev_parameter, "Goto previous parameter", goto_next_comment, "Goto next comment", @@ -4520,11 +4520,11 @@ fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) { match ch { 'w' => textobject::textobject_word(text, range, objtype, count, false), 'W' => textobject::textobject_word(text, range, objtype, count, true), - 'c' => textobject_treesitter("class", range), + 't' => textobject_treesitter("class", range), 'f' => textobject_treesitter("function", range), 'a' => textobject_treesitter("parameter", range), - 'o' => textobject_treesitter("comment", range), - 't' => textobject_treesitter("test", range), + 'c' => textobject_treesitter("comment", range), + 'T' => textobject_treesitter("test", range), 'p' => textobject::textobject_paragraph(text, range, objtype, count), 'm' => textobject::textobject_pair_surround_closest( text, range, objtype, count, @@ -4552,11 +4552,11 @@ fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) { ("w", "Word"), ("W", "WORD"), ("p", "Paragraph"), - ("c", "Class (tree-sitter)"), + ("t", "Type definition (tree-sitter)"), ("f", "Function (tree-sitter)"), ("a", "Argument/parameter (tree-sitter)"), - ("o", "Comment (tree-sitter)"), - ("t", "Test (tree-sitter)"), + ("c", "Comment (tree-sitter)"), + ("T", "Test (tree-sitter)"), ("m", "Closest surrounding pair to cursor"), (" ", "... or any character acting as a pair"), ]; diff --git a/helix-term/src/keymap/default.rs b/helix-term/src/keymap/default.rs index c0d17a87e065..b6d9ea1088c2 100644 --- a/helix-term/src/keymap/default.rs +++ b/helix-term/src/keymap/default.rs @@ -101,10 +101,10 @@ pub fn default() -> HashMap { "d" => goto_prev_diag, "D" => goto_first_diag, "f" => goto_prev_function, - "c" => goto_prev_class, + "t" => goto_prev_class, "a" => goto_prev_parameter, - "o" => goto_prev_comment, - "t" => goto_prev_test, + "c" => goto_prev_comment, + "T" => goto_prev_test, "p" => goto_prev_paragraph, "space" => add_newline_above, }, @@ -112,10 +112,10 @@ pub fn default() -> HashMap { "d" => goto_next_diag, "D" => goto_last_diag, "f" => goto_next_function, - "c" => goto_next_class, + "t" => goto_next_class, "a" => goto_next_parameter, - "o" => goto_next_comment, - "t" => goto_next_test, + "c" => goto_next_comment, + "T" => goto_next_test, "p" => goto_next_paragraph, "space" => add_newline_below, }, From 2077f5e26a4cdaadde4b505fc64eadb9e6849c0d Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Mon, 5 Dec 2022 19:29:40 -0600 Subject: [PATCH 125/352] Apply completion edits to all cursors (#4496) Completion edits - either basic `insert_text` strings or structured `text_edit`s - are assumed by the LSP spec to apply to the current cursor (or at least the trigger point). We can use the range (if any) and text given by the Language Server to create a transaction that changes all ranges in the current selection though, allowing auto- complete to affect multiple cursors. --- helix-lsp/src/lib.rs | 38 ++++++++++++++++++++++++++++++++- helix-term/src/ui/completion.rs | 31 +++++++++++++++++++++------ 2 files changed, 61 insertions(+), 8 deletions(-) diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index abc930f85bd6..f714395f28f5 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -57,7 +57,7 @@ pub enum OffsetEncoding { pub mod util { use super::*; - use helix_core::{diagnostic::NumberOrString, Range, Rope, Transaction}; + use helix_core::{diagnostic::NumberOrString, Range, Rope, Selection, Tendril, Transaction}; /// Converts a diagnostic in the document to [`lsp::Diagnostic`]. /// @@ -196,6 +196,42 @@ pub mod util { Some(Range::new(start, end)) } + /// Creates a [Transaction] from the [lsp::TextEdit] in a completion response. + /// The transaction applies the edit to all cursors. + pub fn generate_transaction_from_completion_edit( + doc: &Rope, + selection: &Selection, + edit: lsp::TextEdit, + offset_encoding: OffsetEncoding, + ) -> Transaction { + let replacement: Option = if edit.new_text.is_empty() { + None + } else { + Some(edit.new_text.into()) + }; + + let text = doc.slice(..); + let primary_cursor = selection.primary().cursor(text); + + let start_offset = match lsp_pos_to_pos(doc, edit.range.start, offset_encoding) { + Some(start) => start as i128 - primary_cursor as i128, + None => return Transaction::new(doc), + }; + let end_offset = match lsp_pos_to_pos(doc, edit.range.end, offset_encoding) { + Some(end) => end as i128 - primary_cursor as i128, + None => return Transaction::new(doc), + }; + + Transaction::change_by_selection(doc, selection, |range| { + let cursor = range.cursor(text); + ( + (cursor as i128 + start_offset) as usize, + (cursor as i128 + end_offset) as usize, + replacement.clone(), + ) + }) + } + pub fn generate_transaction_from_edits( doc: &Rope, mut edits: Vec, diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs index ebb4fb46ae66..c54990e8ec75 100644 --- a/helix-term/src/ui/completion.rs +++ b/helix-term/src/ui/completion.rs @@ -1,5 +1,5 @@ use crate::compositor::{Component, Context, Event, EventResult}; -use helix_view::{apply_transaction, editor::CompleteAction}; +use helix_view::{apply_transaction, editor::CompleteAction, ViewId}; use tui::buffer::Buffer as Surface; use tui::text::Spans; @@ -107,6 +107,7 @@ impl Completion { let menu = Menu::new(items, (), move |editor: &mut Editor, item, event| { fn item_to_transaction( doc: &Document, + view_id: ViewId, item: &CompletionItem, offset_encoding: helix_lsp::OffsetEncoding, start_offset: usize, @@ -121,9 +122,10 @@ impl Completion { } }; - util::generate_transaction_from_edits( + util::generate_transaction_from_completion_edit( doc.text(), - vec![edit], + doc.selection(view_id), + edit, offset_encoding, // TODO: should probably transcode in Client ) } else { @@ -132,10 +134,23 @@ impl Completion { // in these cases we need to check for a common prefix and remove it let prefix = Cow::from(doc.text().slice(start_offset..trigger_offset)); let text = text.trim_start_matches::<&str>(&prefix); - Transaction::change( - doc.text(), - vec![(trigger_offset, trigger_offset, Some(text.into()))].into_iter(), - ) + + // TODO: this needs to be true for the numbers to work out correctly + // in the closure below. It's passed in to a callback as this same + // formula, but can the value change between the LSP request and + // response? If it does, can we recover? + debug_assert!( + doc.selection(view_id) + .primary() + .cursor(doc.text().slice(..)) + == trigger_offset + ); + + Transaction::change_by_selection(doc.text(), doc.selection(view_id), |range| { + let cursor = range.cursor(doc.text().slice(..)); + + (cursor, cursor, Some(text.into())) + }) }; transaction @@ -164,6 +179,7 @@ impl Completion { let transaction = item_to_transaction( doc, + view.id, item, offset_encoding, start_offset, @@ -185,6 +201,7 @@ impl Completion { let transaction = item_to_transaction( doc, + view.id, item, offset_encoding, start_offset, From dbed90c5a65f435c7886f27b17cbad9cd8492355 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Dec 2022 10:30:04 +0900 Subject: [PATCH 126/352] build(deps): bump git-repository from 0.26.0 to 0.29.0 (#5016) Bumps [git-repository](https://github.com/Byron/gitoxide) from 0.26.0 to 0.29.0. - [Release notes](https://github.com/Byron/gitoxide/releases) - [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md) - [Commits](https://github.com/Byron/gitoxide/compare/git-repository-v0.26.0...git-repository-v0.29.0) --- updated-dependencies: - dependency-name: git-repository dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 132 +++++++++++++++++++++---------------------- helix-vcs/Cargo.toml | 2 +- 2 files changed, 67 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2e0211972bb6..a3746f569abd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -551,9 +551,9 @@ dependencies = [ [[package]] name = "git-actor" -version = "0.13.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d4ce09c0a6c71c044700e5932877667f427f007b77e6c39ab49aebc4719e25" +checksum = "ac9fb99c934ed45a62d9ae1e7b21949f2d869d1b82a07dcbf16ed61daa665870" dependencies = [ "bstr 1.0.1", "btoi", @@ -565,9 +565,9 @@ dependencies = [ [[package]] name = "git-attributes" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c62e66a042c6b39c6dbfa3be37d134900d99ff9c54bbe489ed560a573895d5d" +checksum = "82e98446a2bf0eb5c8f29fa828d6529510a6fadeb59ce14ca98e58fa7e1e0199" dependencies = [ "bstr 1.0.1", "compact_str", @@ -581,36 +581,36 @@ dependencies = [ [[package]] name = "git-bitmap" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327098a7ad27ae298d7e71602dbd4375cc828d755d10a720e4be0be1b4ec38f0" +checksum = "44304093ac66a0ada1b243c15c3a503a165a1d0f50bec748f4e5a9b84a0d0722" dependencies = [ "quick-error", ] [[package]] name = "git-chunk" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b2bc1635b660ad6e30379a84a4946590a3c124b747107c2cca1d9dbb98f588" +checksum = "3090baa2f4a3fe488a9b3e31090b83259aaf930bf0634af34c18117274f8f1a8" dependencies = [ "thiserror", ] [[package]] name = "git-command" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e4b01997b6551554fdac6f02277d0d04c3e869daa649bedd06d38c86f11dc42" +checksum = "a6b98a6312fef79b326c0a6e15d576c2bd30f7f9d0b7964998d166049e0d7b9e" dependencies = [ "bstr 1.0.1", ] [[package]] name = "git-config" -version = "0.10.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd8603e953bd4c9bf310e74e43697400f5542f1cc75fad46fbd7427135a9534f" +checksum = "bd1d13179bcf3dd68e83404f91a8d01c618f54eb97ef36c68ee5e6f30183a681" dependencies = [ "bstr 1.0.1", "git-config-value", @@ -629,9 +629,9 @@ dependencies = [ [[package]] name = "git-config-value" -version = "0.8.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f276bfe5806b414915112f1eec0f006206cdf5b8cc9bbb44ef7e52286dc3eb" +checksum = "64561e9700f1fc737fa3c1c4ea55293be70dba98e45c54cf3715cb180f37a566" dependencies = [ "bitflags", "bstr 1.0.1", @@ -642,9 +642,9 @@ dependencies = [ [[package]] name = "git-credentials" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f540186ea56fd075ba2b923180ebf4318e66ceaeac0a2a518e75dab8517d339" +checksum = "621dd60288ae7b8f80bb0704f46d4d2b76fc1ec980a7804e48b02d94a927e331" dependencies = [ "bstr 1.0.1", "git-command", @@ -658,9 +658,9 @@ dependencies = [ [[package]] name = "git-date" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37881e9725df41e15d16216d3a0cee251fd8a39d425f75b389112df5c7f20f3d" +checksum = "e33db9f4462b565a33507aee113f3383bf16b988d2c573f07691e34302b7aa0a" dependencies = [ "bstr 1.0.1", "itoa", @@ -670,9 +670,9 @@ dependencies = [ [[package]] name = "git-diff" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a88666a0ae4365b55a0cbf2efde68d2a4cff0747894ad229403bd60b0b2abc5" +checksum = "82f77407381267be95f1b26acfb32007258af342ee61729bb4271b1869bf5bb2" dependencies = [ "git-hash", "git-object", @@ -682,9 +682,9 @@ dependencies = [ [[package]] name = "git-discover" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881e4136d5599cfdb79d8ef60d650823d1a563589fa493d8e4961e64d78a79f2" +checksum = "2c2cfd1272824b126c6997ef479a71288d00fae14dc5144dfc48658f4dd24fbe" dependencies = [ "bstr 1.0.1", "git-hash", @@ -696,9 +696,9 @@ dependencies = [ [[package]] name = "git-features" -version = "0.23.1" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be88ae837674c71b30c6517c6f5f1335f8135bb8a9ffef20000d211933bed08" +checksum = "d7bdbe755d2129bc609437b6b18af1116f146128dda6070c15c0aa50201ac17c" dependencies = [ "crc32fast", "flate2", @@ -713,9 +713,9 @@ dependencies = [ [[package]] name = "git-glob" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d756430237112f8c89049236f60fdcdb0005127b1f7e531d40984e4fe7daa90" +checksum = "ef858611602fce54b51e45671ca72f07fe6a3c0e24a0539c66b75dfd4d84bd77" dependencies = [ "bitflags", "bstr 1.0.1", @@ -723,9 +723,9 @@ dependencies = [ [[package]] name = "git-hash" -version = "0.9.11" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d46e6c2d1e8da4438a87bf516a6761b300964a353541fea61e96b3c7b34554" +checksum = "1532d82bf830532f8d545c5b7b568e311e3593f16cf7ee9dd0ce03c74b12b99d" dependencies = [ "hex", "thiserror", @@ -733,9 +733,9 @@ dependencies = [ [[package]] name = "git-index" -version = "0.7.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "821583c2d12b1e864694eb0bf1cca10ff6a3f45966f5f834e0f921b496dbe7cb" +checksum = "a87c32d2e012ee316d4037b2151e5893599379ff1fc2c6adb36d2d4d1c461e2c" dependencies = [ "atoi", "bitflags", @@ -755,9 +755,9 @@ dependencies = [ [[package]] name = "git-lock" -version = "2.2.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0fe10bf961f62b1335b4c07785e64fb4d86c5ed367dc7cd9360f13c3eb7c78" +checksum = "89e4f05b8a68c3a5dd83a6651c76be384e910fe283072184fdab9d77f87ccec2" dependencies = [ "fastrand", "git-tempfile", @@ -766,9 +766,9 @@ dependencies = [ [[package]] name = "git-mailmap" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb3f85ce84b2328aeb3124a809f7b3a63e59c4d63c227dba7a9cdf6fca6c0987" +checksum = "480eecdfaf1bfd05973678520d182dc07afa25b133db18c52575fb65b782b7ba" dependencies = [ "bstr 1.0.1", "git-actor", @@ -777,9 +777,9 @@ dependencies = [ [[package]] name = "git-object" -version = "0.22.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9469a8c00d8bb500ee76a12e455bb174b4ddf71674713335dd1a84313723f7b3" +checksum = "ce0f14f9cd8f0782e843898a2fb7b0c2f5a6e37bd4cdff4409bb8ec698597dad" dependencies = [ "bstr 1.0.1", "btoi", @@ -796,9 +796,9 @@ dependencies = [ [[package]] name = "git-odb" -version = "0.35.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaaea7031ac7d8dfee232a16d7114395d118226214fb03fe4e15d1f4d62a88a6" +checksum = "13493da6cf0326454215414d29f933a1e26bdba3b9b60ad8cdcbe06f0639584b" dependencies = [ "arc-swap", "git-features", @@ -814,9 +814,9 @@ dependencies = [ [[package]] name = "git-pack" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc4386dff835ffdc3697c3558111f708fd7b7695c42a4347f2d211cf3246c8e1" +checksum = "fa8391cbf293f0f8ffbb5e324f25741f5e1e2d35fb87b89ab222a025661e0454" dependencies = [ "bytesize", "clru", @@ -838,9 +838,9 @@ dependencies = [ [[package]] name = "git-path" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "425dc1022690be13e6c5bde4b7e04d9504d323605ec314cd367cebf38a812572" +checksum = "5f60cbc13bc0fdd95df5f4b80437197e2853116792894b1bf38d1a6b4a64f8c9" dependencies = [ "bstr 1.0.1", "thiserror", @@ -848,9 +848,9 @@ dependencies = [ [[package]] name = "git-prompt" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa6947935c0671342277bc883ff0687978477b570c1ffe2200b9ba5ac8afdd9f" +checksum = "21c6aaeb3f0f8de91f5e0eb950282c6508e05babcedef768db5a6f085d6e5242" dependencies = [ "git-command", "git-config-value", @@ -861,9 +861,9 @@ dependencies = [ [[package]] name = "git-quote" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea17931d07cbe447f371bbdf45ff03c30ea86db43788166655a5302df87ecfc" +checksum = "1dd11f4e7f251ab297545faa4c5a4517f4985a43b9c16bf96fa49107f58e837f" dependencies = [ "bstr 1.0.1", "btoi", @@ -872,9 +872,9 @@ dependencies = [ [[package]] name = "git-ref" -version = "0.18.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "638c9e454bacb2965a43f05b4a383c8f66dc64f3a770bd0324b221c2a20e121d" +checksum = "22484043921e699edc170415789f1b882c8f3546e1fbbc447a0043ef07e088c4" dependencies = [ "git-actor", "git-features", @@ -891,9 +891,9 @@ dependencies = [ [[package]] name = "git-refspec" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9497af773538ae8cfda053ff7dd0a9e6c28d333ba653040f54b8b4ee32f14187" +checksum = "ac2e8f36e7d5d48903b60051dfb75aedfc4ea9ba66bdffa7a9081e8d276b0107" dependencies = [ "bstr 1.0.1", "git-hash", @@ -905,9 +905,9 @@ dependencies = [ [[package]] name = "git-repository" -version = "0.26.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb43e59612e493af6a433bf0a960de0042c8aa6f4e4c4cb414f03b97e296b82" +checksum = "a89cec253dd3fba44694f7468d907506a52d0055850ecd7d84f4bac07f00e73f" dependencies = [ "byte-unit", "clru", @@ -948,9 +948,9 @@ dependencies = [ [[package]] name = "git-revision" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efd31c63c3745b5dba5ec7109eec41a9c717f4e1e797fe0ef93098f33f31b25" +checksum = "e629289b0d7f7f2f2e46248527f5cac838e6a7cb9507eab06fc8473082db6cb6" dependencies = [ "bstr 1.0.1", "git-date", @@ -962,9 +962,9 @@ dependencies = [ [[package]] name = "git-sec" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c79769f6546814d0774db7295c768441016b7e40bdd414fa8dfae2c616a1892" +checksum = "1ecb370efde58da72827909292284b5c5b885e0621a342515a36976b0b3bf660" dependencies = [ "bitflags", "dirs", @@ -975,9 +975,9 @@ dependencies = [ [[package]] name = "git-tempfile" -version = "2.0.6" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d23bc6129de3cbd81e6c9d0d685b5540c6b41bd9fa0cc38f381bc300743d708" +checksum = "a6bb4dee86c8cae5a078cfaac3b004ef99c31548ed86218f23a7ff9b4b74f3be" dependencies = [ "dashmap", "libc", @@ -989,9 +989,9 @@ dependencies = [ [[package]] name = "git-traverse" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0c4dd773c69f294f43ace8373d48eb770129791f104c6857fa8cac0505af89" +checksum = "2d2746935c92d252e24f9d345e0a981510596faceb7edae821b9e4c8c35c285b" dependencies = [ "git-hash", "git-object", @@ -1001,9 +1001,9 @@ dependencies = [ [[package]] name = "git-url" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b7f8323196840e7932f5b60e1d9c1d6c140fd806bc512f8beedc3f990a1f81" +checksum = "7dbd91c55b1b03a833ff8278776fed272918cd61cd48efe9a97ad1fea7ef93ec" dependencies = [ "bstr 1.0.1", "git-features", @@ -1015,9 +1015,9 @@ dependencies = [ [[package]] name = "git-validate" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5439d6aa0de838dfadd74a71e97a9e23ebc719fd11a9ab6788b835b112c8c3d" +checksum = "cdf83bae632fc064ca938ebfb987364d9083b7f98b1476805f0a2d5eebb48686" dependencies = [ "bstr 1.0.1", "thiserror", @@ -1025,9 +1025,9 @@ dependencies = [ [[package]] name = "git-worktree" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45bcc69c36a29cfa283710b7901877ab251d658935f5a41ed824416af500e0ed" +checksum = "2eae0e0b1050208e611d5fac0d8366b29ef3f83849767ff9c4bcf570f0d5dc2b" dependencies = [ "bstr 1.0.1", "git-attributes", diff --git a/helix-vcs/Cargo.toml b/helix-vcs/Cargo.toml index c114666d26d5..e54cf828f51b 100644 --- a/helix-vcs/Cargo.toml +++ b/helix-vcs/Cargo.toml @@ -16,7 +16,7 @@ helix-core = { version = "0.6", path = "../helix-core" } tokio = { version = "1", features = ["rt", "rt-multi-thread", "time", "sync", "parking_lot", "macros"] } parking_lot = "0.12" -git-repository = { version = "0.26", default-features = false , optional = true } +git-repository = { version = "0.29", default-features = false , optional = true } imara-diff = "0.1.5" log = "0.4" From 952f292d252bdc135f10b1ffa52734d5242d2c60 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Dec 2022 10:30:11 +0900 Subject: [PATCH 127/352] build(deps): bump serde from 1.0.148 to 1.0.149 (#5017) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.148 to 1.0.149. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.148...v1.0.149) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] 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 a3746f569abd..014834e43349 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1804,18 +1804,18 @@ checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" [[package]] name = "serde" -version = "1.0.148" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc" +checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.148" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55492425aa53521babf6137309e7d34c20bbfbbfcfe2c7f3a047fd1f6b92c0c" +checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" dependencies = [ "proc-macro2", "quote", From 453a75a3739338348024b6c676231aef9ef6cb7b Mon Sep 17 00:00:00 2001 From: Narazaki Shuji Date: Tue, 6 Dec 2022 11:16:08 +0900 Subject: [PATCH 128/352] fix: align view after jumplist_picker (#3743) * Add `View::ensure_cursor_in_view_center` to adjust view after searching and jumping Also `offset_coodrs_to_in_view` was refactored to reduce duplicated position calculations. * Fix a wrong offset calculation in `offset_coords_to_in_view_center` It ignored `scrolloff` if `centering` is false. --- helix-term/src/commands.rs | 15 +++---- helix-view/src/view.rs | 89 +++++++++++++++++++++++++------------- 2 files changed, 67 insertions(+), 37 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 31a2f58274d1..263890269c41 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1667,12 +1667,7 @@ fn search_impl( }; doc.set_selection(view.id, selection); - // TODO: is_cursor_in_view does the same calculation as ensure_cursor_in_view - if view.is_cursor_in_view(doc, 0) { - view.ensure_cursor_in_view(doc, scrolloff); - } else { - align_view(doc, view, Align::Center) - } + view.ensure_cursor_in_view_center(doc, scrolloff); }; } @@ -2434,8 +2429,10 @@ fn jumplist_picker(cx: &mut Context) { (), |cx, meta, action| { cx.editor.switch(meta.id, action); + let config = cx.editor.config(); let (view, doc) = current!(cx.editor); doc.set_selection(view.id, meta.selection.clone()); + view.ensure_cursor_in_view_center(doc, config.scrolloff); }, |editor, meta| { let doc = &editor.documents.get(&meta.id)?; @@ -4205,6 +4202,7 @@ fn match_brackets(cx: &mut Context) { fn jump_forward(cx: &mut Context) { let count = cx.count(); + let config = cx.editor.config(); let view = view_mut!(cx.editor); let doc_id = view.doc; @@ -4218,12 +4216,13 @@ fn jump_forward(cx: &mut Context) { } doc.set_selection(view.id, selection); - align_view(doc, view, Align::Center); + view.ensure_cursor_in_view_center(doc, config.scrolloff); }; } fn jump_backward(cx: &mut Context) { let count = cx.count(); + let config = cx.editor.config(); let (view, doc) = current!(cx.editor); let doc_id = doc.id(); @@ -4237,7 +4236,7 @@ fn jump_backward(cx: &mut Context) { } doc.set_selection(view.id, selection); - align_view(doc, view, Align::Center); + view.ensure_cursor_in_view_center(doc, config.scrolloff); }; } diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs index ecc8e8beaa7b..c09d502dcaca 100644 --- a/helix-view/src/view.rs +++ b/helix-view/src/view.rs @@ -1,4 +1,4 @@ -use crate::{editor::GutterType, graphics::Rect, Document, DocumentId, ViewId}; +use crate::{align_view, editor::GutterType, graphics::Rect, Align, Document, DocumentId, ViewId}; use helix_core::{ pos_at_visual_coords, visual_coords_at_pos, Position, RopeSlice, Selection, Transaction, }; @@ -169,6 +169,15 @@ impl View { &self, doc: &Document, scrolloff: usize, + ) -> Option<(usize, usize)> { + self.offset_coords_to_in_view_center(doc, scrolloff, false) + } + + pub fn offset_coords_to_in_view_center( + &self, + doc: &Document, + scrolloff: usize, + centering: bool, ) -> Option<(usize, usize)> { let cursor = doc .selection(self.id) @@ -180,47 +189,69 @@ impl View { let inner_area = self.inner_area(doc); let last_line = (self.offset.row + inner_area.height as usize).saturating_sub(1); - - // - 1 so we have at least one gap in the middle. - // a height of 6 with padding of 3 on each side will keep shifting the view back and forth - // as we type - let scrolloff = scrolloff.min(inner_area.height.saturating_sub(1) as usize / 2); - let last_col = self.offset.col + inner_area.width.saturating_sub(1) as usize; - let row = if line > last_line.saturating_sub(scrolloff) { - // scroll down - self.offset.row + line - (last_line.saturating_sub(scrolloff)) - } else if line < self.offset.row + scrolloff { - // scroll up - line.saturating_sub(scrolloff) - } else { - self.offset.row + let new_offset = |scrolloff: usize| { + // - 1 so we have at least one gap in the middle. + // a height of 6 with padding of 3 on each side will keep shifting the view back and forth + // as we type + let scrolloff = scrolloff.min(inner_area.height.saturating_sub(1) as usize / 2); + + let row = if line > last_line.saturating_sub(scrolloff) { + // scroll down + self.offset.row + line - (last_line.saturating_sub(scrolloff)) + } else if line < self.offset.row + scrolloff { + // scroll up + line.saturating_sub(scrolloff) + } else { + self.offset.row + }; + + let col = if col > last_col.saturating_sub(scrolloff) { + // scroll right + self.offset.col + col - (last_col.saturating_sub(scrolloff)) + } else if col < self.offset.col + scrolloff { + // scroll left + col.saturating_sub(scrolloff) + } else { + self.offset.col + }; + (row, col) }; - - let col = if col > last_col.saturating_sub(scrolloff) { - // scroll right - self.offset.col + col - (last_col.saturating_sub(scrolloff)) - } else if col < self.offset.col + scrolloff { - // scroll left - col.saturating_sub(scrolloff) + let current_offset = (self.offset.row, self.offset.col); + if centering { + // return None if cursor is out of view + let offset = new_offset(0); + (offset == current_offset).then(|| { + if scrolloff == 0 { + offset + } else { + new_offset(scrolloff) + } + }) } else { - self.offset.col - }; - if row == self.offset.row && col == self.offset.col { - None - } else { - Some((row, col)) + // return None if cursor is in (view - scrolloff) + let offset = new_offset(scrolloff); + (offset != current_offset).then(|| offset) // TODO: use 'then_some' when 1.62 <= MSRV } } pub fn ensure_cursor_in_view(&mut self, doc: &Document, scrolloff: usize) { - if let Some((row, col)) = self.offset_coords_to_in_view(doc, scrolloff) { + if let Some((row, col)) = self.offset_coords_to_in_view_center(doc, scrolloff, false) { self.offset.row = row; self.offset.col = col; } } + pub fn ensure_cursor_in_view_center(&mut self, doc: &Document, scrolloff: usize) { + if let Some((row, col)) = self.offset_coords_to_in_view_center(doc, scrolloff, true) { + self.offset.row = row; + self.offset.col = col; + } else { + align_view(doc, self, Align::Center); + } + } + pub fn is_cursor_in_view(&mut self, doc: &Document, scrolloff: usize) -> bool { self.offset_coords_to_in_view(doc, scrolloff).is_none() } From af532147c97987d6170dc06a52aa3434ebf1b9d4 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Tue, 6 Dec 2022 15:18:33 +0100 Subject: [PATCH 129/352] Add command/keybinding to jump between hunks (#4650) * add command and keybding to jump to next/prev hunk * add textobject for change * Update helix-vcs/src/diff.rs Co-authored-by: Michael Davis * select entire hunk instead of first char * fix selection range Co-authored-by: Michael Davis --- book/src/keymap.md | 4 + book/src/usage.md | 1 + helix-term/src/commands.rs | 121 +++++++++++++++++++++++++++++++ helix-term/src/keymap/default.rs | 4 + helix-vcs/src/diff.rs | 81 +++++++++++++++++++++ 5 files changed, 211 insertions(+) diff --git a/book/src/keymap.md b/book/src/keymap.md index c3c09f4ca3b9..139e8fddf613 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -320,6 +320,10 @@ Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaire | `]T` | Go to previous test (**TS**) | `goto_prev_test` | | `]p` | Go to next paragraph | `goto_next_paragraph` | | `[p` | Go to previous paragraph | `goto_prev_paragraph` | +| `]g` | Go to next change | `goto_next_change` | +| `[g` | Go to previous change | `goto_prev_change` | +| `]G` | Go to first change | `goto_first_change` | +| `[G` | Go to last change | `goto_last_change` | | `[Space` | Add newline above | `add_newline_above` | | `]Space` | Add newline below | `add_newline_below` | diff --git a/book/src/usage.md b/book/src/usage.md index 646bf926d536..a6eb9ec1d4f1 100644 --- a/book/src/usage.md +++ b/book/src/usage.md @@ -143,6 +143,7 @@ though, we climb the syntax tree and then take the previous selection. So | `a` | Argument/parameter | | `o` | Comment | | `t` | Test | +| `g` | Change | > NOTE: `f`, `c`, etc need a tree-sitter grammar active for the current document and a special tree-sitter query file to work properly. [Only diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 263890269c41..1843e7a2be4e 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3,6 +3,7 @@ pub(crate) mod lsp; pub(crate) mod typed; pub use dap::*; +use helix_vcs::Hunk; pub use lsp::*; use tui::text::Spans; pub use typed::*; @@ -308,6 +309,10 @@ impl MappableCommand { goto_last_diag, "Goto last diagnostic", goto_next_diag, "Goto next diagnostic", goto_prev_diag, "Goto previous diagnostic", + goto_next_change, "Goto next change", + goto_prev_change, "Goto previous change", + goto_first_change, "Goto first change", + goto_last_change, "Goto last change", goto_line_start, "Goto line start", goto_line_end, "Goto line end", goto_next_buffer, "Goto next buffer", @@ -2912,6 +2917,100 @@ fn goto_prev_diag(cx: &mut Context) { goto_pos(editor, pos); } +fn goto_first_change(cx: &mut Context) { + goto_first_change_impl(cx, false); +} + +fn goto_last_change(cx: &mut Context) { + goto_first_change_impl(cx, true); +} + +fn goto_first_change_impl(cx: &mut Context, reverse: bool) { + let editor = &mut cx.editor; + let (_, doc) = current!(editor); + if let Some(handle) = doc.diff_handle() { + let hunk = { + let hunks = handle.hunks(); + let idx = if reverse { + hunks.len().saturating_sub(1) + } else { + 0 + }; + hunks.nth_hunk(idx) + }; + if hunk != Hunk::NONE { + let pos = doc.text().line_to_char(hunk.after.start as usize); + goto_pos(editor, pos) + } + } +} + +fn goto_next_change(cx: &mut Context) { + goto_next_change_impl(cx, Direction::Forward) +} + +fn goto_prev_change(cx: &mut Context) { + goto_next_change_impl(cx, Direction::Backward) +} + +fn goto_next_change_impl(cx: &mut Context, direction: Direction) { + let count = cx.count() as u32 - 1; + let motion = move |editor: &mut Editor| { + let (view, doc) = current!(editor); + let doc_text = doc.text().slice(..); + let diff_handle = if let Some(diff_handle) = doc.diff_handle() { + diff_handle + } else { + editor.set_status("Diff is not available in current buffer"); + return; + }; + + let selection = doc.selection(view.id).clone().transform(|range| { + let cursor_line = range.cursor_line(doc_text) as u32; + + let hunks = diff_handle.hunks(); + let hunk_idx = match direction { + Direction::Forward => hunks + .next_hunk(cursor_line) + .map(|idx| (idx + count).min(hunks.len() - 1)), + Direction::Backward => hunks + .prev_hunk(cursor_line) + .map(|idx| idx.saturating_sub(count)), + }; + // TODO refactor with let..else once MSRV reaches 1.65 + let hunk_idx = if let Some(hunk_idx) = hunk_idx { + hunk_idx + } else { + return range; + }; + let hunk = hunks.nth_hunk(hunk_idx); + + let hunk_start = doc_text.line_to_char(hunk.after.start as usize); + let hunk_end = if hunk.after.is_empty() { + hunk_start + 1 + } else { + doc_text.line_to_char(hunk.after.end as usize) + }; + let new_range = Range::new(hunk_start, hunk_end); + if editor.mode == Mode::Select { + let head = if new_range.head < range.anchor { + new_range.anchor + } else { + new_range.head + }; + + Range::new(range.anchor, head) + } else { + new_range.with_direction(direction) + } + }); + + doc.set_selection(view.id, selection) + }; + motion(cx.editor); + cx.editor.last_motion = Some(Motion(Box::new(motion))); +} + pub mod insert { use super::*; pub type Hook = fn(&Rope, &Selection, char) -> Option; @@ -4515,6 +4614,27 @@ fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) { ) }; + if ch == 'g' && doc.diff_handle().is_none() { + editor.set_status("Diff is not available in current buffer"); + return; + } + + let textobject_change = |range: Range| -> Range { + let diff_handle = doc.diff_handle().unwrap(); + let hunks = diff_handle.hunks(); + let line = range.cursor_line(text); + let hunk_idx = if let Some(hunk_idx) = hunks.hunk_at(line as u32, false) { + hunk_idx + } else { + return range; + }; + let hunk = hunks.nth_hunk(hunk_idx).after; + + let start = text.line_to_char(hunk.start as usize); + let end = text.line_to_char(hunk.end as usize); + Range::new(start, end).with_direction(range.direction()) + }; + let selection = doc.selection(view.id).clone().transform(|range| { match ch { 'w' => textobject::textobject_word(text, range, objtype, count, false), @@ -4528,6 +4648,7 @@ fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) { 'm' => textobject::textobject_pair_surround_closest( text, range, objtype, count, ), + 'g' => textobject_change(range), // TODO: cancel new ranges if inconsistent surround matches across lines ch if !ch.is_ascii_alphanumeric() => { textobject::textobject_pair_surround(text, range, objtype, ch, count) diff --git a/helix-term/src/keymap/default.rs b/helix-term/src/keymap/default.rs index b6d9ea1088c2..ebcd125aa129 100644 --- a/helix-term/src/keymap/default.rs +++ b/helix-term/src/keymap/default.rs @@ -100,6 +100,8 @@ pub fn default() -> HashMap { "[" => { "Left bracket" "d" => goto_prev_diag, "D" => goto_first_diag, + "g" => goto_prev_change, + "G" => goto_first_change, "f" => goto_prev_function, "t" => goto_prev_class, "a" => goto_prev_parameter, @@ -111,6 +113,8 @@ pub fn default() -> HashMap { "]" => { "Right bracket" "d" => goto_next_diag, "D" => goto_last_diag, + "g" => goto_next_change, + "G" => goto_last_change, "f" => goto_next_function, "t" => goto_next_class, "a" => goto_next_parameter, diff --git a/helix-vcs/src/diff.rs b/helix-vcs/src/diff.rs index b1acd1f29937..9c6a362f7db8 100644 --- a/helix-vcs/src/diff.rs +++ b/helix-vcs/src/diff.rs @@ -195,4 +195,85 @@ impl FileHunks<'_> { pub fn is_empty(&self) -> bool { self.len() == 0 } + + pub fn next_hunk(&self, line: u32) -> Option { + let hunk_range = if self.inverted { + |hunk: &Hunk| hunk.before.clone() + } else { + |hunk: &Hunk| hunk.after.clone() + }; + + let res = self + .hunks + .binary_search_by_key(&line, |hunk| hunk_range(hunk).start); + + match res { + // Search found a hunk that starts exactly at this line, return the next hunk if it exists. + Ok(pos) if pos + 1 == self.hunks.len() => None, + Ok(pos) => Some(pos as u32 + 1), + + // No hunk starts exactly at this line, so the search returns + // the position where a hunk starting at this line should be inserted. + // That position is exactly the position of the next hunk or the end + // of the list if no such hunk exists + Err(pos) if pos == self.hunks.len() => None, + Err(pos) => Some(pos as u32), + } + } + + pub fn prev_hunk(&self, line: u32) -> Option { + let hunk_range = if self.inverted { + |hunk: &Hunk| hunk.before.clone() + } else { + |hunk: &Hunk| hunk.after.clone() + }; + let res = self + .hunks + .binary_search_by_key(&line, |hunk| hunk_range(hunk).end); + + match res { + // Search found a hunk that ends exactly at this line (so it does not include the current line). + // We can usually just return that hunk, however a special case for empty hunk is necessary + // which represents a pure removal. + // Removals are technically empty but are still shown as single line hunks + // and as such we must jump to the previous hunk (if it exists) if we are already inside the removal + Ok(pos) if !hunk_range(&self.hunks[pos]).is_empty() => Some(pos as u32), + + // No hunk ends exactly at this line, so the search returns + // the position where a hunk ending at this line should be inserted. + // That position before this one is exactly the position of the previous hunk + Err(0) | Ok(0) => None, + Err(pos) | Ok(pos) => Some(pos as u32 - 1), + } + } + + pub fn hunk_at(&self, line: u32, include_removal: bool) -> Option { + let hunk_range = if self.inverted { + |hunk: &Hunk| hunk.before.clone() + } else { + |hunk: &Hunk| hunk.after.clone() + }; + + let res = self + .hunks + .binary_search_by_key(&line, |hunk| hunk_range(hunk).start); + + match res { + // Search found a hunk that starts exactly at this line, return it + Ok(pos) => Some(pos as u32), + + // No hunk starts exactly at this line, so the search returns + // the position where a hunk starting at this line should be inserted. + // The previous hunk contains this hunk if it exists and doesn't end before this line + Err(0) => None, + Err(pos) => { + let hunk = hunk_range(&self.hunks[pos - 1]); + if hunk.end > line || include_removal && hunk.start == line && hunk.is_empty() { + Some(pos as u32 - 1) + } else { + None + } + } + } + } } From e9d43c284bb717e3de5aec7312d985a088ede7ea Mon Sep 17 00:00:00 2001 From: Kristoffer Flottorp <2630397+krfl@users.noreply.github.com> Date: Wed, 7 Dec 2022 02:08:34 +0100 Subject: [PATCH 130/352] Fleetish theme renamed to fleet dark and adjusted to match official theme. (#4997) * remove fleetish.toml * add fleet_dark.toml * adjust colors for tags and markup lists * Add type.enum.variant * correct color for focused elements * adjust builtins and keywords Co-authored-by: krfl --- .../themes/{fleetish.toml => fleet_dark.toml} | 93 ++++++++++--------- 1 file changed, 51 insertions(+), 42 deletions(-) rename runtime/themes/{fleetish.toml => fleet_dark.toml} (52%) diff --git a/runtime/themes/fleetish.toml b/runtime/themes/fleet_dark.toml similarity index 52% rename from runtime/themes/fleetish.toml rename to runtime/themes/fleet_dark.toml index 159daf8785d0..f885e4eb6542 100644 --- a/runtime/themes/fleetish.toml +++ b/runtime/themes/fleet_dark.toml @@ -1,8 +1,13 @@ -# Author: Kristoffer Flottorp -# A take on the JetBrains Fleet theme sprinkled with some creative freedom +# Fleet Dark +# A take on the JetBrains Fleet theme. Feel free to contribute +# Original author: @krfl +# Contributors: +# @matoous + +"attribute" = "green" "type" = "light_blue" -"type.builtin" = "orange" +"type.enum.variant" = "purple" "constructor" = "yellow" "constant" = "cyan" # "constant.builtin" = {} # .boolean @@ -16,55 +21,55 @@ "comment" = "light_gray" # .line # "comment.block" = {} # .documentation "variable" = "light" # .builtin +"variable.builtin" = { fg = "red", modifiers = ["underlined"] } "variable.parameter" = "light" # "variable.other" = {} # .member -"variable.other.member" = "yellow" +"variable.other.member" = "purple" "label" = "yellow" "punctuation" = "light" # .delimiter / .bracket "keyword" = "cyan" # .operator / .directive / .function -"keyword.control" = "yellow" # .conditional / .repeat / .import / .return / .exception +# "keyword.control" = "cyan" # .conditional / .repeat / .import / .return / .exception +"keyword.control.exception" = "purple" "operator" = "light" "function" = "yellow" "function.macro" = "green" "function.builtin" = "green" "function.special" = "green" "function.method" = "light" -"tag" = "green" +#"function.declaration.method" = { fg = "lightest", modifiers = ["bold"] } #depends on #4892 +"tag" = "light_blue" "special" = "green" "namespace" = "light" # used in theming +# "markup" = {} # .normal / .quote / .raw # "markup.normal" = {} # .completion / .hover -# "markup.raw.inline" = {} # .completion / .hover -"markup" = "purple" # .quote -"markup.bold" = { fg = "purple", modifiers = ["bold"] } -"markup.italic" = { fg = "purple", modifiers = ["italic"] } -"markup.heading" = "light" # .marker -"markup.heading.1" = "yellow" -"markup.heading.2" = "green" -"markup.heading.3" = "pink" -"markup.heading.4" = "purple" -"markup.heading.5" = "cyan" -"markup.heading.6" = "light_blue" -"markup.list" = "cyan" # .unnumbered / .numbered -"markup.link" = "green" -"markup.link.url" = "pink" +"markup.bold" = { fg = "lightest", modifiers = ["bold"] } +"markup.italic" = { modifiers = ["italic"] } +"markup.heading" = { fg = "cyan", modifiers = ["bold"] } # .marker / .1 / .2 / .3 / .4 / .5 / .6 +"markup.list" = "pink" # .unnumbered / .numbered +"markup.list.numbered" = "cyan" +"markup.list.unnumbered" = "cyan" +# "markup.link" = "green" +"markup.link.url" = { fg = "pink", modifiers = ['italic', 'underlined'] } "markup.link.text" = "cyan" -"markup.link.label" = "yellow" -"markup.raw" = "pink" # .inline -"markup.raw.block" = "orange" +"markup.link.label" = "purple" +"markup.quote" = "pink" +"markup.raw" = "pink" +"markup.raw.inline" = "cyan" # .completion / .hover +"markup.raw.block" = "pink" -"diff.plus" = "cyan" -"diff.minus" = "yellow" -"diff.delta" = "purple" +"diff.plus" = "diff_plus" +"diff.minus" = "red_accent" +"diff.delta" = "blue_accent" # ui specific -"ui.background" = { bg = "#0d0d0d" } # .separator +"ui.background" = { bg = "background" } # .separator "ui.cursor" = { bg = "dark_gray", modifiers = ["reversed"] } # .insert / .select / .match / .primary -"ui.cursor.match" = { fg = "light", bg = "blue_accent" } # .insert / .select / .match / .primary +"ui.cursor.match" = { fg = "light", bg = "selection" } # .insert / .select / .match / .primary "ui.cursorline" = { bg = "darker" } "ui.linenr" = "dark_gray" -"ui.linenr.selected" = { fg = "light_gray", bg = "darker" } +"ui.linenr.selected" = { fg = "light", bg = "darker" } "ui.statusline" = { fg = "light", bg = "darker" } # .inactive / .normal / .insert / .select "ui.statusline.inactive" = { fg = "dark", bg = "darker" } "ui.statusline.normal" = { fg = "lightest", bg = "darker"} @@ -74,27 +79,28 @@ "ui.window" = { fg = "dark", bg = "darkest" } "ui.help" = { fg = "light", bg = "darkest" } "ui.text" = "light" # .focus / .info +"ui.text.focus" = { fg = "lightest", bg = "focus" } "ui.virtual" = "dark" # .whitespace "ui.virtual.ruler" = { bg = "darker"} -"ui.menu" = { fg = "light", bg = "darker" } # .selected -"ui.menu.selected" = { fg = "lightest", bg = "blue_accent" } # .selected +"ui.menu" = { fg = "light", bg = "darkest" } # .selected +"ui.menu.selected" = { fg = "lightest", bg = "focus" } # .selected "ui.selection" = { bg = "darker" } # .primary -"ui.selection.primary" = { bg = "select" } # .primary +"ui.selection.primary" = { bg = "selection" } "hint" = "blue" "info" = "yellow_accent" "warning" = "orange_accent" -"error" = "red" +"error" = "red_error" "diagnostic" = { modifiers = [] } -"diagnostic.hint" = { underline = { color = "light", style = "curl" } } -"diagnostic.info" = { underline = { color = "blue", style = "curl" } } -"diagnostic.warning" = { underline = { color = "yellow", style = "curl" } } -"diagnostic.error" = { underline = { color = "red", style = "curl" } } +"diagnostic.hint" = { underline = { color = "light", style = "line" } } +"diagnostic.info" = { underline = { color = "blue_accent", style = "line" } } +"diagnostic.warning" = { underline = { color = "yellow_accent", style = "line" } } +"diagnostic.error" = { underline = { color = "red_error", style = "line" } } [palette] +background = "#181818" darkest = "#1e1e1e" -darker = "#262626" +darker = "#292929" dark = "#898989" -select = "#102f5b" light = "#d6d6dd" lightest = "#ffffff" @@ -109,13 +115,16 @@ green = "#afcb85" cyan = "#78d0bd" orange = "#efb080" yellow = "#e5c995" -red = "#f44747" +red = "#CC7C8A" blue_accent = "#2197F3" pink_accent = "#E44C7A" green_accent = "#00AF99" orange_accent = "#EE7F25" yellow_accent = "#DEA407" +red_accent = "#F44747" -# variables intended for future updates -checkmark = "#44B254" +red_error = "#EB5F6A" +selection = "#1F3661" +diff_plus = "#5A9F81" +focus = "#204474" From d3f670c0e2d8800bfeacb76a5b96753ac6529170 Mon Sep 17 00:00:00 2001 From: Jonathan LEI Date: Wed, 7 Dec 2022 10:11:45 +0800 Subject: [PATCH 131/352] Use OSC 52 for tmux copy (#5027) --- helix-view/src/clipboard.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-view/src/clipboard.rs b/helix-view/src/clipboard.rs index 19fade69c7b6..4f83fb4dc693 100644 --- a/helix-view/src/clipboard.rs +++ b/helix-view/src/clipboard.rs @@ -136,7 +136,7 @@ pub fn get_clipboard_provider() -> Box { } else if env_var_is_set("TMUX") && binary_exists("tmux") { command_provider! { paste => "tmux", "save-buffer", "-"; - copy => "tmux", "load-buffer", "-"; + copy => "tmux", "load-buffer", "-w", "-"; } } else { Box::new(provider::FallbackProvider::new()) From 96ff64a84a4948b0aa85a453276cb0091fb9c792 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 6 Dec 2022 20:54:50 -0600 Subject: [PATCH 132/352] Add changelog notes for 22.12 (#4822) * Add changelog notes for 22.12 * Bump VERSION to 22.12 --- CHANGELOG.md | 286 +++++++++++++++++++++++++++++++++++++++++++++++++++ VERSION | 2 +- 2 files changed, 287 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56d85751b940..dc91c9ff33a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,289 @@ +# 22.12 (2022-12-06) + +This is a great big release filled with changes from a 99 contributors. A big _thank you_ to you all! + +As usual, the following is a summary of each of the changes since the last release. +For the full log, check out the [git log](https://github.com/helix-editor/helix/compare/22.08.1..22.12). + +Breaking changes: + +- Remove readline-like navigation bindings from the default insert mode keymap ([e12690e](https://github.com/helix-editor/helix/commit/e12690e), [#3811](https://github.com/helix-editor/helix/pull/3811), [#3827](https://github.com/helix-editor/helix/pull/3827), [#3915](https://github.com/helix-editor/helix/pull/3915), [#4088](https://github.com/helix-editor/helix/pull/4088)) +- Rename `append_to_line` as `insert_at_line_end` and `prepend_to_line` as `insert_at_line_start` ([#3753](https://github.com/helix-editor/helix/pull/3753)) +- Swap diagnostic picker and debug mode bindings in the space keymap ([#4229](https://github.com/helix-editor/helix/pull/4229)) +- Select newly inserted text on paste or from shell commands ([#4458](https://github.com/helix-editor/helix/pull/4458), [#4608](https://github.com/helix-editor/helix/pull/4608), [#4619](https://github.com/helix-editor/helix/pull/4619), [#4824](https://github.com/helix-editor/helix/pull/4824)) +- Select newly inserted surrounding characters on `ms` ([#4752](https://github.com/helix-editor/helix/pull/4752)) +- Exit select-mode after executing `replace_*` commands ([#4554](https://github.com/helix-editor/helix/pull/4554)) +- Exit select-mode after executing surround commands ([#4858](https://github.com/helix-editor/helix/pull/4858)) +- Change tree-sitter text-object keys ([#3782](https://github.com/helix-editor/helix/pull/3782)) +- Rename `fleetish` theme to `fleet_dark` ([#4997](https://github.com/helix-editor/helix/pull/4997)) + +Features: + +- Bufferline ([#2759](https://github.com/helix-editor/helix/pull/2759)) +- Support underline styles and colors ([#4061](https://github.com/helix-editor/helix/pull/4061), [98c121c](https://github.com/helix-editor/helix/commit/98c121c)) +- Inheritance for themes ([#3067](https://github.com/helix-editor/helix/pull/3067), [#4096](https://github.com/helix-editor/helix/pull/4096)) +- Cursorcolumn ([#4084](https://github.com/helix-editor/helix/pull/4084)) +- Overhauled system for writing files and quiting ([#2267](https://github.com/helix-editor/helix/pull/2267), [#4397](https://github.com/helix-editor/helix/pull/4397)) +- Autosave when terminal loses focus ([#3178](https://github.com/helix-editor/helix/pull/3178)) +- Use OSC52 as a fallback for the system clipboard ([#3220](https://github.com/helix-editor/helix/pull/3220)) +- Show git diffs in the gutter ([#3890](https://github.com/helix-editor/helix/pull/3890), [#5012](https://github.com/helix-editor/helix/pull/5012), [#4995](https://github.com/helix-editor/helix/pull/4995)) +- Add a logo ([dc1ec56](https://github.com/helix-editor/helix/commit/dc1ec56)) +- Multi-cursor completion ([#4496](https://github.com/helix-editor/helix/pull/4496)) + +Commands: + +- `file_picker_in_current_directory` (`F`) ([#3701](https://github.com/helix-editor/helix/pull/3701)) +- `:lsp-restart` to restart the current document's language server ([#3435](https://github.com/helix-editor/helix/pull/3435), [#3972](https://github.com/helix-editor/helix/pull/3972)) +- `join_selections_space` (`A-j`) which joins selections and selects the joining whitespace ([#3549](https://github.com/helix-editor/helix/pull/3549)) +- `:update` to write the current file if it is modified ([#4426](https://github.com/helix-editor/helix/pull/4426)) +- `:lsp-workspace-command` for picking LSP commands to execute ([#3140](https://github.com/helix-editor/helix/pull/3140)) +- `extend_prev_word_end` - the extend variant for `move_prev_word_end` ([7468fa2](https://github.com/helix-editor/helix/commit/7468fa2)) +- `make_search_word_bounded` which adds regex word boundaries to the current search register value ([#4322](https://github.com/helix-editor/helix/pull/4322)) +- `:reload-all` - `:reload` for all open buffers ([#4663](https://github.com/helix-editor/helix/pull/4663), [#4901](https://github.com/helix-editor/helix/pull/4901)) +- `goto_next_change` (`]g`), `goto_prev_change` (`[g`), `goto_first_change` (`[G`), `goto_last_change` (`]G`) textobjects for jumping between VCS changes ([#4650](https://github.com/helix-editor/helix/pull/4650)) + +Usability improvements and fixes: + +- Don't log 'LSP not defined' errors in the logfile ([1caba2d](https://github.com/helix-editor/helix/commit/1caba2d)) +- Look for the external formatter program before invoking it ([#3670](https://github.com/helix-editor/helix/pull/3670)) +- Don't send LSP didOpen events for documents without URLs ([44b4479](https://github.com/helix-editor/helix/commit/44b4479)) +- Fix off-by-one in `extend_line_above` command ([#3689](https://github.com/helix-editor/helix/pull/3689)) +- Use the original scroll offset when opening a split ([1acdfaa](https://github.com/helix-editor/helix/commit/1acdfaa)) +- Handle auto-formatting failures and save the file anyway ([#3684](https://github.com/helix-editor/helix/pull/3684)) +- Ensure the cursor is in view after `:reflow` ([#3733](https://github.com/helix-editor/helix/pull/3733)) +- Add default rulers and reflow config for git commit messages ([#3738](https://github.com/helix-editor/helix/pull/3738)) +- Improve grammar fetching and building output ([#3773](https://github.com/helix-editor/helix/pull/3773)) +- Add a `text` language to language completion ([cc47d3f](https://github.com/helix-editor/helix/commit/cc47d3f)) +- Improve error handling for `:set-language` ([e8add6f](https://github.com/helix-editor/helix/commit/e8add6f)) +- Improve error handling for `:config-reload` ([#3668](https://github.com/helix-editor/helix/pull/3668)) +- Improve error handling when passing improper ranges to syntax highlighting ([#3826](https://github.com/helix-editor/helix/pull/3826)) +- Render `` tags as raw markup in markdown ([#3425](https://github.com/helix-editor/helix/pull/3425)) +- Remove border around the LSP code-actions popup ([#3444](https://github.com/helix-editor/helix/pull/3444)) +- Canonicalize the path to the runtime directory ([#3794](https://github.com/helix-editor/helix/pull/3794)) +- Add a `themelint` xtask for linting themes ([#3234](https://github.com/helix-editor/helix/pull/3234)) +- Re-sort LSP diagnostics after applying transactions ([#3895](https://github.com/helix-editor/helix/pull/3895), [#4319](https://github.com/helix-editor/helix/pull/4319)) +- Add a command-line flag to specify the log file ([#3807](https://github.com/helix-editor/helix/pull/3807)) +- Track source and tag information in LSP diagnostics ([#3898](https://github.com/helix-editor/helix/pull/3898), [1df32c9](https://github.com/helix-editor/helix/commit/1df32c9)) +- Fix theme returning to normal when exiting the `:theme` completion ([#3644](https://github.com/helix-editor/helix/pull/3644)) +- Improve error messages for invalid commands in the keymap ([#3931](https://github.com/helix-editor/helix/pull/3931)) +- Deduplicate regexs in `search_selection` command ([#3941](https://github.com/helix-editor/helix/pull/3941)) +- Split the finding of LSP root and config roots ([#3929](https://github.com/helix-editor/helix/pull/3929)) +- Ensure that the cursor is within view after auto-formatting ([#4047](https://github.com/helix-editor/helix/pull/4047)) +- Add pseudo-pending to commands with on-next-key callbacks ([#4062](https://github.com/helix-editor/helix/pull/4062), [#4077](https://github.com/helix-editor/helix/pull/4077)) +- Add live preview to `:goto` ([#2982](https://github.com/helix-editor/helix/pull/2982)) +- Show regex compilation failure in a popup ([#3049](https://github.com/helix-editor/helix/pull/3049)) +- Add 'cycled to end' and 'no more matches' for search ([#3176](https://github.com/helix-editor/helix/pull/3176), [#4101](https://github.com/helix-editor/helix/pull/4101)) +- Add extending behavior to tree-sitter textobjects ([#3266](https://github.com/helix-editor/helix/pull/3266)) +- Add `ui.gutter.selected` option for themes ([#3303](https://github.com/helix-editor/helix/pull/3303)) +- Make statusline mode names configurable ([#3311](https://github.com/helix-editor/helix/pull/3311)) +- Add a statusline element for total line count ([#3960](https://github.com/helix-editor/helix/pull/3960)) +- Add extending behavior to `goto_window_*` commands ([#3985](https://github.com/helix-editor/helix/pull/3985)) +- Fix a panic in signature help when the preview is too large ([#4030](https://github.com/helix-editor/helix/pull/4030)) +- Add command names to the command palette ([#4071](https://github.com/helix-editor/helix/pull/4071), [#4223](https://github.com/helix-editor/helix/pull/4223), [#4495](https://github.com/helix-editor/helix/pull/4495)) +- Find the LSP workspace root from the current document's path ([#3553](https://github.com/helix-editor/helix/pull/3553)) +- Add an option to skip indent-guide levels ([#3819](https://github.com/helix-editor/helix/pull/3819), [2c36e33](https://github.com/helix-editor/helix/commit/2c36e33)) +- Change focus to modified docs on quit ([#3872](https://github.com/helix-editor/helix/pull/3872)) +- Respond to `USR1` signal by reloading config ([#3952](https://github.com/helix-editor/helix/pull/3952)) +- Exit gracefully when the close operation fails ([#4081](https://github.com/helix-editor/helix/pull/4081)) +- Fix goto/view center mismatch ([#4135](https://github.com/helix-editor/helix/pull/4135)) +- Highlight the current file picker document on idle-timeout ([#3172](https://github.com/helix-editor/helix/pull/3172), [a85e386](https://github.com/helix-editor/helix/commit/a85e386)) +- Apply transactions to jumplist selections ([#4186](https://github.com/helix-editor/helix/pull/4186), [#4227](https://github.com/helix-editor/helix/pull/4227), [#4733](https://github.com/helix-editor/helix/pull/4733), [#4865](https://github.com/helix-editor/helix/pull/4865), [#4912](https://github.com/helix-editor/helix/pull/4912), [#4965](https://github.com/helix-editor/helix/pull/4965), [#4981](https://github.com/helix-editor/helix/pull/4981)) +- Use space as a separator for fuzzy matcher ([#3969](https://github.com/helix-editor/helix/pull/3969)) +- Overlay all diagnostics with highest severity on top ([#4113](https://github.com/helix-editor/helix/pull/4113)) +- Avoid re-parsing unmodified tree-sitter injections ([#4146](https://github.com/helix-editor/helix/pull/4146)) +- Add extending captures for indentation, re-enable python indentation ([#3382](https://github.com/helix-editor/helix/pull/3382), [3e84434](https://github.com/helix-editor/helix/commit/3e84434)) +- Only allow either `--vsplit` or `--hsplit` CLI flags at once ([#4202](https://github.com/helix-editor/helix/pull/4202)) +- Fix append cursor location when selection anchor is at the end of the document ([#4147](https://github.com/helix-editor/helix/pull/4147)) +- Improve selection yanking message ([#4275](https://github.com/helix-editor/helix/pull/4275)) +- Log failures to load tree-sitter grammars as errors ([#4315](https://github.com/helix-editor/helix/pull/4315)) +- Fix rendering of lines longer than 65,536 columns ([#4172](https://github.com/helix-editor/helix/pull/4172)) +- Skip searching `.git` in `global_search` ([#4334](https://github.com/helix-editor/helix/pull/4334)) +- Display tree-sitter scopes in a popup ([#4337](https://github.com/helix-editor/helix/pull/4337)) +- Fix deleting a word from the end of the buffer ([#4328](https://github.com/helix-editor/helix/pull/4328)) +- Pretty print the syntax tree in `:tree-sitter-subtree` ([#4295](https://github.com/helix-editor/helix/pull/4295), [#4606](https://github.com/helix-editor/helix/pull/4606)) +- Allow specifying suffixes for file-type detection ([#2455](https://github.com/helix-editor/helix/pull/2455), [#4414](https://github.com/helix-editor/helix/pull/4414)) +- Fix multi-byte auto-pairs ([#4024](https://github.com/helix-editor/helix/pull/4024)) +- Improve sort scoring for LSP code-actions and completions ([#4134](https://github.com/helix-editor/helix/pull/4134)) +- Fix the handling of quotes within shellwords ([#4098](https://github.com/helix-editor/helix/pull/4098)) +- Fix `delete_word_backward` and `delete_word_forward` on newlines ([#4392](https://github.com/helix-editor/helix/pull/4392)) +- Fix 'no entry found for key' crash on `:write-all` ([#4384](https://github.com/helix-editor/helix/pull/4384)) +- Remove lowercase requirement for tree-sitter grammars ([#4346](https://github.com/helix-editor/helix/pull/4346)) +- Resolve LSP completion items on idle-timeout ([#4406](https://github.com/helix-editor/helix/pull/4406), [#4797](https://github.com/helix-editor/helix/pull/4797)) +- Render diagnostics in the file picker preview ([#4324](https://github.com/helix-editor/helix/pull/4324)) +- Fix terminal freezing on `shell_insert_output` ([#4156](https://github.com/helix-editor/helix/pull/4156)) +- Allow use of the count in the repeat operator (`.`) ([#4450](https://github.com/helix-editor/helix/pull/4450)) +- Show the current theme name on `:theme` with no arguments ([#3740](https://github.com/helix-editor/helix/pull/3740)) +- Fix rendering in very large terminals ([#4318](https://github.com/helix-editor/helix/pull/4318)) +- Sort LSP preselected items to the top of the completion menu ([#4480](https://github.com/helix-editor/helix/pull/4480)) +- Trim braces and quotes from paths in goto-file ([#4370](https://github.com/helix-editor/helix/pull/4370)) +- Prevent automatic signature help outside of insert mode ([#4456](https://github.com/helix-editor/helix/pull/4456)) +- Fix freezes with external programs that process stdin and stdout concurrently ([#4180](https://github.com/helix-editor/helix/pull/4180)) +- Make `scroll` aware of tabs and wide characters ([#4519](https://github.com/helix-editor/helix/pull/4519)) +- Correctly handle escaping in `command_mode` completion ([#4316](https://github.com/helix-editor/helix/pull/4316), [#4587](https://github.com/helix-editor/helix/pull/4587), [#4632](https://github.com/helix-editor/helix/pull/4632)) +- Fix `delete_char_backward` for paired characters ([#4558](https://github.com/helix-editor/helix/pull/4558)) +- Fix crash from two windows editing the same document ([#4570](https://github.com/helix-editor/helix/pull/4570)) +- Fix pasting from the blackhole register ([#4497](https://github.com/helix-editor/helix/pull/4497)) +- Support LSP insertReplace completion items ([1312682](https://github.com/helix-editor/helix/commit/1312682)) +- Dynamically resize the line number gutter width ([#3469](https://github.com/helix-editor/helix/pull/3469)) +- Fix crash for unknown completion item kinds ([#4658](https://github.com/helix-editor/helix/pull/4658)) +- Re-enable `format_selections` for single selection ranges ([d4f5cab](https://github.com/helix-editor/helix/commit/d4f5cab)) +- Limit the number of in-progress tree-sitter query matches ([#4707](https://github.com/helix-editor/helix/pull/4707), [#4830](https://github.com/helix-editor/helix/pull/4830)) +- Use the special `#` register with `increment`/`decrement` to change by range number ([#4418](https://github.com/helix-editor/helix/pull/4418)) +- Add a statusline element to show number of selected chars ([#4682](https://github.com/helix-editor/helix/pull/4682)) +- Add a statusline element showing global LSP diagnostic warning and error counts ([#4569](https://github.com/helix-editor/helix/pull/4569)) +- Add a scrollbar to popups ([#4449](https://github.com/helix-editor/helix/pull/4449)) +- Prefer shorter matches in fuzzy matcher scoring ([#4698](https://github.com/helix-editor/helix/pull/4698)) +- Use key-sequence format for command palette keybinds ([#4712](https://github.com/helix-editor/helix/pull/4712)) +- Remove prefix filtering from autocompletion menu ([#4578](https://github.com/helix-editor/helix/pull/4578)) +- Focus on the parent buffer when closing a split ([#4766](https://github.com/helix-editor/helix/pull/4766)) +- Handle language server termination ([#4797](https://github.com/helix-editor/helix/pull/4797), [#4852](https://github.com/helix-editor/helix/pull/4852)) +- Allow `r`/`t`/`f` to work on tab characters ([#4817](https://github.com/helix-editor/helix/pull/4817)) +- Show a preview for scratch buffers in the buffer picker ([#3454](https://github.com/helix-editor/helix/pull/3454)) +- Set a limit of entries in the jumplist ([#4750](https://github.com/helix-editor/helix/pull/4750)) +- Re-use shell outputs when inserting or appending shell output ([#3465](https://github.com/helix-editor/helix/pull/3465)) +- Check LSP server provider capabilities ([#3554](https://github.com/helix-editor/helix/pull/3554)) +- Improve tree-sitter parsing performance on files with many language layers ([#4716](https://github.com/helix-editor/helix/pull/4716)) +- Move indentation to the next line when using `` on a line with only whitespace ([#4854](https://github.com/helix-editor/helix/pull/4854)) +- Remove selections for closed views from all documents ([#4888](https://github.com/helix-editor/helix/pull/4888)) +- Improve performance of the `:reload` command ([#4457](https://github.com/helix-editor/helix/pull/4457)) +- Properly handle media keys ([#4887](https://github.com/helix-editor/helix/pull/4887)) +- Support LSP diagnostic data field ([#4935](https://github.com/helix-editor/helix/pull/4935)) +- Handle C-i keycode as tab ([#4961](https://github.com/helix-editor/helix/pull/4961)) +- Fix view alignment for jumplist picker jumps ([#3743](https://github.com/helix-editor/helix/pull/3743)) +- Use OSC52 for tmux clipboard provider ([#5027](https://github.com/helix-editor/helix/pull/5027)) + +Themes: + +- Add `varua` ([#3610](https://github.com/helix-editor/helix/pull/3610), [#4964](https://github.com/helix-editor/helix/pull/4964)) +- Update `boo_berry` ([#3653](https://github.com/helix-editor/helix/pull/3653)) +- Add `rasmus` ([#3728](https://github.com/helix-editor/helix/pull/3728)) +- Add `papercolor_dark` ([#3742](https://github.com/helix-editor/helix/pull/3742)) +- Update `monokai_pro_spectrum` ([#3814](https://github.com/helix-editor/helix/pull/3814)) +- Update `nord` ([#3792](https://github.com/helix-editor/helix/pull/3792)) +- Update `fleetish` ([#3844](https://github.com/helix-editor/helix/pull/3844), [#4487](https://github.com/helix-editor/helix/pull/4487), [#4813](https://github.com/helix-editor/helix/pull/4813)) +- Update `flatwhite` ([#3843](https://github.com/helix-editor/helix/pull/3843)) +- Add `darcula` ([#3739](https://github.com/helix-editor/helix/pull/3739)) +- Update `papercolor` ([#3938](https://github.com/helix-editor/helix/pull/3938), [#4317](https://github.com/helix-editor/helix/pull/4317)) +- Add bufferline colors to multiple themes ([#3881](https://github.com/helix-editor/helix/pull/3881)) +- Add `gruvbox_dark_hard` ([#3948](https://github.com/helix-editor/helix/pull/3948)) +- Add `onedarker` ([#3980](https://github.com/helix-editor/helix/pull/3980), [#4060](https://github.com/helix-editor/helix/pull/4060)) +- Add `dark_high_contrast` ([#3312](https://github.com/helix-editor/helix/pull/3312)) +- Update `bogster` ([#4121](https://github.com/helix-editor/helix/pull/4121), [#4264](https://github.com/helix-editor/helix/pull/4264)) +- Update `sonokai` ([#4089](https://github.com/helix-editor/helix/pull/4089)) +- Update `ayu_*` themes ([#4140](https://github.com/helix-editor/helix/pull/4140), [#4109](https://github.com/helix-editor/helix/pull/4109), [#4662](https://github.com/helix-editor/helix/pull/4662), [#4764](https://github.com/helix-editor/helix/pull/4764)) +- Update `everforest` ([#3998](https://github.com/helix-editor/helix/pull/3998)) +- Update `monokai_pro_octagon` ([#4247](https://github.com/helix-editor/helix/pull/4247)) +- Add `heisenberg` ([#4209](https://github.com/helix-editor/helix/pull/4209)) +- Add `bogster_light` ([#4265](https://github.com/helix-editor/helix/pull/4265)) +- Update `pop-dark` ([#4323](https://github.com/helix-editor/helix/pull/4323)) +- Update `rose_pine` ([#4221](https://github.com/helix-editor/helix/pull/4221)) +- Add `kanagawa` ([#4300](https://github.com/helix-editor/helix/pull/4300)) +- Add `hex_steel`, `hex_toxic` and `hex_lavendar` ([#4367](https://github.com/helix-editor/helix/pull/4367), [#4990](https://github.com/helix-editor/helix/pull/4990)) +- Update `tokyonight` and `tokyonight_storm` ([#4415](https://github.com/helix-editor/helix/pull/4415)) +- Update `gruvbox` ([#4626](https://github.com/helix-editor/helix/pull/4626)) +- Update `dark_plus` ([#4661](https://github.com/helix-editor/helix/pull/4661), [#4678](https://github.com/helix-editor/helix/pull/4678)) +- Add `zenburn` ([#4613](https://github.com/helix-editor/helix/pull/4613), [#4977](https://github.com/helix-editor/helix/pull/4977)) +- Update `monokai_pro` ([#4789](https://github.com/helix-editor/helix/pull/4789)) +- Add `mellow` ([#4770](https://github.com/helix-editor/helix/pull/4770)) +- Add `nightfox` ([#4769](https://github.com/helix-editor/helix/pull/4769), [#4966](https://github.com/helix-editor/helix/pull/4966)) +- Update `doom_acario_dark` ([#4979](https://github.com/helix-editor/helix/pull/4979)) +- Update `autumn` ([#4996](https://github.com/helix-editor/helix/pull/4996)) +- Update `acme` ([#4999](https://github.com/helix-editor/helix/pull/4999)) +- Update `nord_light` ([#4999](https://github.com/helix-editor/helix/pull/4999)) +- Update `serika_*` ([#5015](https://github.com/helix-editor/helix/pull/5015)) + +LSP configurations: + +- Switch to `openscad-lsp` for OpenScad ([#3750](https://github.com/helix-editor/helix/pull/3750)) +- Support Jsonnet ([#3748](https://github.com/helix-editor/helix/pull/3748)) +- Support Markdown ([#3499](https://github.com/helix-editor/helix/pull/3499)) +- Support Bass ([#3771](https://github.com/helix-editor/helix/pull/3771)) +- Set roots configuration for Elixir and HEEx ([#3917](https://github.com/helix-editor/helix/pull/3917), [#3959](https://github.com/helix-editor/helix/pull/3959)) +- Support Purescript ([#4242](https://github.com/helix-editor/helix/pull/4242)) +- Set roots configuration for Julia ([#4361](https://github.com/helix-editor/helix/pull/4361)) +- Support D ([#4372](https://github.com/helix-editor/helix/pull/4372)) +- Increase default language server timeout for Julia ([#4575](https://github.com/helix-editor/helix/pull/4575)) +- Use ElixirLS for HEEx ([#4679](https://github.com/helix-editor/helix/pull/4679)) +- Support Bicep ([#4403](https://github.com/helix-editor/helix/pull/4403)) +- Switch to `nil` for Nix ([433ccef](https://github.com/helix-editor/helix/commit/433ccef)) +- Support QML ([#4842](https://github.com/helix-editor/helix/pull/4842)) +- Enable auto-format for CSS ([#4987](https://github.com/helix-editor/helix/pull/4987)) +- Support CommonLisp ([4176769](https://github.com/helix-editor/helix/commit/4176769)) + +New languages: + +- SML ([#3692](https://github.com/helix-editor/helix/pull/3692)) +- Jsonnet ([#3714](https://github.com/helix-editor/helix/pull/3714)) +- Godot resource ([#3759](https://github.com/helix-editor/helix/pull/3759)) +- Astro ([#3829](https://github.com/helix-editor/helix/pull/3829)) +- SSH config ([#2455](https://github.com/helix-editor/helix/pull/2455), [#4538](https://github.com/helix-editor/helix/pull/4538)) +- Bass ([#3771](https://github.com/helix-editor/helix/pull/3771)) +- WAT (WebAssembly text format) ([#4040](https://github.com/helix-editor/helix/pull/4040), [#4542](https://github.com/helix-editor/helix/pull/4542)) +- Purescript ([#4242](https://github.com/helix-editor/helix/pull/4242)) +- D ([#4372](https://github.com/helix-editor/helix/pull/4372), [#4562](https://github.com/helix-editor/helix/pull/4562)) +- VHS ([#4486](https://github.com/helix-editor/helix/pull/4486)) +- KDL ([#4481](https://github.com/helix-editor/helix/pull/4481)) +- XML ([#4518](https://github.com/helix-editor/helix/pull/4518)) +- WIT ([#4525](https://github.com/helix-editor/helix/pull/4525)) +- ENV ([#4536](https://github.com/helix-editor/helix/pull/4536)) +- INI ([#4538](https://github.com/helix-editor/helix/pull/4538)) +- Bicep ([#4403](https://github.com/helix-editor/helix/pull/4403), [#4751](https://github.com/helix-editor/helix/pull/4751)) +- QML ([#4842](https://github.com/helix-editor/helix/pull/4842)) +- CommonLisp ([4176769](https://github.com/helix-editor/helix/commit/4176769)) + +Updated languages and queries: + +- Zig ([#3621](https://github.com/helix-editor/helix/pull/3621), [#4745](https://github.com/helix-editor/helix/pull/4745)) +- Rust ([#3647](https://github.com/helix-editor/helix/pull/3647), [#3729](https://github.com/helix-editor/helix/pull/3729), [#3927](https://github.com/helix-editor/helix/pull/3927), [#4073](https://github.com/helix-editor/helix/pull/4073), [#4510](https://github.com/helix-editor/helix/pull/4510), [#4659](https://github.com/helix-editor/helix/pull/4659), [#4717](https://github.com/helix-editor/helix/pull/4717)) +- Solidity ([20ed8c2](https://github.com/helix-editor/helix/commit/20ed8c2)) +- Fish ([#3704](https://github.com/helix-editor/helix/pull/3704)) +- Elixir ([#3645](https://github.com/helix-editor/helix/pull/3645), [#4333](https://github.com/helix-editor/helix/pull/4333), [#4821](https://github.com/helix-editor/helix/pull/4821)) +- Diff ([#3708](https://github.com/helix-editor/helix/pull/3708)) +- Nix ([665e27f](https://github.com/helix-editor/helix/commit/665e27f), [1fe3273](https://github.com/helix-editor/helix/commit/1fe3273)) +- Markdown ([#3749](https://github.com/helix-editor/helix/pull/3749), [#4078](https://github.com/helix-editor/helix/pull/4078), [#4483](https://github.com/helix-editor/helix/pull/4483), [#4478](https://github.com/helix-editor/helix/pull/4478)) +- GDScript ([#3760](https://github.com/helix-editor/helix/pull/3760)) +- JSX and TSX ([#3853](https://github.com/helix-editor/helix/pull/3853), [#3973](https://github.com/helix-editor/helix/pull/3973)) +- Ruby ([#3976](https://github.com/helix-editor/helix/pull/3976), [#4601](https://github.com/helix-editor/helix/pull/4601)) +- R ([#4031](https://github.com/helix-editor/helix/pull/4031)) +- WGSL ([#3996](https://github.com/helix-editor/helix/pull/3996), [#4079](https://github.com/helix-editor/helix/pull/4079)) +- C# ([#4118](https://github.com/helix-editor/helix/pull/4118), [#4281](https://github.com/helix-editor/helix/pull/4281), [#4213](https://github.com/helix-editor/helix/pull/4213)) +- Twig ([#4176](https://github.com/helix-editor/helix/pull/4176)) +- Lua ([#3552](https://github.com/helix-editor/helix/pull/3552)) +- C/C++ ([#4079](https://github.com/helix-editor/helix/pull/4079), [#4278](https://github.com/helix-editor/helix/pull/4278), [#4282](https://github.com/helix-editor/helix/pull/4282)) +- Cairo ([17488f1](https://github.com/helix-editor/helix/commit/17488f1), [431f9c1](https://github.com/helix-editor/helix/commit/431f9c1), [09a6df1](https://github.com/helix-editor/helix/commit/09a6df1)) +- Rescript ([#4356](https://github.com/helix-editor/helix/pull/4356)) +- Zig ([#4409](https://github.com/helix-editor/helix/pull/4409)) +- Scala ([#4353](https://github.com/helix-editor/helix/pull/4353), [#4697](https://github.com/helix-editor/helix/pull/4697), [#4701](https://github.com/helix-editor/helix/pull/4701)) +- LaTeX ([#4528](https://github.com/helix-editor/helix/pull/4528), [#4922](https://github.com/helix-editor/helix/pull/4922)) +- SQL ([#4529](https://github.com/helix-editor/helix/pull/4529)) +- Python ([#4560](https://github.com/helix-editor/helix/pull/4560)) +- Bash/Zsh ([#4582](https://github.com/helix-editor/helix/pull/4582)) +- Nu ([#4583](https://github.com/helix-editor/helix/pull/4583)) +- Julia ([#4588](https://github.com/helix-editor/helix/pull/4588)) +- Typescript ([#4703](https://github.com/helix-editor/helix/pull/4703)) +- Meson ([#4572](https://github.com/helix-editor/helix/pull/4572)) +- Haskell ([#4800](https://github.com/helix-editor/helix/pull/4800)) +- CMake ([#4809](https://github.com/helix-editor/helix/pull/4809)) +- HTML ([#4829](https://github.com/helix-editor/helix/pull/4829), [#4881](https://github.com/helix-editor/helix/pull/4881)) +- Java ([#4886](https://github.com/helix-editor/helix/pull/4886)) +- Go ([#4906](https://github.com/helix-editor/helix/pull/4906), [#4969](https://github.com/helix-editor/helix/pull/4969), [#5010](https://github.com/helix-editor/helix/pull/5010)) +- CSS ([#4882](https://github.com/helix-editor/helix/pull/4882)) +- Racket ([#4915](https://github.com/helix-editor/helix/pull/4915)) +- SCSS ([#5003](https://github.com/helix-editor/helix/pull/5003)) + +Packaging: + +- Filter relevant source files in the Nix flake ([#3657](https://github.com/helix-editor/helix/pull/3657)) +- Build a binary for `aarch64-linux` in the release CI ([038a91d](https://github.com/helix-editor/helix/commit/038a91d)) +- Build an AppImage for `aarch64-linux` in the release CI ([b738031](https://github.com/helix-editor/helix/commit/b738031)) +- Enable CI builds for `riscv64-linux` ([#3685](https://github.com/helix-editor/helix/pull/3685)) +- Support preview releases in CI ([0090a2d](https://github.com/helix-editor/helix/commit/0090a2d)) +- Strip binaries built in CI ([#3780](https://github.com/helix-editor/helix/pull/3780)) +- Fix the development shell for the Nix Flake on `aarch64-darwin` ([#3810](https://github.com/helix-editor/helix/pull/3810)) +- Raise the MSRV and create an MSRV policy ([#3896](https://github.com/helix-editor/helix/pull/3896), [#3913](https://github.com/helix-editor/helix/pull/3913), [#3961](https://github.com/helix-editor/helix/pull/3961)) +- Fix Fish completions for `--config` and `--log` flags ([#3912](https://github.com/helix-editor/helix/pull/3912)) +- Use builtin filenames option in Bash completion ([#4648](https://github.com/helix-editor/helix/pull/4648)) + # 22.08.1 (2022-09-01) This is a patch release that fixes a panic caused by closing splits or buffers. ([#3633](https://github.com/helix-editor/helix/pull/3633)) diff --git a/VERSION b/VERSION index b9ed4c22ac55..e70b3aebd5b7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -22.08.1 \ No newline at end of file +22.12 \ No newline at end of file From 9d4236941d581a1a9ed017db294fd3413a670b84 Mon Sep 17 00:00:00 2001 From: Alexander Brevig Date: Wed, 7 Dec 2022 12:29:56 +0100 Subject: [PATCH 133/352] fix(theme): serika toml syntax valid (#5038) --- runtime/themes/serika-light.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/themes/serika-light.toml b/runtime/themes/serika-light.toml index ad830d92c148..99d4b7f1bbbd 100644 --- a/runtime/themes/serika-light.toml +++ b/runtime/themes/serika-light.toml @@ -59,7 +59,7 @@ "error" = "nasty-red" "diagnostic" = { fg = "nasty-red", modifiers = ["underlined"] } -"diff.plus" = { fg = "bg_green" +"diff.plus" = { fg = "bg_green" } "diff.delta" = { fg = "bg_blue" } "diff.minus" = { fg = "nasty-red" } From a4de86e7afc0da3d847d467a21ff4fb67a51d620 Mon Sep 17 00:00:00 2001 From: Alexander Brevig Date: Wed, 7 Dec 2022 12:30:46 +0100 Subject: [PATCH 134/352] fix(theme): git gutter for flatwhite (#5036) --- runtime/themes/flatwhite.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/themes/flatwhite.toml b/runtime/themes/flatwhite.toml index d4c837b6930a..2fdc66d0fea9 100644 --- a/runtime/themes/flatwhite.toml +++ b/runtime/themes/flatwhite.toml @@ -77,9 +77,9 @@ "ui.popup" = { fg = "base1", bg = "base6" } "ui.window" = { fg = "base1", bg = "base6" } -"diff.plus" = { bg = "diff_add" } -"diff.delta" = { bg = "diff_change" } -"diff.minus" = { bg = "diff_delete" } +"diff.plus" = { fg = "diff_add" } +"diff.delta" = { fg = "diff_change" } +"diff.minus" = { fg = "diff_delete" } [palette] base1 = "#605a52" From f8b75a245a390fc3772d59cafe04ccaaa53c9ca9 Mon Sep 17 00:00:00 2001 From: Jens Getreu Date: Thu, 8 Dec 2022 02:48:01 +0100 Subject: [PATCH 135/352] Autumn theme: use new features (#5051) Co-authored-by: Jens Getreu --- runtime/themes/autumn.toml | 3 +- runtime/themes/autumn_night.toml | 62 +------------------------------- 2 files changed, 3 insertions(+), 62 deletions(-) diff --git a/runtime/themes/autumn.toml b/runtime/themes/autumn.toml index fe80261af294..501675da16ba 100644 --- a/runtime/themes/autumn.toml +++ b/runtime/themes/autumn.toml @@ -58,10 +58,11 @@ "markup.raw" = "my_green" "diff.plus" = "my_green" -"diff.delta" = "my_white" +"diff.delta" = "my_gray4" "diff.minus" = "my_red" "diagnostic" = { modifiers = ["underlined"] } +"diagnostic.error" = { underline = { style = "curl", color = "my_red" } } "ui.gutter" = { bg = "my_gray0" } "hint" = "my_gray5" "debug" = "my_yellow2" diff --git a/runtime/themes/autumn_night.toml b/runtime/themes/autumn_night.toml index d01f5356931e..c26cc777e144 100644 --- a/runtime/themes/autumn_night.toml +++ b/runtime/themes/autumn_night.toml @@ -7,67 +7,7 @@ # Jens Getreu ported and optimised the color theme for the Helix editor. # Author: Jens Getreu -"ui.background" = { bg = "my_gray0" } -"ui.menu" = { fg = "my_white", bg = "my_gray2" } -"ui.menu.selected" = { fg = "my_gray2", bg = "my_gray5" } -"ui.linenr" = { fg = "my_gray3", bg = "my_gray0" } -"ui.popup" = { bg = "my_gray2" } -"ui.window" = { fg = "my_gray3", bg = "my_gray2" } -"ui.linenr.selected" = { fg = "my_gray6", bg = "my_gray0"} -"ui.selection" = { bg = "my_gray3" } -"comment" = { fg = "my_gray4", modifiers = ["italic"] } -"ui.cursorline" = { bg = "my_gray3" } -"ui.statusline" = { fg = "my_gray6", bg = "my_gray2" } -"ui.statusline.inactive" = { fg = 'my_gray4', bg = 'my_gray2' } -"ui.statusline.insert" = {fg = "my_black", bg = "my_gray5", modifiers = ["bold"]} -"ui.statusline.normal" = {fg = "my_gray6", bg = "my_gray2"} -"ui.statusline.select" = {fg = "my_gray6", bg = "my_black", modifiers = ["bold"]} -"ui.cursor" = { fg = "my_gray5", modifiers = ["reversed"] } -"ui.cursor.primary" = { fg = "my_white", modifiers = ["reversed"] } -"ui.cursorline.primary" = { bg = "my_black" } -"ui.cursorline.secondary" = { bg = "my_black" } -"ui.text" = "my_white" -"operator" = "my_white" -"ui.text.focus" = "my_white" -"variable" = "my_white3" -"constant.numeric" = "my_turquoise" -"constant" = "my_white3" -"attribute" = "my_turquoise" -"type" = { fg = "my_white3", modifiers = ["italic"] } -"ui.cursor.match" = { fg = "my_white3", modifiers = ["underlined"] } -"string" = "my_green" -"variable.other.member" = "my_brown" -"constant.character.escape" = "my_turquoise" -"function" = "my_yellow1" -"constructor" = "my_yellow1" -"special" = "my_yellow1" -"keyword" = "my_red" -"label" = "my_red" -"namespace" = "my_white3" -"ui.help" = { fg = "my_gray6", bg = "my_gray2" } -"ui.virtual.whitespace" = { fg = "my_gray5" } -"ui.virtual.ruler" = { bg = "my_gray1" } - -"markup.heading" = "my_yellow1" -"markup.list" = "my_white2" -"markup.bold" = { modifiers = ["bold"] } -"markup.italic" = { modifiers = ["italic"] } -"markup.link.url" = "my_turquoise2" -"markup.link.text" = "my_white2" -"markup.quote" = "my_brown" -"markup.raw" = "my_green" - -"diff.plus" = "my_green" -"diff.delta" = "my_white" -"diff.minus" = "my_red" - -"diagnostic" = { modifiers = ["underlined"] } -"ui.gutter" = { bg = "my_gray0" } -"hint" = "my_gray5" -"debug" = "my_yellow2" -"info" = "my_yellow2" -"warning" = "my_yellow2" -"error" = "my_red" +inherits = "autumn" [palette] my_black = "#111111" # Cursorline From 36eff1da8cdc4efc9cec362311718fa6a4c75563 Mon Sep 17 00:00:00 2001 From: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> Date: Fri, 9 Dec 2022 03:58:15 +0100 Subject: [PATCH 136/352] fix(tutor): Capitalize first letter of a sentence (#5075) --- runtime/tutor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/tutor b/runtime/tutor index d977e078c78f..418c4195487e 100644 --- a/runtime/tutor +++ b/runtime/tutor @@ -96,7 +96,7 @@ _________________________________________________________________ 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. - 4. type Escape to exit Insert mode and return to Normal mode. + 4. Type Escape to exit Insert mode and return to Normal mode. 5. Repeat until the line matches the line below it. --> Th stce misg so. From d91464208958b6f44b431d244e0f369d7907ba59 Mon Sep 17 00:00:00 2001 From: cor Date: Fri, 9 Dec 2022 04:48:56 +0100 Subject: [PATCH 137/352] use curl underlines for gruvbox_dark_hard (#5066) --- runtime/themes/gruvbox_dark_hard.toml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/runtime/themes/gruvbox_dark_hard.toml b/runtime/themes/gruvbox_dark_hard.toml index 708ca2b2c279..27d9ab9b36e8 100644 --- a/runtime/themes/gruvbox_dark_hard.toml +++ b/runtime/themes/gruvbox_dark_hard.toml @@ -39,6 +39,12 @@ "info" = { fg = "aqua1", bg = "bg1" } "hint" = { fg = "blue1", bg = "bg1" } +"diagnostic" = { modifiers = ["underlined"] } +"diagnostic.error" = { underline = { style = "curl", color = "red0" } } +"diagnostic.warning" = { underline = { style = "curl", color = "orange1" } } +"diagnostic.info" = { underline = { style = "curl", color = "aqua1" } } +"diagnostic.hint" = { underline = { style = "curl", color = "blue1" } } + "ui.background" = { bg = "bg0" } "ui.linenr" = { fg = "bg4" } "ui.linenr.selected" = { fg = "yellow1" } @@ -61,8 +67,6 @@ "ui.virtual.whitespace" = "bg2" "ui.virtual.ruler" = { bg = "bg1" } -"diagnostic" = { modifiers = ["underlined"] } - "markup.heading" = "aqua1" "markup.bold" = { modifiers = ["bold"] } "markup.italic" = { modifiers = ["italic"] } From 6798a6651f9d314eacefddfd051661b030ca9d78 Mon Sep 17 00:00:00 2001 From: ath3 <45574139+ath3@users.noreply.github.com> Date: Fri, 9 Dec 2022 04:55:15 +0100 Subject: [PATCH 138/352] Only write newlines in menu selection popup if the lsp returns detail (#4902) --- helix-term/src/ui/completion.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs index c54990e8ec75..11d7886a37d6 100644 --- a/helix-term/src/ui/completion.rs +++ b/helix-term/src/ui/completion.rs @@ -411,7 +411,7 @@ impl Component for Completion { "```{}\n{}\n```\n{}", language, option.detail.as_deref().unwrap_or_default(), - contents.clone() + contents ), cx.editor.syn_loader.clone(), ) @@ -421,15 +421,14 @@ impl Component for Completion { value: contents, })) => { // TODO: set language based on doc scope - Markdown::new( - format!( - "```{}\n{}\n```\n{}", - language, - option.detail.as_deref().unwrap_or_default(), - contents.clone() - ), - cx.editor.syn_loader.clone(), - ) + if let Some(detail) = &option.detail.as_deref() { + Markdown::new( + format!("```{}\n{}\n```\n{}", language, detail, contents), + cx.editor.syn_loader.clone(), + ) + } else { + Markdown::new(contents.to_string(), cx.editor.syn_loader.clone()) + } } None if option.detail.is_some() => { // TODO: copied from above From 8abed3bd78200fc5f7e3890fd853c17ce518d157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Dzivjak?= Date: Fri, 9 Dec 2022 04:57:03 +0100 Subject: [PATCH 139/352] feat(lsp): pass client_info on initialization (#4904) Pass client name ('helix') and client version (version / git hash) to LSP server on initialization. --- Cargo.lock | 1 + helix-loader/build.rs | 20 ++++++++++++++++++++ helix-loader/src/lib.rs | 2 ++ helix-lsp/Cargo.toml | 1 + helix-lsp/src/client.rs | 6 +++++- helix-term/build.rs | 21 --------------------- helix-term/src/main.rs | 5 +++-- 7 files changed, 32 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 014834e43349..b204214fc42e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1187,6 +1187,7 @@ dependencies = [ "futures-executor", "futures-util", "helix-core", + "helix-loader", "log", "lsp-types", "serde", diff --git a/helix-loader/build.rs b/helix-loader/build.rs index e0ebd1c48f17..c4b89e6b93fe 100644 --- a/helix-loader/build.rs +++ b/helix-loader/build.rs @@ -1,6 +1,26 @@ +use std::borrow::Cow; +use std::process::Command; + +const VERSION: &str = include_str!("../VERSION"); + fn main() { + let git_hash = Command::new("git") + .args(["rev-parse", "HEAD"]) + .output() + .ok() + .filter(|output| output.status.success()) + .and_then(|x| String::from_utf8(x.stdout).ok()); + + let version: Cow<_> = match git_hash { + Some(git_hash) => format!("{} ({})", VERSION, &git_hash[..8]).into(), + None => VERSION.into(), + }; + println!( "cargo:rustc-env=BUILD_TARGET={}", std::env::var("TARGET").unwrap() ); + + println!("cargo:rerun-if-changed=../VERSION"); + println!("cargo:rustc-env=VERSION_AND_GIT_HASH={}", version); } diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs index a02a59afc821..29a9f2e75a2b 100644 --- a/helix-loader/src/lib.rs +++ b/helix-loader/src/lib.rs @@ -4,6 +4,8 @@ pub mod grammar; use etcetera::base_strategy::{choose_base_strategy, BaseStrategy}; use std::path::PathBuf; +pub const VERSION_AND_GIT_HASH: &str = env!("VERSION_AND_GIT_HASH"); + pub static RUNTIME_DIR: once_cell::sync::Lazy = once_cell::sync::Lazy::new(runtime_dir); static CONFIG_FILE: once_cell::sync::OnceCell = once_cell::sync::OnceCell::new(); diff --git a/helix-lsp/Cargo.toml b/helix-lsp/Cargo.toml index 41884e73a249..05c5467ea8ac 100644 --- a/helix-lsp/Cargo.toml +++ b/helix-lsp/Cargo.toml @@ -13,6 +13,7 @@ homepage = "https://helix-editor.com" [dependencies] helix-core = { version = "0.6", path = "../helix-core" } +helix-loader = { version = "0.6", path = "../helix-loader" } anyhow = "1.0" futures-executor = "0.3" diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs index 2c2c7c88ec1d..90fd2f21507c 100644 --- a/helix-lsp/src/client.rs +++ b/helix-lsp/src/client.rs @@ -5,6 +5,7 @@ use crate::{ }; use helix_core::{find_root, ChangeSet, Rope}; +use helix_loader::{self, VERSION_AND_GIT_HASH}; use lsp_types as lsp; use serde::Deserialize; use serde_json::Value; @@ -376,7 +377,10 @@ impl Client { ..Default::default() }, trace: None, - client_info: None, + client_info: Some(lsp::ClientInfo { + name: String::from("helix"), + version: Some(String::from(VERSION_AND_GIT_HASH)), + }), locale: None, // TODO }; diff --git a/helix-term/build.rs b/helix-term/build.rs index 719113ff2c37..b47dae8ef653 100644 --- a/helix-term/build.rs +++ b/helix-term/build.rs @@ -1,30 +1,9 @@ use helix_loader::grammar::{build_grammars, fetch_grammars}; -use std::borrow::Cow; -use std::process::Command; - -const VERSION: &str = include_str!("../VERSION"); fn main() { - let git_hash = Command::new("git") - .args(["rev-parse", "HEAD"]) - .output() - .ok() - .filter(|output| output.status.success()) - .and_then(|x| String::from_utf8(x.stdout).ok()); - - let version: Cow<_> = match git_hash { - Some(git_hash) => format!("{} ({})", VERSION, &git_hash[..8]).into(), - None => VERSION.into(), - }; - if std::env::var("HELIX_DISABLE_AUTO_GRAMMAR_BUILD").is_err() { fetch_grammars().expect("Failed to fetch tree-sitter grammars"); build_grammars(Some(std::env::var("TARGET").unwrap())) .expect("Failed to compile tree-sitter grammars"); } - - println!("cargo:rerun-if-changed=../runtime/grammars/"); - println!("cargo:rerun-if-changed=../VERSION"); - - println!("cargo:rustc-env=VERSION_AND_GIT_HASH={}", version); } diff --git a/helix-term/src/main.rs b/helix-term/src/main.rs index 96b695c6fcde..aac5c5379f37 100644 --- a/helix-term/src/main.rs +++ b/helix-term/src/main.rs @@ -1,5 +1,6 @@ use anyhow::{Context, Error, Result}; use crossterm::event::EventStream; +use helix_loader::VERSION_AND_GIT_HASH; use helix_term::application::Application; use helix_term::args::Args; use helix_term::config::Config; @@ -74,7 +75,7 @@ FLAGS: --hsplit Splits all given files horizontally into different windows ", env!("CARGO_PKG_NAME"), - env!("VERSION_AND_GIT_HASH"), + VERSION_AND_GIT_HASH, env!("CARGO_PKG_AUTHORS"), env!("CARGO_PKG_DESCRIPTION"), logpath.display(), @@ -89,7 +90,7 @@ FLAGS: } if args.display_version { - println!("helix {}", env!("VERSION_AND_GIT_HASH")); + println!("helix {}", VERSION_AND_GIT_HASH); std::process::exit(0); } From 2ea20a23e26a771e095972bdda673d491b4aacc5 Mon Sep 17 00:00:00 2001 From: Jummit Date: Fri, 9 Dec 2022 05:02:34 +0100 Subject: [PATCH 140/352] Fix LSP completions ignoring auto-completion option (#5042) --- helix-term/src/commands.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 1843e7a2be4e..2bac5be08e8d 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3049,6 +3049,11 @@ pub mod insert { } fn language_server_completion(cx: &mut Context, ch: char) { + let config = cx.editor.config(); + if !config.auto_completion { + return; + } + use helix_lsp::lsp; // if ch matches completion char, trigger completion let doc = doc_mut!(cx.editor); From 16e13b9789359282cb6c2681262f46fb1b70134b Mon Sep 17 00:00:00 2001 From: TotalKrill Date: Fri, 9 Dec 2022 05:09:23 +0100 Subject: [PATCH 141/352] allow specifying environment for language servers in language.toml (#4004) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stephen Wakely Co-authored-by: Stephen Wakely Co-authored-by: Blaž Hrastnik --- book/src/languages.md | 3 ++- helix-core/src/syntax.rs | 2 ++ helix-lsp/src/client.rs | 3 +++ helix-lsp/src/lib.rs | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/book/src/languages.md b/book/src/languages.md index 133e6447941c..e45ef910a8d4 100644 --- a/book/src/languages.md +++ b/book/src/languages.md @@ -39,7 +39,7 @@ injection-regex = "^mylang$" file-types = ["mylang", "myl"] comment-token = "#" indent = { tab-width = 2, unit = " " } -language-server = { command = "mylang-lsp", args = ["--stdio"] } +language-server = { command = "mylang-lsp", args = ["--stdio"], environment = { "ENV1" = "value1", "ENV2" = "value2" } } formatter = { command = "mylang-formatter" , args = ["--stdin"] } ``` @@ -99,6 +99,7 @@ The `language-server` field takes the following keys: | `args` | A list of arguments to pass to the language server binary | | `timeout` | The maximum time a request to the language server may take, in seconds. Defaults to `20` | | `language-id` | The language name to pass to the language server. Some language servers support multiple languages and use this field to determine which one is being served in a buffer | +| `environment` | Any environment variables that will be used when starting the language server `{ "KEY1" = "Value1", "KEY2" = "Value2" }` | The top-level `config` field is used to configure the LSP initialization options. A `format` sub-table within `config` can be used to pass extra formatting options to diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 8dc34a3e3631..41ab23e1343a 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -207,6 +207,8 @@ pub struct LanguageServerConfiguration { #[serde(default)] #[serde(skip_serializing_if = "Vec::is_empty")] pub args: Vec, + #[serde(default, skip_serializing_if = "HashMap::is_empty")] + pub environment: HashMap, #[serde(default = "default_timeout")] pub timeout: u64, pub language_id: Option, diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs index 90fd2f21507c..dd2581c6d916 100644 --- a/helix-lsp/src/client.rs +++ b/helix-lsp/src/client.rs @@ -42,10 +42,12 @@ pub struct Client { impl Client { #[allow(clippy::type_complexity)] + #[allow(clippy::too_many_arguments)] pub fn start( cmd: &str, args: &[String], config: Option, + server_environment: HashMap, root_markers: &[String], id: usize, req_timeout: u64, @@ -55,6 +57,7 @@ impl Client { let cmd = which::which(cmd).map_err(|err| anyhow::anyhow!(err))?; let process = Command::new(cmd) + .envs(server_environment) .args(args) .stdin(Stdio::piped()) .stdout(Stdio::piped()) diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index f714395f28f5..8418896cbb73 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -550,6 +550,7 @@ fn start_client( &ls_config.command, &ls_config.args, config.config.clone(), + ls_config.environment.clone(), &config.roots, id, ls_config.timeout, From 37e7dd1df598312727aadb5c74919fd196fecffc Mon Sep 17 00:00:00 2001 From: two-six Date: Fri, 9 Dec 2022 05:11:25 +0100 Subject: [PATCH 142/352] Update `diagnostic.error` background for acme theme (#5019) --- runtime/themes/acme.toml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/runtime/themes/acme.toml b/runtime/themes/acme.toml index 696a4a9b2633..e1785f4a5fec 100644 --- a/runtime/themes/acme.toml +++ b/runtime/themes/acme.toml @@ -17,9 +17,9 @@ "ui.menu" = {fg="black", bg="acme_bg"} "ui.menu.selected" = {bg="selected"} "ui.window" = {bg="acme_bg"} -"diagnostic.error" = {bg="white", modifiers=["bold"]} -"diagnostic.warning" = {bg="white", modifiers=["bold"]} -"diagnostic.hint" = {bg="white", modifiers=["bold"]} +"diagnostic.error" = {bg="red", fg="white", modifiers=["bold"]} +"diagnostic.warning" = {bg="orange", fg="black", modifiers=["bold"]} +"diagnostic.hint" = {fg="gray", modifiers=["bold"]} "ui.bufferline" = { fg = "indent", bg = "acme_bar_bg" } "ui.bufferline.active" = { fg = "black", bg = "acme_bg" } "diff.plus" = {fg = "green"} @@ -37,3 +37,5 @@ cursor = "#444444" red = "#a0342f" green = "#065905" indent = "#aaaaaa" +orange = "#f0ad4e" +gray = "#777777" From d14de277092d7eab555ea2abc1435101d12e308c Mon Sep 17 00:00:00 2001 From: "Felipe S. S. Schneider" <37125+schneiderfelipe@users.noreply.github.com> Date: Fri, 9 Dec 2022 01:33:08 -0300 Subject: [PATCH 143/352] Add support for the BibTeX file format (#5064) --- book/src/generated/lang-support.md | 1 + languages.toml | 28 ++++++++++++++++ runtime/queries/bibtex/highlights.scm | 47 +++++++++++++++++++++++++++ runtime/queries/bibtex/locals.scm | 0 runtime/queries/bibtex/tags.scm | 0 5 files changed, 76 insertions(+) create mode 100644 runtime/queries/bibtex/highlights.scm create mode 100644 runtime/queries/bibtex/locals.scm create mode 100644 runtime/queries/bibtex/tags.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index ccfd18c00fca..28dafd7ada47 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -5,6 +5,7 @@ | bash | ✓ | | | `bash-language-server` | | bass | ✓ | | | `bass` | | beancount | ✓ | | | | +| bibtex | ✓ | | | `texlab` | | bicep | ✓ | | | `bicep-langserver` | | c | ✓ | ✓ | ✓ | `clangd` | | c-sharp | ✓ | ✓ | | `OmniSharp` | diff --git a/languages.toml b/languages.toml index 325a39dfc4c6..96d92ce84ab1 100644 --- a/languages.toml +++ b/languages.toml @@ -576,6 +576,34 @@ indent = { tab-width = 4, unit = "\t" } name = "latex" source = { git = "https://github.com/latex-lsp/tree-sitter-latex", rev = "8c75e93cd08ccb7ce1ccab22c1fbd6360e3bcea6" } +[[language]] +name = "bibtex" +scope = "source.bib" +injection-regex = "bib" +file-types = ["bib"] +roots = [] +comment-token = "%" +language-server = { command = "texlab" } +indent = { tab-width = 4, unit = "\t" } +auto-format = true + +[language.formatter] +command = 'bibtex-tidy' +args = [ + "-", + "--curly", + "--drop-all-caps", + "--remove-empty-fields", + "--sort-fields", + "--sort=year,author,id", + "--strip-enclosing-braces", + "--trailing-commas", +] + +[[grammar]] +name = "bibtex" +source = { git = "https://github.com/latex-lsp/tree-sitter-bibtex", rev = "ccfd77db0ed799b6c22c214fe9d2937f47bc8b34" } + [[language]] name = "lean" scope = "source.lean" diff --git a/runtime/queries/bibtex/highlights.scm b/runtime/queries/bibtex/highlights.scm new file mode 100644 index 000000000000..db1ab70c16f9 --- /dev/null +++ b/runtime/queries/bibtex/highlights.scm @@ -0,0 +1,47 @@ +[ + (string_type) + (preamble_type) + (entry_type) +] @keyword + +[ + (junk) + (comment) +] @comment + +[ + "=" + "#" +] @operator + +(command) @function.builtin + +(number) @constant.numeric + +(field + name: (identifier) @variable.builtin) + +(token + (identifier) @variable.parameter) + +[ + (brace_word) + (quote_word) +] @string + +[ + (key_brace) + (key_paren) +] @attribute + +(string + name: (identifier) @constant) + +[ + "{" + "}" + "(" + ")" +] @punctuation.bracket + +"," @punctuation.delimiter diff --git a/runtime/queries/bibtex/locals.scm b/runtime/queries/bibtex/locals.scm new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/runtime/queries/bibtex/tags.scm b/runtime/queries/bibtex/tags.scm new file mode 100644 index 000000000000..e69de29bb2d1 From f323ffabcc5846f647e3ba1d3d2ff5dec95257bd Mon Sep 17 00:00:00 2001 From: Danilo Spinella Date: Sat, 10 Dec 2022 01:40:27 +0100 Subject: [PATCH 144/352] Treat patches as diff files (#5085) --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 96d92ce84ab1..06af52bd340e 100644 --- a/languages.toml +++ b/languages.toml @@ -1083,7 +1083,7 @@ source = { git = "https://github.com/the-mikedavis/tree-sitter-git-commit", rev name = "diff" scope = "source.diff" roots = [] -file-types = ["diff"] +file-types = ["diff", "patch"] injection-regex = "diff" comment-token = "#" indent = { tab-width = 2, unit = " " } From 0e8ea13696206aa8ad289d539a5df62f34a73dec Mon Sep 17 00:00:00 2001 From: Ollie Charles Date: Sat, 10 Dec 2022 20:03:18 +0000 Subject: [PATCH 145/352] Add Haskell text objects (#5061) --- book/src/generated/lang-support.md | 2 +- runtime/queries/haskell/textobjects.scm | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 runtime/queries/haskell/textobjects.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 28dafd7ada47..4dca810478db 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -51,7 +51,7 @@ | gowork | ✓ | | | `gopls` | | graphql | ✓ | | | | | hare | ✓ | | | | -| haskell | ✓ | | | `haskell-language-server-wrapper` | +| haskell | ✓ | ✓ | | `haskell-language-server-wrapper` | | hcl | ✓ | | ✓ | `terraform-ls` | | heex | ✓ | ✓ | | `elixir-ls` | | html | ✓ | | | `vscode-html-language-server` | diff --git a/runtime/queries/haskell/textobjects.scm b/runtime/queries/haskell/textobjects.scm new file mode 100644 index 000000000000..9870dc4a4128 --- /dev/null +++ b/runtime/queries/haskell/textobjects.scm @@ -0,0 +1,13 @@ +(comment) @comment.inside + +[ + (adt) + (decl_type) + (newtype) +] @class.around + +((signature)? (function rhs:(_) @function.inside)) @function.around +(exp_lambda) @function.around + +(adt (type_variable) @parameter.inside) +(patterns (_) @parameter.inside) From 70d78123b94d93c801171ac3dd29e2a493feee20 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Sun, 11 Dec 2022 11:20:34 +0100 Subject: [PATCH 146/352] properly handle detachted git worktrees (#5097) --- helix-core/src/lib.rs | 2 +- helix-loader/src/grammar.rs | 2 +- helix-loader/src/lib.rs | 2 +- helix-term/src/ui/mod.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/helix-core/src/lib.rs b/helix-core/src/lib.rs index 0e76ebbbefca..ee174e69d1cd 100644 --- a/helix-core/src/lib.rs +++ b/helix-core/src/lib.rs @@ -69,7 +69,7 @@ pub fn find_root(root: Option<&str>, root_markers: &[String]) -> std::path::Path top_marker = Some(ancestor); } - if ancestor.join(".git").is_dir() { + if ancestor.join(".git").exists() { // Top marker is repo root if not root marker was detected yet if top_marker.is_none() { top_marker = Some(ancestor); diff --git a/helix-loader/src/grammar.rs b/helix-loader/src/grammar.rs index 833616e046d9..2aa924755112 100644 --- a/helix-loader/src/grammar.rs +++ b/helix-loader/src/grammar.rs @@ -263,7 +263,7 @@ fn fetch_grammar(grammar: GrammarConfiguration) -> Result { ))?; // create the grammar dir contains a git directory - if !grammar_dir.join(".git").is_dir() { + if !grammar_dir.join(".git").exists() { git(&grammar_dir, ["init"])?; } diff --git a/helix-loader/src/lib.rs b/helix-loader/src/lib.rs index 29a9f2e75a2b..80d44a8264b8 100644 --- a/helix-loader/src/lib.rs +++ b/helix-loader/src/lib.rs @@ -97,7 +97,7 @@ pub fn find_local_config_dirs() -> Vec { let mut directories = Vec::new(); for ancestor in current_dir.ancestors() { - if ancestor.join(".git").is_dir() { + if ancestor.join(".git").exists() { directories.push(ancestor.to_path_buf()); // Don't go higher than repo if we're in one break; diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index f61c4c450c7d..107e48dd1ca3 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -207,7 +207,7 @@ pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePi // Cap the number of files if we aren't in a git project, preventing // hangs when using the picker in your home directory - let files: Vec<_> = if root.join(".git").is_dir() { + let files: Vec<_> = if root.join(".git").exists() { files.collect() } else { // const MAX: usize = 8192; From cdc54f50a2ceb62c9f1c38b939ca988ff0e96855 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sun, 11 Dec 2022 09:04:08 -0600 Subject: [PATCH 147/352] Reset mode when changing buffers (#5072) * Reset mode when changing buffers This is similar to the change in e4c9d4082a139aac3aea4506918171b96e81f5b9: reset the editor to normal mode when changing buffers. Usually the editor is already in normal mode but it's possible to setup insert-mode keybindings that change buffers. * Move normal mode entering code to Editor This should be called internally in the Editor when changing documents (Editor::switch) or changing focuses (Editor::focus). --- helix-term/src/commands.rs | 57 +------------------------------ helix-view/src/editor.rs | 70 +++++++++++++++++++++++++++++++++++++- 2 files changed, 70 insertions(+), 57 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 2bac5be08e8d..1310417e47be 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2672,62 +2672,7 @@ fn open_above(cx: &mut Context) { } fn normal_mode(cx: &mut Context) { - if cx.editor.mode == Mode::Normal { - return; - } - - cx.editor.mode = Mode::Normal; - let (view, doc) = current!(cx.editor); - - try_restore_indent(doc, view); - - // if leaving append mode, move cursor back by 1 - if doc.restore_cursor { - let text = doc.text().slice(..); - let selection = doc.selection(view.id).clone().transform(|range| { - Range::new( - range.from(), - graphemes::prev_grapheme_boundary(text, range.to()), - ) - }); - - doc.set_selection(view.id, selection); - doc.restore_cursor = false; - } -} - -fn try_restore_indent(doc: &mut Document, view: &mut View) { - use helix_core::chars::char_is_whitespace; - use helix_core::Operation; - - fn inserted_a_new_blank_line(changes: &[Operation], pos: usize, line_end_pos: usize) -> bool { - if let [Operation::Retain(move_pos), Operation::Insert(ref inserted_str), Operation::Retain(_)] = - changes - { - move_pos + inserted_str.len() == pos - && inserted_str.starts_with('\n') - && inserted_str.chars().skip(1).all(char_is_whitespace) - && pos == line_end_pos // ensure no characters exists after current position - } else { - false - } - } - - let doc_changes = doc.changes().changes(); - let text = doc.text().slice(..); - let range = doc.selection(view.id).primary(); - let pos = range.cursor(text); - let line_end_pos = line_end_char_index(&text, range.cursor_line(text)); - - if inserted_a_new_blank_line(doc_changes, pos, line_end_pos) { - // Removes tailing whitespaces. - let transaction = - Transaction::change_by_selection(doc.text(), doc.selection(view.id), |range| { - let line_start_pos = text.line_to_char(range.cursor_line(text)); - (line_start_pos, pos, None) - }); - apply_transaction(&transaction, doc, view); - } + cx.editor.enter_normal_mode(); } // Store a jump on the jumplist. diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 973cf82ea109..c13a66736948 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -1005,6 +1005,8 @@ impl Editor { return; } + self.enter_normal_mode(); + match action { Action::Replace => { let (view, doc) = current_ref!(self); @@ -1025,6 +1027,9 @@ impl Editor { let (view, doc) = current!(self); let view_id = view.id; + // Append any outstanding changes to history in the old document. + doc.append_changes_to_history(view); + if remove_empty_scratch { // Copy `doc.id` into a variable before calling `self.documents.remove`, which requires a mutable // borrow, invalidating direct access to `doc.id`. @@ -1262,7 +1267,7 @@ impl Editor { // if leaving the view: mode should reset and the cursor should be // within view if prev_id != view_id { - self.mode = Mode::Normal; + self.enter_normal_mode(); self.ensure_cursor_in_view(view_id); // Update jumplist selections with new document changes. @@ -1427,4 +1432,67 @@ impl Editor { Ok(()) } + + /// Switches the editor into normal mode. + pub fn enter_normal_mode(&mut self) { + use helix_core::{graphemes, Range}; + + if self.mode == Mode::Normal { + return; + } + + self.mode = Mode::Normal; + let (view, doc) = current!(self); + + try_restore_indent(doc, view); + + // if leaving append mode, move cursor back by 1 + if doc.restore_cursor { + let text = doc.text().slice(..); + let selection = doc.selection(view.id).clone().transform(|range| { + Range::new( + range.from(), + graphemes::prev_grapheme_boundary(text, range.to()), + ) + }); + + doc.set_selection(view.id, selection); + doc.restore_cursor = false; + } + } +} + +fn try_restore_indent(doc: &mut Document, view: &mut View) { + use helix_core::{ + chars::char_is_whitespace, line_ending::line_end_char_index, Operation, Transaction, + }; + + fn inserted_a_new_blank_line(changes: &[Operation], pos: usize, line_end_pos: usize) -> bool { + if let [Operation::Retain(move_pos), Operation::Insert(ref inserted_str), Operation::Retain(_)] = + changes + { + move_pos + inserted_str.len() == pos + && inserted_str.starts_with('\n') + && inserted_str.chars().skip(1).all(char_is_whitespace) + && pos == line_end_pos // ensure no characters exists after current position + } else { + false + } + } + + let doc_changes = doc.changes().changes(); + let text = doc.text().slice(..); + let range = doc.selection(view.id).primary(); + let pos = range.cursor(text); + let line_end_pos = line_end_char_index(&text, range.cursor_line(text)); + + if inserted_a_new_blank_line(doc_changes, pos, line_end_pos) { + // Removes tailing whitespaces. + let transaction = + Transaction::change_by_selection(doc.text(), doc.selection(view.id), |range| { + let line_start_pos = text.line_to_char(range.cursor_line(text)); + (line_start_pos, pos, None) + }); + crate::apply_transaction(&transaction, doc, view); + } } From c5bfb792b2a26545f6515a1e7b62d4f37b10841e Mon Sep 17 00:00:00 2001 From: Slug <106496265+GreasySlug@users.noreply.github.com> Date: Mon, 12 Dec 2022 03:14:10 +0900 Subject: [PATCH 148/352] update(theme): adjust base16_transparent and dark_high_contrast (#5105) --- book/src/themes.md | 2 +- runtime/themes/base16_transparent.toml | 45 +++++++++++++------------ runtime/themes/dark_high_contrast.toml | 46 ++++++++++++++------------ 3 files changed, 48 insertions(+), 45 deletions(-) diff --git a/book/src/themes.md b/book/src/themes.md index 392b5f8c956a..322caea54b48 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -103,7 +103,7 @@ Some styles might not be supported by your terminal emulator. | `line` | | `curl` | | `dashed` | -| `dot` | +| `dotted` | | `double_line` | diff --git a/runtime/themes/base16_transparent.toml b/runtime/themes/base16_transparent.toml index 0c6d924f64cd..f8ee0890d082 100644 --- a/runtime/themes/base16_transparent.toml +++ b/runtime/themes/base16_transparent.toml @@ -1,27 +1,28 @@ # Author: GreasySlug <9619abgoni@gmail.com> +# This theme is base on base16_theme(Author: NNB ) "ui.background" = { fg = "white"} "ui.background.separator" = { fg = "gray" } -"ui.menu" = { fg = "gray" } +"ui.menu" = { fg = "white" } "ui.menu.selected" = { modifiers = ["reversed"] } "ui.menu.scroll" = { fg = "light-gray" } "ui.linenr" = { fg = "light-gray" } "ui.linenr.selected" = { fg = "white", modifiers = ["bold"] } "ui.popup" = { fg = "white" } "ui.window" = { fg = "white" } -"ui.selection" = { modifiers = [ "reversed"] } -"comment" = { fg = "gray", modifiers = ["italic"] } +"ui.selection" = { bg = "gray" } +"comment" = "light-gray" "ui.statusline" = { fg = "white" } "ui.statusline.inactive" = { fg = "gray" } -"ui.statusline.normal" = { fg = "blue", modifiers = ["reversed"] } -"ui.statusline.insert" = { fg = "green", modifiers = ["reversed"] } -"ui.statusline.select" = { fg = "magenta", modifiers = ["reversed"] } +"ui.statusline.normal" = { fg = "black", bg = "blue" } +"ui.statusline.insert" = { fg = "black", bg = "green" } +"ui.statusline.select" = { fg = "black", bg = "magenta" } "ui.help" = { fg = "light-gray" } "ui.cursor" = { modifiers = ["reversed"] } -"ui.cursor.match" = { fg = "light-yellow", modifiers = ["underlined"] } +"ui.cursor.match" = { fg = "light-yellow", underline = { color = "light-yellow", style = "line" } } "ui.cursor.primary" = { modifiers = ["reversed", "slow_blink"] } "ui.cursor.secondary" = { modifiers = ["reversed"] } -"ui.virtual.ruler" = { fg = "gray", modifiers = ["reversed"] } +"ui.virtual.ruler" = { bg = "gray" } "ui.virtual.whitespace" = "gray" "ui.virtual.indent-guide" = "gray" @@ -44,7 +45,7 @@ "markup.list" = "light-red" "markup.bold" = { fg = "light-yellow", modifiers = ["bold"] } "markup.italic" = { fg = "light-magenta", modifiers = ["italic"] } -"markup.link.url" = { fg = "yellow", modifiers = ["underlined"] } +"markup.link.url" = { fg = "yellow", underline = { color = "yellow", style = "line"} } "markup.link.text" = "light-red" "markup.quote" = "light-cyan" "markup.raw" = "green" @@ -53,19 +54,19 @@ "markup.select" = { fg = "magenta" } "diff.plus" = "light-green" -"diff.delta" = "yellow" +"diff.delta" = "light-blue" +"diff.delta.moved" = "blue" "diff.minus" = "light-red" -"ui.gutter" = "gray" -"info" = "light-blue" -"hint" = "gray" -"debug" = "gray" -"warning" = "yellow" -"error" = "light-red" +"ui.gutter" = "gray" +"info" = "light-blue" +"hint" = "light-gray" +"debug" = "light-gray" +"warning" = "light-yellow" +"error" = "light-red" -"diagnostic" = { modifiers = ["underlined"] } -"diagnostic.info" = { fg = "light-blue", modifiers = ["underlined"] } -"diagnostic.hint" = { fg = "gray", modifiers = ["underlined"] } -"diagnostic.debug" ={ fg ="gray", modifiers = ["underlined"] } -"diagnostic.warning" = { fg = "yellow", modifiers = ["underlined"] } -"diagnostic.error" = { fg ="light-red", modifiers = ["underlined"] } +"diagnostic.info" = { underline = { color = "light-blue", style = "dotted" } } +"diagnostic.hint" = { underline = { color = "light-gray", style = "double_line" } } +"diagnostic.debug" = { underline ={ color ="light-gray", style = "dashed" } } +"diagnostic.warning" = { underline = { color = "light-yellow", style = "curl" } } +"diagnostic.error" = { underline = { color ="light-red", style = "curl" } } diff --git a/runtime/themes/dark_high_contrast.toml b/runtime/themes/dark_high_contrast.toml index c65750f4ee01..1c911eb5fc94 100644 --- a/runtime/themes/dark_high_contrast.toml +++ b/runtime/themes/dark_high_contrast.toml @@ -9,29 +9,29 @@ "ui.text.focus" = { modifiers = ["reversed"] } # file picker selected "ui.virtual.whitespace" = "gray" -"ui.virtual.ruler" = { fg = "gray", bg = "white", modifiers = ["reversed"] } +"ui.virtual.ruler" = { fg = "white", bg = "gray" } "ui.virtual.indent-guide" = "white" "ui.statusline" = { fg = "white", bg = "deep_blue" } -"ui.statusline.inactive" = { fg = "gray" } +"ui.statusline.inactive" = { fg = "gray", bg = "deep_blue" } "ui.statusline.normal" = { fg = "black", bg = "aqua" } "ui.statusline.insert" = { fg = "black", bg = "orange" } "ui.statusline.select" = { fg = "black", bg = "purple" } -# "ui.statusline.separator" = { fg = "aqua", bg = "white" } +"ui.statusline.separator" = { fg = "aqua", bg = "white" } "ui.cursor" = { fg = "black", bg = "white" } "ui.cursor.insert" = { fg = "black", bg = "white" } "ui.cursor.select" = { fg = "black", bg = "white" } "ui.cursor.match" = { bg = "white", modifiers = ["dim"] } "ui.cursor.primary" = { fg = "black", bg = "white", modifiers = ["slow_blink"] } - "ui.cursor.secondary" = "white" -"ui.cursorline.primary" = { fg = "orange", modifiers = ["underlined"] } -"ui.cursorline.secondary" = { fg = "orange", modifiers = ["underlined"] } -"ui.selection" = { fg = "deep_blue", bg = "white" } +"ui.cursorline.primary" = { bg = "deep_blue", underline = { color = "orange", style = "double_line" } } +"ui.cursorline.secondary" = { bg = "dark_blue", underline = { color = "white", style = "line" } } +"ui.selection" = { fg = "dark_blue", bg = "white" } +"ui.selection.primary" = { fg = "deep_blue", bg = "white" } "ui.menu" = { fg = "white", bg = "deep_blue" } -"ui.menu.selected" = { fg = "orange", modifiers = ["underlined"] } +"ui.menu.selected" = { fg = "orange", underline = { style = "line" } } "ui.menu.scroll" = { fg = "aqua", bg = "black" } "ui.help" = { fg = "white", bg = "deep_blue" } @@ -39,15 +39,16 @@ "ui.popup.info" = { fg = "white", bg = "deep_blue" } "ui.gutter" = { bg = "black" } +"ui.gutter.selected" = { bg = "black" } "ui.linenr" = { fg = "white", bg = "black" } "ui.linenr.selected" = { fg = "orange", bg = "black", modifiers = ["bold"] } # Diagnostic -"diagnostic" = "white" -"diagnostic.info" = { bg = "white", modifiers = ["underlined"] } -"diagnostic.hint" = { fg = "yellow", modifiers = ["underlined"] } -"diagnostic.warning" = { fg = "orange", modifiers = ["underlined"] } -"diagnostic.error" = { fg = "red", modifiers = ["underlined"] } +"diagnostic" = { fg = "white" } +"diagnostic.info" = { underline = { color = "white", style = "dotted" } } +"diagnostic.hint" = { underline = { color = "yellow", style = "dashed" } } +"diagnostic.warning" = { underline = { color = "orange", style = "curl" } } +"diagnostic.error" = { underline = { color = "red", style = "curl" } } "info" = "white" "hint" = "yellow" "warning" = "orange" @@ -59,31 +60,31 @@ "diff.minus" = "pink" # Syntax high light -"type" = { fg = "emerald_green" } +"type" = "emerald_green" "type.buildin" = "emerald_green" -"comment" = { fg = "white" } +"comment" = "white" "operator" = "white" -"variable" = { fg = "aqua" } +"variable" = "aqua" "variable.other.member" = "brown" "constant" = "aqua" "constant.numeric" = "emerald_green" -"attributes" = { fg = "blue" } +"attributes" = "blue" "namespace" = "blue" "string" = "brown" -"string.special.url" = { fg = "brown", modifiers =["underlined"]} +"string.special.url" = "brown" "constant.character.escape" = "yellow" "constructor" = "aqua" -"keyword" = { fg = "blue", modifiers = ["underlined"] } +"keyword" = "blue" "keyword.control" = "purple" "function" = "yellow" "label" = "blue" # Markup -"markup.heading" = { fg = "yellow", modifiers = ["bold", "underlined"] } -"markup.list" = { fg = "pink" } +"markup.heading" = { fg = "yellow", modifiers = ["bold"], underline = { color = "yellow", style = "double_line"} } +"markup.list" = "pink" "markup.bold" = { fg = "emerald_green", modifiers = ["bold"] } "markup.italic" = { fg = "blue", modifiers = ["italic"] } -"markup.link.url" = { fg = "blue", modifiers = ["underlined"] } +"markup.link.url" = { fg = "blue", underline = { color = "blue", style = "line" } } "markup.link.text" = "pink" "markup.quote" = "yellow" "markup.raw" = "brown" @@ -94,6 +95,7 @@ gray = "#585858" white = "#ffffff" blue = "#66a4ff" deep_blue = "#142743" +dark_blue = "#0d1a2d" aqua = "#6fc3df" purple = "#c586c0" red = "#b65f5f" From a34ba071be0a48a35f36ada7759dee53d783e57b Mon Sep 17 00:00:00 2001 From: garlic0x1 <43155857+garlic0x1@users.noreply.github.com> Date: Sun, 11 Dec 2022 19:59:27 -0600 Subject: [PATCH 149/352] Fix commonlisp filetypes typo and auto-pairs (#5091) --- languages.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 06af52bd340e..dae675dfc14d 100644 --- a/languages.toml +++ b/languages.toml @@ -918,13 +918,19 @@ grammar = "scheme" name = "common-lisp" scope = "source.lisp" roots = [] -file-types = ["lisp", "asd", "cl", "l", "lsp", "ny"," podsl", "sexp"] +file-types = ["lisp", "asd", "cl", "l", "lsp", "ny", "podsl", "sexp"] shebangs = ["lisp", "sbcl", "ccl", "clisp", "ecl"] comment-token = ";" indent = { tab-width = 2, unit = " " } language-server = { command = "cl-lsp", args = [ "stdio" ] } grammar = "scheme" +[language.auto-pairs] +'(' = ')' +'{' = '}' +'[' = ']' +'"' = '"' + [[language]] name = "comment" scope = "scope.comment" From d5ab974d38fd5565a63c8d7c35967c77c0e434d0 Mon Sep 17 00:00:00 2001 From: Marco Ieni <11428655+MarcoIeni@users.noreply.github.com> Date: Mon, 12 Dec 2022 02:59:53 +0100 Subject: [PATCH 150/352] chore(book): link repository (#5101) --- book/book.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/book/book.toml b/book/book.toml index 2277a0bd9dc6..9835145cea3f 100644 --- a/book/book.toml +++ b/book/book.toml @@ -9,3 +9,4 @@ edit-url-template = "https://github.com/helix-editor/helix/tree/master/book/{pat cname = "docs.helix-editor.com" default-theme = "colibri" preferred-dark-theme = "colibri" +git-repository-url = "https://github.com/helix-editor/helix" From 0b960216433956503e9e6fe5220523eb1970eaee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Schl=C3=B6gl?= Date: Mon, 12 Dec 2022 03:06:24 +0100 Subject: [PATCH 151/352] Add `:pipe-to` typable command that ignores shell output (#4931) --- book/src/generated/typable-cmd.md | 1 + helix-term/src/commands/typed.rs | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/book/src/generated/typable-cmd.md b/book/src/generated/typable-cmd.md index 6390ef858e7b..66e6ac039c26 100644 --- a/book/src/generated/typable-cmd.md +++ b/book/src/generated/typable-cmd.md @@ -71,4 +71,5 @@ | `:insert-output` | Run shell command, inserting output before each selection. | | `:append-output` | Run shell command, appending output after each selection. | | `:pipe` | Pipe each selection to the shell command. | +| `:pipe-to` | Pipe each selection to the shell command, ignoring output. | | `:run-shell-command`, `:sh` | Run a shell command | diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 03fcaa553a53..2119a48d67a4 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -1741,13 +1741,30 @@ fn insert_output( Ok(()) } +fn pipe_to( + cx: &mut compositor::Context, + args: &[Cow], + event: PromptEvent, +) -> anyhow::Result<()> { + pipe_impl(cx, args, event, &ShellBehavior::Ignore) +} + fn pipe(cx: &mut compositor::Context, args: &[Cow], event: PromptEvent) -> anyhow::Result<()> { + pipe_impl(cx, args, event, &ShellBehavior::Replace) +} + +fn pipe_impl( + cx: &mut compositor::Context, + args: &[Cow], + event: PromptEvent, + behavior: &ShellBehavior, +) -> anyhow::Result<()> { if event != PromptEvent::Validate { return Ok(()); } ensure!(!args.is_empty(), "Shell command required"); - shell(cx, &args.join(" "), &ShellBehavior::Replace); + shell(cx, &args.join(" "), behavior); Ok(()) } @@ -2292,6 +2309,13 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[ fun: pipe, completer: None, }, + TypableCommand { + name: "pipe-to", + aliases: &[], + doc: "Pipe each selection to the shell command, ignoring output.", + fun: pipe_to, + completer: None, + }, TypableCommand { name: "run-shell-command", aliases: &["sh"], From bae890d8faa993333d81e662b6f0a6bc5e921a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Mon, 12 Dec 2022 17:49:57 +0900 Subject: [PATCH 152/352] Update tree-sitter-scheme --- languages.toml | 2 +- runtime/queries/rust/highlights.scm | 11 +++++- runtime/queries/scheme/highlights.scm | 55 +++++++++++++-------------- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/languages.toml b/languages.toml index dae675dfc14d..e6bc344ccfee 100644 --- a/languages.toml +++ b/languages.toml @@ -1583,7 +1583,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "scheme" -source = { git = "https://github.com/6cdh/tree-sitter-scheme", rev = "27fb77db05f890c2823b4bd751c6420378df146b" } +source = { git = "https://github.com/6cdh/tree-sitter-scheme", rev = "c0741320bfca6b7b5b7a13b5171275951e96a842" } [[language]] name = "v" diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm index 5606e93d3007..d3c292708b63 100644 --- a/runtime/queries/rust/highlights.scm +++ b/runtime/queries/rust/highlights.scm @@ -5,8 +5,6 @@ ; overrides are unnecessary. ; ------- - - ; ------- ; Types ; ------- @@ -241,6 +239,14 @@ +(attribute + (identifier) @_macro + arguments: (token_tree (identifier) @constant.numeric.integer) + (#eq? @_macro "derive") +) +@special + + ; ------- ; Functions ; ------- @@ -271,6 +277,7 @@ ; --- ; Macros ; --- + (attribute (identifier) @function.macro) (attribute diff --git a/runtime/queries/scheme/highlights.scm b/runtime/queries/scheme/highlights.scm index 3b7a42755b1b..468193745d93 100644 --- a/runtime/queries/scheme/highlights.scm +++ b/runtime/queries/scheme/highlights.scm @@ -2,29 +2,40 @@ (character) @constant.character (boolean) @constant.builtin.boolean -[(string) - (character)] @string +(string) @string (escape_sequence) @constant.character.escape -[(comment) - (block_comment) - (directive)] @comment +(comment) @comment.line +(block_comment) @comment.block +(directive) @keyword.directive -[(boolean) - (character)] @constant +; operators -((symbol) @function.builtin - (#match? @function.builtin "^(eqv\\?|eq\\?|equal\\?)")) ; TODO +((symbol) @operator + (#match? @operator "^(\\+|-|\\*|/|=|>|<|>=|<=)$")) ; keywords -((symbol) @keyword.conditional - (#match? @keyword.conditional "^(if|cond|case|when|unless)$")) +(list + . + ((symbol) @keyword.conditional + (#match? @keyword.conditional "^(if|cond|case|when|unless)$" + ))) -((symbol) @keyword - (#match? @keyword - "^(define|lambda|begin|do|define-syntax|and|or|if|cond|case|when|unless|else|=>|let|let*|let-syntax|let-values|let*-values|letrec|letrec*|letrec-syntax|set!|syntax-rules|identifier-syntax|quote|unquote|quote-splicing|quasiquote|unquote-splicing|delay|assert|library|export|import|rename|only|except|prefix)$")) +(list + . + (symbol) @keyword + (#match? @keyword + "^(define-syntax|let\\*|lambda|λ|case|=>|quote-splicing|unquote-splicing|set!|let|letrec|letrec-syntax|let-values|let\\*-values|do|else|define|cond|syntax-rules|unquote|begin|quote|let-syntax|and|if|quasiquote|letrec|delay|or|when|unless|identifier-syntax|assert|library|export|import|rename|only|except|prefix)$" + )) + +(list + . + (symbol) @function.builtin + (#match? @function.builtin + "^(caar|cadr|call-with-input-file|call-with-output-file|cdar|cddr|list|open-input-file|open-output-file|with-input-from-file|with-output-to-file|\\*|\\+|-|/|<|<=|=|>|>=|abs|acos|angle|append|apply|asin|assoc|assq|assv|atan|boolean\\?|caaaar|caaadr|caaar|caadar|caaddr|caadr|cadaar|cadadr|cadar|caddar|cadddr|caddr|call-with-current-continuation|call-with-values|car|cdaaar|cdaadr|cdaar|cdadar|cdaddr|cdadr|cddaar|cddadr|cddar|cdddar|cddddr|cdddr|cdr|ceiling|char->integer|char-alphabetic\\?|char-ci<=\\?|char-ci<\\?|char-ci=\\?|char-ci>=\\?|char-ci>\\?|char-downcase|char-lower-case\\?|char-numeric\\?|char-ready\\?|char-upcase|char-upper-case\\?|char-whitespace\\?|char<=\\?|char<\\?|char=\\?|char>=\\?|char>\\?|char\\?|close-input-port|close-output-port|complex\\?|cons|cos|current-error-port|current-input-port|current-output-port|denominator|display|dynamic-wind|eof-object\\?|eq\\?|equal\\?|eqv\\?|eval|even\\?|exact->inexact|exact\\?|exp|expt|floor|flush-output|for-each|force|gcd|imag-part|inexact->exact|inexact\\?|input-port\\?|integer->char|integer\\?|interaction-environment|lcm|length|list->string|list->vector|list-ref|list-tail|list\\?|load|log|magnitude|make-polar|make-rectangular|make-string|make-vector|map|max|member|memq|memv|min|modulo|negative\\?|newline|not|null-environment|null\\?|number->string|number\\?|numerator|odd\\?|output-port\\?|pair\\?|peek-char|positive\\?|procedure\\?|quotient|rational\\?|rationalize|read|read-char|real-part|real\\?|remainder|reverse|round|scheme-report-environment|set-car!|set-cdr!|sin|sqrt|string|string->list|string->number|string->symbol|string-append|string-ci<=\\?|string-ci<\\?|string-ci=\\?|string-ci>=\\?|string-ci>\\?|string-copy|string-fill!|string-length|string-ref|string-set!|string<=\\?|string<\\?|string=\\?|string>=\\?|string>\\?|string\\?|substring|symbol->string|symbol\\?|tan|transcript-off|transcript-on|truncate|values|vector|vector->list|vector-fill!|vector-length|vector-ref|vector-set!|vector\\?|write|write-char|zero\\?)$" + )) ; special forms @@ -47,26 +58,16 @@ . (list (list - (symbol) @variable)) + (symbol) @variable.parameter)) (#match? @_f "^(let|let\\*|let-syntax|let-values|let\\*-values|letrec|letrec\\*|letrec-syntax)$")) -; operators - -(list - . - (symbol) @operator - (#match? @operator "^([+*/<>=-]|(<=)|(>=))$")) - ; quote -(abbreviation - "'" (symbol)) @constant - (list . (symbol) @_f - (#eq? @_f "quote")) @symbol + (#eq? @_f "quote")) @string.symbol ; library @@ -89,12 +90,10 @@ ((symbol) @variable.builtin (#eq? @variable.builtin "...")) -(symbol) @variable ((symbol) @variable.builtin (#eq? @variable.builtin ".")) (symbol) @variable - ["(" ")" "[" "]" "{" "}"] @punctuation.bracket From f995f2610b3ad3aa68cec42ea14ce067a1ed3655 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 17:20:26 -0600 Subject: [PATCH 153/352] build(deps): bump serde from 1.0.149 to 1.0.150 (#5138) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.149 to 1.0.150. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.149...v1.0.150) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] 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 b204214fc42e..040a039c4f2b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1805,18 +1805,18 @@ checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" [[package]] name = "serde" -version = "1.0.149" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" +checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.149" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" +checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" dependencies = [ "proc-macro2", "quote", From fa436fa680b5bcf6d46666a03ae23b94a74e0414 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 17:25:05 -0600 Subject: [PATCH 154/352] build(deps): bump tokio from 1.22.0 to 1.23.0 (#5137) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.22.0 to 1.23.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.22.0...tokio-1.23.0) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- helix-lsp/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 040a039c4f2b..6ae0a71f8c1b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2100,9 +2100,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.22.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76ce4a75fb488c605c54bf610f221cea8b0dafb53333c1a67e8ee199dcd2ae3" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" dependencies = [ "autocfg", "bytes", @@ -2115,7 +2115,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "winapi", + "windows-sys", ] [[package]] diff --git a/helix-lsp/Cargo.toml b/helix-lsp/Cargo.toml index 05c5467ea8ac..d04edcd52288 100644 --- a/helix-lsp/Cargo.toml +++ b/helix-lsp/Cargo.toml @@ -23,6 +23,6 @@ lsp-types = { version = "0.93", features = ["proposed"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" thiserror = "1.0" -tokio = { version = "1.22", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot", "sync"] } +tokio = { version = "1.23", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot", "sync"] } tokio-stream = "0.1.11" which = "4.2" From 00092a29c4f8ca7402455a9a494147ee3521bd4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Tue, 13 Dec 2022 15:07:20 +0900 Subject: [PATCH 155/352] Use dtolnay/rust-toolchain in more places --- .github/workflows/build.yml | 9 ++------ .github/workflows/release.yml | 42 ++++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index deeff80e1059..3a4896f1ecf1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,10 +44,7 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - uses: helix-editor/rust-toolchain@v1 - with: - profile: minimal - override: true + uses: dtolnay/rust-toolchain@1.61 - uses: Swatinem/rust-cache@v2 @@ -76,10 +73,8 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - uses: helix-editor/rust-toolchain@v1 + uses: dtolnay/rust-toolchain@1.61 with: - profile: minimal - override: true components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c242f089464b..8c105bfcf317 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,10 +26,7 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - uses: helix-editor/rust-toolchain@v1 - with: - profile: minimal - override: true + uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 @@ -47,6 +44,16 @@ jobs: dist: name: Dist needs: [fetch-grammars] + env: + # For some builds, we use cross to test on 32-bit and big-endian + # systems. + CARGO: cargo + # When CARGO is set to CROSS, this is set to `--target matrix.target`. + TARGET_FLAGS: + # When CARGO is set to CROSS, TARGET_DIR includes matrix.target. + TARGET_DIR: ./target + # Emit backtraces on panics. + RUST_BACKTRACE: 1 runs-on: ${{ matrix.os }} strategy: fail-fast: false # don't fail other jobs if one fails @@ -107,12 +114,10 @@ jobs: tar xJf grammars/grammars.tar.xz -C runtime/grammars/sources - name: Install ${{ matrix.rust }} toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ matrix.rust }} target: ${{ matrix.target }} - override: true # Install a pre-release version of Cross # TODO: We need to pre-install Cross because we need cross-rs/cross#591 to @@ -120,15 +125,20 @@ jobs: # 0.3.0, which includes cross-rs/cross#591, is released. - name: Install Cross if: "matrix.cross" - run: cargo install cross --git https://github.com/cross-rs/cross.git --rev 47df5c76e7cba682823a0b6aa6d95c17b31ba63a + run: | + cargo install cross --git https://github.com/cross-rs/cross.git --rev 47df5c76e7cba682823a0b6aa6d95c17b31ba63a + echo "CARGO=cross" >> $GITHUB_ENV + # echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV + # echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV + + - name: Show command used for Cargo + run: | + echo "cargo command is: ${{ env.CARGO }}" + echo "target flag is: ${{ env.TARGET_FLAGS }}" - name: Run cargo test - uses: actions-rs/cargo@v1 if: "!matrix.skip_tests" - with: - use-cross: ${{ matrix.cross }} - command: test - args: --release --locked --target ${{ matrix.target }} --workspace + run: ${{ env.CARGO }} test --release --locked --target ${{ matrix.target }} --workspace - name: Set profile.release.strip = true shell: bash @@ -139,11 +149,7 @@ jobs: EOF - name: Build release binary - uses: actions-rs/cargo@v1 - with: - use-cross: ${{ matrix.cross }} - command: build - args: --release --locked --target ${{ matrix.target }} + run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }} - name: Build AppImage shell: bash From e6fce860b10faab1cb50b7709a67ded113364392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Tue, 13 Dec 2022 15:08:24 +0900 Subject: [PATCH 156/352] Use latest github runner images --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8c105bfcf317..9518a5373ccb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,17 +61,17 @@ jobs: build: [x86_64-linux, x86_64-macos, x86_64-windows] #, x86_64-win-gnu, win32-msvc include: - build: x86_64-linux - os: ubuntu-20.04 + os: ubuntu-latest rust: stable target: x86_64-unknown-linux-gnu cross: false - build: aarch64-linux - os: ubuntu-20.04 + os: ubuntu-latest rust: stable target: aarch64-unknown-linux-gnu cross: true - build: riscv64-linux - os: ubuntu-20.04 + os: ubuntu-latest rust: stable target: riscv64gc-unknown-linux-gnu cross: true @@ -81,7 +81,7 @@ jobs: target: x86_64-apple-darwin cross: false - build: x86_64-windows - os: windows-2019 + os: windows-latest rust: stable target: x86_64-pc-windows-msvc cross: false From 0f2ae35a1336d5fef823127dc134ed5675e5b9cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Tue, 13 Dec 2022 15:14:40 +0900 Subject: [PATCH 157/352] ci: Merge two jobs --- .github/workflows/build.yml | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a4896f1ecf1..0d6fcb3e8426 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -98,13 +98,13 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - uses: helix-editor/rust-toolchain@v1 - with: - profile: minimal - override: true + uses: dtolnay/rust-toolchain@1.61 - uses: Swatinem/rust-cache@v2 + - name: Validate queries + run: cargo xtask query-check + - name: Generate docs run: cargo xtask docgen @@ -115,20 +115,3 @@ jobs: || (echo "Run 'cargo xtask docgen', commit the changes and push again" \ && exit 1) - queries: - name: Tree-sitter queries - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Install stable toolchain - uses: helix-editor/rust-toolchain@v1 - with: - profile: minimal - override: true - - - uses: Swatinem/rust-cache@v2 - - - name: Generate docs - run: cargo xtask query-check From 436296b76c671446aab8863b467155ff9e94d4fc Mon Sep 17 00:00:00 2001 From: Erasin Date: Wed, 14 Dec 2022 21:51:00 +0800 Subject: [PATCH 158/352] Add Mermaid.js for markdown support (#5147) --- book/src/generated/lang-support.md | 1 + languages.toml | 13 ++ runtime/queries/mermaid/highlights.scm | 187 +++++++++++++++++++++++++ 3 files changed, 201 insertions(+) create mode 100644 runtime/queries/mermaid/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 4dca810478db..fa7b6edd30f1 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -77,6 +77,7 @@ | make | ✓ | | | | | markdown | ✓ | | | `marksman` | | markdown.inline | ✓ | | | | +| mermaid | ✓ | | | | | meson | ✓ | | ✓ | | | mint | | | | `mint` | | nickel | ✓ | | ✓ | `nls` | diff --git a/languages.toml b/languages.toml index e6bc344ccfee..e28476d3118a 100644 --- a/languages.toml +++ b/languages.toml @@ -2043,3 +2043,16 @@ grammar = "qmljs" [[grammar]] name = "qmljs" source = { git = "https://github.com/yuja/tree-sitter-qmljs", rev = "0b2b25bcaa7d4925d5f0dda16f6a99c588a437f1" } + +[[language]] +name = "mermaid" +scope = "source.mermaid" +injection-regex = "mermaid" +file-types = ["mermaid"] +roots = [] +comment-token = "%%" +indent = { tab-width = 4, unit = " " } + +[[grammar]] +name = "mermaid" +source = { git = "https://github.com/monaqa/tree-sitter-mermaid", rev = "d787c66276e7e95899230539f556e8b83ee16f6d" } diff --git a/runtime/queries/mermaid/highlights.scm b/runtime/queries/mermaid/highlights.scm new file mode 100644 index 000000000000..b546d39f27ab --- /dev/null +++ b/runtime/queries/mermaid/highlights.scm @@ -0,0 +1,187 @@ +[ + "sequenceDiagram" + "classDiagram" + "classDiagram-v2" + "stateDiagram" + "stateDiagram-v2" + "gantt" + "pie" + "flowchart" + "erdiagram" + + "participant" + "as" + "activate" + "deactivate" + "note " + "over" + "link" + "links" + ; "left of" + ; "right of" + "properties" + "details" + "title" + "loop" + "rect" + "opt" + "alt" + "else" + "par" + "and" + "end" + (sequence_stmt_autonumber) + (note_placement_left) + (note_placement_right) + + "class" + + "state " + + "dateformat" + "inclusiveenddates" + "topaxis" + "axisformat" + "includes" + "excludes" + "todaymarker" + "title" + "section" + + "direction" + "subgraph" + + ] @keyword + +[ + (comment) + ] @comment + +(flow_vertex_id) @type +(flow_arrow_text) @label +(flow_text_literal) @string + +[ + ":" + (sequence_signal_plus_sign) + (sequence_signal_minus_sign) + + (class_visibility_public) + (class_visibility_private) + (class_visibility_protected) + (class_visibility_internal) + + (state_division) + ] @punctuation.delimiter + +[ + "(" + ")" + "{" + "}" + ] @punctuation.bracket + +[ + "-->" + (solid_arrow) + (dotted_arrow) + (solid_open_arrow) + (dotted_open_arrow) + (solid_cross) + (dotted_cross) + (solid_point) + (dotted_point) + ] @operator + +[ + (class_reltype_aggregation) + (class_reltype_extension) + (class_reltype_composition) + (class_reltype_dependency) + (class_linetype_solid) + (class_linetype_dotted) + "&" + ] @operator + +(sequence_actor) @variable +(sequence_text) @string + +(class_name) @type +(class_label) @string +(class_method_line) @function.method + +(state_name) @variable + +(gantt_section) @markup.heading +(gantt_task_text) @variable.builtin +(gantt_task_data) @string + +[ + (class_annotation_line) + (class_stmt_annotation) + (class_generics) + + (state_annotation_fork) + (state_annotation_join) + (state_annotation_choice) + ] @type + +(directive) @keyword.directive + +(pie_label) @string +(pie_value) @constant.numeric + +[ +(flowchart_direction_lr) +(flowchart_direction_rl) +(flowchart_direction_tb) +(flowchart_direction_bt) + ] @constant + +(flow_vertex_id) @variable + +[ + (flow_link_arrow) + (flow_link_arrow_start) + ] @operator + +(flow_link_arrowtext "|" @punctuation.bracket) + +(flow_vertex_square [ "[" "]" ] @punctuation.bracket ) +(flow_vertex_circle ["((" "))"] @punctuation.bracket ) +(flow_vertex_ellipse ["(-" "-)"] @punctuation.bracket ) +(flow_vertex_stadium ["([" "])"] @punctuation.bracket ) +(flow_vertex_subroutine ["[[" "]]"] @punctuation.bracket ) +(flow_vertex_rect ["[|" "|]"] @punctuation.bracket ) +(flow_vertex_cylinder ["[(" ")]"] @punctuation.bracket ) +(flow_vertex_round ["(" ")"] @punctuation.bracket ) +(flow_vertex_diamond ["{" "}"] @punctuation.bracket ) +(flow_vertex_hexagon ["{{" "}}"] @punctuation.bracket ) +(flow_vertex_odd [">" "]"] @punctuation.bracket ) +(flow_vertex_trapezoid ["[/" "\\]"] @punctuation.bracket ) +(flow_vertex_inv_trapezoid ["[\\" "/]"] @punctuation.bracket ) +(flow_vertex_leanright ["[/" "/]"] @punctuation.bracket ) +(flow_vertex_leanleft ["[\\" "\\]"] @punctuation.bracket ) + +(flow_stmt_subgraph ["[" "]"] @punctuation.bracket ) + +[ + (er_cardinarity_zero_or_one) + (er_cardinarity_zero_or_more) + (er_cardinarity_one_or_more) + (er_cardinarity_only_one) + (er_reltype_non_identifying) + (er_reltype_identifying) + ] @operator + +(er_entity_name) @variable + +(er_attribute_type) @type +(er_attribute_name) @variable + +[ + (er_attribute_key_type_pk) + (er_attribute_key_type_fk) + ] @keyword + +(er_attribute_comment) @string From 012fc12f97f4e8e0fc38af351388e41e8bc142d8 Mon Sep 17 00:00:00 2001 From: gavincrawford <94875769+gavincrawford@users.noreply.github.com> Date: Wed, 14 Dec 2022 07:42:11 -0700 Subject: [PATCH 159/352] Add Bash indents (#5149) --- book/src/generated/lang-support.md | 2 +- runtime/queries/bash/indents.scm | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 runtime/queries/bash/indents.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index fa7b6edd30f1..1400fa875795 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -2,7 +2,7 @@ | --- | --- | --- | --- | --- | | astro | ✓ | | | | | awk | ✓ | ✓ | | `awk-language-server` | -| bash | ✓ | | | `bash-language-server` | +| bash | ✓ | | ✓ | `bash-language-server` | | bass | ✓ | | | `bass` | | beancount | ✓ | | | | | bibtex | ✓ | | | `texlab` | diff --git a/runtime/queries/bash/indents.scm b/runtime/queries/bash/indents.scm new file mode 100644 index 000000000000..f2077037d2e9 --- /dev/null +++ b/runtime/queries/bash/indents.scm @@ -0,0 +1,11 @@ +[ + (function_definition) + (if_statement) + (for_statement) + (case_statement) + (pipeline) +] @indent + +[ + "}" +] @outdent From db939801ebf299f11a6a52bdff7a3c9bfb87fc34 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 15 Dec 2022 02:49:49 -0600 Subject: [PATCH 160/352] Improve error message handling for theme loading failures (#5073) The error messages for a theme that failed to be deserialized (or otherwise failed to load) were covered up by the context/with_context calls: * The log message for a bad theme configured in config.toml would only say "Failed to deserilaize theme" * Selecting a bad theme via :theme would show "Theme does not exist" With these changes, we let the TOML deserializer errors bubble up, so the error messages can now say the line number of a duplicated key - and that key's name - when a theme fails to load because of a duplicated key. Providing a theme which does not exist to :theme still gives a helpful error message: "No such file or directory." --- helix-term/src/commands/typed.rs | 2 +- helix-view/src/theme.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 2119a48d67a4..cb387fcb5b64 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -777,7 +777,7 @@ fn theme( .editor .theme_loader .load(theme_name) - .with_context(|| "Theme does not exist")?; + .map_err(|err| anyhow::anyhow!("Could not load theme: {}", err))?; if !(true_color || theme.is_16_color()) { bail!("Unsupported theme: theme requires true color support"); } diff --git a/helix-view/src/theme.rs b/helix-view/src/theme.rs index f1219ec5dc17..b2c8a79f76aa 100644 --- a/helix-view/src/theme.rs +++ b/helix-view/src/theme.rs @@ -136,8 +136,9 @@ impl Loader { // Loads the theme data as `toml::Value` first from the user_dir then in default_dir fn load_toml(&self, path: PathBuf) -> Result { let data = std::fs::read(&path)?; + let value = toml::from_slice(data.as_slice())?; - toml::from_slice(data.as_slice()).context("Failed to deserialize theme") + Ok(value) } // Returns the path to the theme with the name From c64debc7412c0769db8186694bd89f85ea057b1b Mon Sep 17 00:00:00 2001 From: Gokul Soumya Date: Tue, 19 Jul 2022 21:28:14 +0530 Subject: [PATCH 161/352] Add force_score() for scoring picker items without optimizations --- helix-term/src/ui/picker.rs | 45 +++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 5e9ca3d887a5..8b5d20eca6b8 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -469,34 +469,41 @@ impl Picker { self.matches.sort_unstable(); } else { - let query = FuzzyQuery::new(pattern); - self.matches.clear(); - self.matches.extend( - self.options - .iter() - .enumerate() - .filter_map(|(index, option)| { - let text = option.filter_text(&self.editor_data); - - query - .fuzzy_match(&text, &self.matcher) - .map(|score| PickerMatch { - index, - score, - len: text.chars().count(), - }) - }), - ); - self.matches.sort_unstable(); + self.force_score(); } log::debug!("picker score {:?}", Instant::now().duration_since(now)); // reset cursor position self.cursor = 0; + let pattern = self.prompt.line(); self.previous_pattern.clone_from(pattern); } + pub fn force_score(&mut self) { + let pattern = self.prompt.line(); + + let query = FuzzyQuery::new(pattern); + self.matches.clear(); + self.matches.extend( + self.options + .iter() + .enumerate() + .filter_map(|(index, option)| { + let text = option.filter_text(&self.editor_data); + + query + .fuzzy_match(&text, &self.matcher) + .map(|score| PickerMatch { + index, + score, + len: text.chars().count(), + }) + }), + ); + self.matches.sort_unstable(); + } + /// Move the cursor by a number of lines, either down (`Forward`) or up (`Backward`) pub fn move_by(&mut self, amount: usize, direction: Direction) { let len = self.matches.len(); From 914d2944997e11cf76eeabfe43f9031aeb2b1721 Mon Sep 17 00:00:00 2001 From: Gokul Soumya Date: Tue, 19 Jul 2022 21:49:02 +0530 Subject: [PATCH 162/352] Add DynamicPicker for updating options on every key --- helix-term/src/ui/mod.rs | 2 +- helix-term/src/ui/overlay.rs | 4 ++ helix-term/src/ui/picker.rs | 74 +++++++++++++++++++++++++++++++++++- 3 files changed, 78 insertions(+), 2 deletions(-) diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index 107e48dd1ca3..5b5924bff0e8 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -19,7 +19,7 @@ pub use completion::Completion; pub use editor::EditorView; pub use markdown::Markdown; pub use menu::Menu; -pub use picker::{FileLocation, FilePicker, Picker}; +pub use picker::{DynamicPicker, FileLocation, FilePicker, Picker}; pub use popup::Popup; pub use prompt::{Prompt, PromptEvent}; pub use spinner::{ProgressSpinners, Spinner}; diff --git a/helix-term/src/ui/overlay.rs b/helix-term/src/ui/overlay.rs index 0b8a93ae833d..5b2bc806093d 100644 --- a/helix-term/src/ui/overlay.rs +++ b/helix-term/src/ui/overlay.rs @@ -69,4 +69,8 @@ impl Component for Overlay { let dimensions = (self.calc_child_size)(area); self.content.cursor(dimensions, ctx) } + + fn id(&self) -> Option<&'static str> { + self.content.id() + } } diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 8b5d20eca6b8..821a282cf61f 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -3,6 +3,7 @@ use crate::{ ctrl, key, shift, ui::{self, fuzzy_match::FuzzyQuery, EditorView}, }; +use futures_util::future::BoxFuture; use tui::{ buffer::Buffer as Surface, widgets::{Block, BorderType, Borders}, @@ -22,7 +23,7 @@ use helix_view::{ Document, DocumentId, Editor, }; -use super::menu::Item; +use super::{menu::Item, overlay::Overlay}; pub const MIN_AREA_WIDTH_FOR_PREVIEW: u16 = 72; /// Biggest file size to preview in bytes @@ -751,3 +752,74 @@ impl Component for Picker { self.prompt.cursor(area, editor) } } + +/// Returns a new list of options to replace the contents of the picker +/// when called with the current picker query, +pub type DynQueryCallback = + Box BoxFuture<'static, anyhow::Result>>>; + +/// A picker that updates its contents via a callback whenever the +/// query string changes. Useful for live grep, workspace symbols, etc. +pub struct DynamicPicker { + file_picker: FilePicker, + query_callback: DynQueryCallback, +} + +impl DynamicPicker { + pub const ID: &'static str = "dynamic-picker"; + + pub fn new(file_picker: FilePicker, query_callback: DynQueryCallback) -> Self { + Self { + file_picker, + query_callback, + } + } +} + +impl Component for DynamicPicker { + fn render(&mut self, area: Rect, surface: &mut Surface, cx: &mut Context) { + self.file_picker.render(area, surface, cx); + } + + fn handle_event(&mut self, event: &Event, cx: &mut Context) -> EventResult { + let prev_query = self.file_picker.picker.prompt.line().to_owned(); + let event_result = self.file_picker.handle_event(event, cx); + let current_query = self.file_picker.picker.prompt.line(); + + if *current_query == prev_query || matches!(event_result, EventResult::Ignored(_)) { + return event_result; + } + + let new_options = (self.query_callback)(current_query.to_owned(), cx.editor); + + cx.jobs.callback(async move { + let new_options = new_options.await?; + let callback = + crate::job::Callback::EditorCompositor(Box::new(move |_editor, compositor| { + // Wrapping of pickers in overlay is done outside the picker code, + // so this is fragile and will break if wrapped in some other widget. + let picker = match compositor.find_id::>>(Self::ID) { + Some(overlay) => &mut overlay.content.file_picker.picker, + None => return, + }; + picker.options = new_options; + picker.cursor = 0; + picker.force_score(); + })); + anyhow::Ok(callback) + }); + EventResult::Consumed(None) + } + + fn cursor(&self, area: Rect, ctx: &Editor) -> (Option, CursorKind) { + self.file_picker.cursor(area, ctx) + } + + fn required_size(&mut self, viewport: (u16, u16)) -> Option<(u16, u16)> { + self.file_picker.required_size(viewport) + } + + fn id(&self) -> Option<&'static str> { + Some(Self::ID) + } +} From d1f717eb8d02205ce224292f157bfe1bddd1f6db Mon Sep 17 00:00:00 2001 From: Gokul Soumya Date: Tue, 19 Jul 2022 22:15:03 +0530 Subject: [PATCH 163/352] Re-request workspace symbols on keypress in picker Most language servers limit the number of workspace symbols that are returned with an empty query even though all symbols are supposed to be returned, according to the spec (for perfomance reasons). This patch adds a workspace symbol picker based on a dynamic picker that allows re-requesting the symbols on every keypress (i.e. when the picker query text changes). The old behavior has been completely replaced, and I have only tested with rust-analyzer so far. --- helix-term/src/commands/lsp.rs | 50 ++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index 810e3adf1115..8052dcac2f48 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -1,3 +1,4 @@ +use futures_util::FutureExt; use helix_lsp::{ block_on, lsp::{self, CodeAction, CodeActionOrCommand, DiagnosticSeverity, NumberOrString}, @@ -14,7 +15,8 @@ use helix_view::{apply_transaction, document::Mode, editor::Action, theme::Style use crate::{ compositor::{self, Compositor}, ui::{ - self, lsp::SignatureHelp, overlay::overlayed, FileLocation, FilePicker, Popup, PromptEvent, + self, lsp::SignatureHelp, overlay::overlayed, DynamicPicker, FileLocation, FilePicker, + Popup, PromptEvent, }, }; @@ -384,10 +386,48 @@ pub fn workspace_symbol_picker(cx: &mut Context) { cx.callback( future, move |_editor, compositor, response: Option>| { - if let Some(symbols) = response { - let picker = sym_picker(symbols, current_url, offset_encoding); - compositor.push(Box::new(overlayed(picker))) - } + let symbols = match response { + Some(s) => s, + None => return, + }; + let picker = sym_picker(symbols, current_url, offset_encoding); + let get_symbols = |query: String, editor: &mut Editor| { + let doc = doc!(editor); + let language_server = match doc.language_server() { + Some(s) => s, + None => { + // This should not generally happen since the picker will not + // even open in the first place if there is no server. + return async move { Err(anyhow::anyhow!("LSP not active")) }.boxed(); + } + }; + let symbol_request = match language_server.workspace_symbols(query) { + Some(future) => future, + None => { + // This should also not happen since the language server must have + // supported workspace symbols before to reach this block. + return async move { + Err(anyhow::anyhow!( + "Language server does not support workspace symbols" + )) + } + .boxed(); + } + }; + + let future = async move { + let json = symbol_request.await?; + let response: Option> = + serde_json::from_value(json)?; + + response.ok_or_else(|| { + anyhow::anyhow!("No response for workspace symbols from language server") + }) + }; + future.boxed() + }; + let dyn_picker = DynamicPicker::new(picker, Box::new(get_symbols)); + compositor.push(Box::new(overlayed(dyn_picker))) }, ) } From a7daa02346789e43af51db2b944b0dc516354a29 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Wed, 7 Dec 2022 16:27:31 -0600 Subject: [PATCH 164/352] DynamicPicker: Use idle-timeout as debounce This change uses the idle-timeout event to trigger fetching new results in the DynamicPicker, so idle-timeout becomes a sort of debounce. This prevents querying the language server overly aggressively. --- helix-term/src/ui/picker.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 821a282cf61f..35597843bbf3 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -763,6 +763,7 @@ pub type DynQueryCallback = pub struct DynamicPicker { file_picker: FilePicker, query_callback: DynQueryCallback, + query: String, } impl DynamicPicker { @@ -772,6 +773,7 @@ impl DynamicPicker { Self { file_picker, query_callback, + query: String::new(), } } } @@ -782,14 +784,15 @@ impl Component for DynamicPicker { } fn handle_event(&mut self, event: &Event, cx: &mut Context) -> EventResult { - let prev_query = self.file_picker.picker.prompt.line().to_owned(); let event_result = self.file_picker.handle_event(event, cx); let current_query = self.file_picker.picker.prompt.line(); - if *current_query == prev_query || matches!(event_result, EventResult::Ignored(_)) { + if !matches!(event, Event::IdleTimeout) || self.query == *current_query { return event_result; } + self.query.clone_from(current_query); + let new_options = (self.query_callback)(current_query.to_owned(), cx.editor); cx.jobs.callback(async move { From 35cf972ce459eda6ceffb7a7c256a4bc9f4e6e39 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Wed, 7 Dec 2022 16:24:32 -0600 Subject: [PATCH 165/352] DynamicPicker: Reset idle timeout on refresh If the new results shown by the picker select a file that hasn't been previewed before, the idle timeout would not trigger highlighting on that file. With this change, we reset the idle timeout and allow that file to be highlighted on the next idle timeout event. --- helix-term/src/ui/picker.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 35597843bbf3..2d471aae6e8e 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -798,7 +798,7 @@ impl Component for DynamicPicker { cx.jobs.callback(async move { let new_options = new_options.await?; let callback = - crate::job::Callback::EditorCompositor(Box::new(move |_editor, compositor| { + crate::job::Callback::EditorCompositor(Box::new(move |editor, compositor| { // Wrapping of pickers in overlay is done outside the picker code, // so this is fragile and will break if wrapped in some other widget. let picker = match compositor.find_id::>>(Self::ID) { @@ -808,6 +808,7 @@ impl Component for DynamicPicker { picker.options = new_options; picker.cursor = 0; picker.force_score(); + editor.reset_idle_timer(); })); anyhow::Ok(callback) }); From 2a60de74f9ccc935fa65031cfe30c62cf07bbbaf Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 8 Dec 2022 19:54:15 -0600 Subject: [PATCH 166/352] workspace symbols: Default to empty Vec on None A language server might send None as the response to workspace symbols. We should treat this as the empty Vec rather than the server sending an error status. This fixes the interaction with gopls which uses None to mean no matching symbols. --- helix-term/src/commands/lsp.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index 8052dcac2f48..86b0c5fa7417 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -386,10 +386,7 @@ pub fn workspace_symbol_picker(cx: &mut Context) { cx.callback( future, move |_editor, compositor, response: Option>| { - let symbols = match response { - Some(s) => s, - None => return, - }; + let symbols = response.unwrap_or_default(); let picker = sym_picker(symbols, current_url, offset_encoding); let get_symbols = |query: String, editor: &mut Editor| { let doc = doc!(editor); @@ -420,9 +417,7 @@ pub fn workspace_symbol_picker(cx: &mut Context) { let response: Option> = serde_json::from_value(json)?; - response.ok_or_else(|| { - anyhow::anyhow!("No response for workspace symbols from language server") - }) + Ok(response.unwrap_or_default()) }; future.boxed() }; From 42ad1a9e043e2e0fb148924ff79b9abbe06907ae Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 15 Dec 2022 02:57:31 -0600 Subject: [PATCH 167/352] Select diagnostic range in goto_*_diag commands (#4713) This roughly matches the behavior of the diagnostic picker: when jumping to a diagnostic with `[d`/`]d`/`[D`/`]D`, the range of the diagnostic is selected instead of the start point. --- helix-term/src/commands.rs | 50 +++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 1310417e47be..0f04ecba6c31 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2789,35 +2789,28 @@ fn exit_select_mode(cx: &mut Context) { } } -fn goto_pos(editor: &mut Editor, pos: usize) { - let (view, doc) = current!(editor); - - push_jump(view, doc); - doc.set_selection(view.id, Selection::point(pos)); - align_view(doc, view, Align::Center); -} - fn goto_first_diag(cx: &mut Context) { - let doc = doc!(cx.editor); - let pos = match doc.diagnostics().first() { - Some(diag) => diag.range.start, + let (view, doc) = current!(cx.editor); + let selection = match doc.diagnostics().first() { + Some(diag) => Selection::single(diag.range.start, diag.range.end), None => return, }; - goto_pos(cx.editor, pos); + doc.set_selection(view.id, selection); + align_view(doc, view, Align::Center); } fn goto_last_diag(cx: &mut Context) { - let doc = doc!(cx.editor); - let pos = match doc.diagnostics().last() { - Some(diag) => diag.range.start, + let (view, doc) = current!(cx.editor); + let selection = match doc.diagnostics().last() { + Some(diag) => Selection::single(diag.range.start, diag.range.end), None => return, }; - goto_pos(cx.editor, pos); + doc.set_selection(view.id, selection); + align_view(doc, view, Align::Center); } fn goto_next_diag(cx: &mut Context) { - let editor = &mut cx.editor; - let (view, doc) = current!(editor); + let (view, doc) = current!(cx.editor); let cursor_pos = doc .selection(view.id) @@ -2830,17 +2823,16 @@ fn goto_next_diag(cx: &mut Context) { .find(|diag| diag.range.start > cursor_pos) .or_else(|| doc.diagnostics().first()); - let pos = match diag { - Some(diag) => diag.range.start, + let selection = match diag { + Some(diag) => Selection::single(diag.range.start, diag.range.end), None => return, }; - - goto_pos(editor, pos); + doc.set_selection(view.id, selection); + align_view(doc, view, Align::Center); } fn goto_prev_diag(cx: &mut Context) { - let editor = &mut cx.editor; - let (view, doc) = current!(editor); + let (view, doc) = current!(cx.editor); let cursor_pos = doc .selection(view.id) @@ -2854,12 +2846,14 @@ fn goto_prev_diag(cx: &mut Context) { .find(|diag| diag.range.start < cursor_pos) .or_else(|| doc.diagnostics().last()); - let pos = match diag { - Some(diag) => diag.range.start, + let selection = match diag { + // NOTE: the selection is reversed because we're jumping to the + // previous diagnostic. + Some(diag) => Selection::single(diag.range.end, diag.range.start), None => return, }; - - goto_pos(editor, pos); + doc.set_selection(view.id, selection); + align_view(doc, view, Align::Center); } fn goto_first_change(cx: &mut Context) { From f916915b53fa6fedd3f9106bcf58163083cc052e Mon Sep 17 00:00:00 2001 From: Roberto Vidal Date: Thu, 15 Dec 2022 09:59:34 +0100 Subject: [PATCH 168/352] add redraw command (#4354) * add redraw command * update docs * Update helix-term/src/commands/typed.rs Co-authored-by: Michael Davis * update docs Co-authored-by: Michael Davis --- book/src/generated/typable-cmd.md | 1 + helix-term/src/commands/typed.rs | 29 +++++++++++++++++++++++++++++ helix-term/src/compositor.rs | 4 ++++ 3 files changed, 34 insertions(+) diff --git a/book/src/generated/typable-cmd.md b/book/src/generated/typable-cmd.md index 66e6ac039c26..269d63e37ce5 100644 --- a/book/src/generated/typable-cmd.md +++ b/book/src/generated/typable-cmd.md @@ -73,3 +73,4 @@ | `:pipe` | Pipe each selection to the shell command. | | `:pipe-to` | Pipe each selection to the shell command, ignoring output. | | `:run-shell-command`, `:sh` | Run a shell command | +| `:redraw` | Clear and re-render the whole UI | diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index cb387fcb5b64..90dde7e144e6 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -1808,6 +1808,28 @@ fn run_shell_command( Ok(()) } +fn redraw( + cx: &mut compositor::Context, + _args: &[Cow], + event: PromptEvent, +) -> anyhow::Result<()> { + if event != PromptEvent::Validate { + return Ok(()); + } + + let callback = Box::pin(async move { + let call: job::Callback = Box::new(|_editor, compositor| { + compositor.clear().expect("unable to redraw"); + }); + + Ok(call) + }); + + cx.jobs.callback(callback); + + Ok(()) +} + pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[ TypableCommand { name: "quit", @@ -2323,6 +2345,13 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[ fun: run_shell_command, completer: Some(completers::directory), }, + TypableCommand { + name: "redraw", + aliases: &[], + doc: "Clear and re-render the whole UI", + fun: redraw, + completer: None, + }, ]; pub static TYPABLE_COMMAND_MAP: Lazy> = diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs index 9dad36209c62..18620b7bb29c 100644 --- a/helix-term/src/compositor.rs +++ b/helix-term/src/compositor.rs @@ -197,6 +197,10 @@ impl Compositor { .find(|component| component.id() == Some(id)) .and_then(|component| component.as_any_mut().downcast_mut()) } + + pub fn clear(&mut self) -> std::io::Result<()> { + self.terminal.clear() + } } // View casting, taken straight from Cursive From 5c4a9cba9a14ca10437e979c884d2ccba78ef1e7 Mon Sep 17 00:00:00 2001 From: Sebastian Zivota Date: Thu, 15 Dec 2022 14:20:26 +0100 Subject: [PATCH 169/352] Restore deleted goto_pos function (#5164) --- helix-term/src/commands.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 0f04ecba6c31..6cf494646d85 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2789,6 +2789,14 @@ fn exit_select_mode(cx: &mut Context) { } } +fn goto_pos(editor: &mut Editor, pos: usize) { + let (view, doc) = current!(editor); + + push_jump(view, doc); + doc.set_selection(view.id, Selection::point(pos)); + align_view(doc, view, Align::Center); +} + fn goto_first_diag(cx: &mut Context) { let (view, doc) = current!(cx.editor); let selection = match doc.diagnostics().first() { From ec9aa6690244bccefac24037c9f7a659816bffdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 15 Dec 2022 22:23:06 +0900 Subject: [PATCH 170/352] Remove redraw to fix build --- book/src/generated/typable-cmd.md | 1 - helix-term/src/commands/typed.rs | 29 ----------------------------- helix-term/src/compositor.rs | 4 ---- 3 files changed, 34 deletions(-) diff --git a/book/src/generated/typable-cmd.md b/book/src/generated/typable-cmd.md index 269d63e37ce5..66e6ac039c26 100644 --- a/book/src/generated/typable-cmd.md +++ b/book/src/generated/typable-cmd.md @@ -73,4 +73,3 @@ | `:pipe` | Pipe each selection to the shell command. | | `:pipe-to` | Pipe each selection to the shell command, ignoring output. | | `:run-shell-command`, `:sh` | Run a shell command | -| `:redraw` | Clear and re-render the whole UI | diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 90dde7e144e6..cb387fcb5b64 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -1808,28 +1808,6 @@ fn run_shell_command( Ok(()) } -fn redraw( - cx: &mut compositor::Context, - _args: &[Cow], - event: PromptEvent, -) -> anyhow::Result<()> { - if event != PromptEvent::Validate { - return Ok(()); - } - - let callback = Box::pin(async move { - let call: job::Callback = Box::new(|_editor, compositor| { - compositor.clear().expect("unable to redraw"); - }); - - Ok(call) - }); - - cx.jobs.callback(callback); - - Ok(()) -} - pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[ TypableCommand { name: "quit", @@ -2345,13 +2323,6 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[ fun: run_shell_command, completer: Some(completers::directory), }, - TypableCommand { - name: "redraw", - aliases: &[], - doc: "Clear and re-render the whole UI", - fun: redraw, - completer: None, - }, ]; pub static TYPABLE_COMMAND_MAP: Lazy> = diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs index 18620b7bb29c..9dad36209c62 100644 --- a/helix-term/src/compositor.rs +++ b/helix-term/src/compositor.rs @@ -197,10 +197,6 @@ impl Compositor { .find(|component| component.id() == Some(id)) .and_then(|component| component.as_any_mut().downcast_mut()) } - - pub fn clear(&mut self) -> std::io::Result<()> { - self.terminal.clear() - } } // View casting, taken straight from Cursive From 3e6887648c386372839e29028a3459d4674ce68b Mon Sep 17 00:00:00 2001 From: alice Date: Fri, 16 Dec 2022 15:43:58 +0100 Subject: [PATCH 171/352] set 'c++' as a recognised extension for cpp (#5183) --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index e28476d3118a..d03726e72a91 100644 --- a/languages.toml +++ b/languages.toml @@ -190,7 +190,7 @@ source = { git = "https://github.com/tree-sitter/tree-sitter-c", rev = "7175a6dd name = "cpp" scope = "source.cpp" injection-regex = "cpp" -file-types = ["cc", "hh", "cpp", "hpp", "h", "ipp", "tpp", "cxx", "hxx", "ixx", "txx", "ino"] +file-types = ["cc", "hh", "c++", "cpp", "hpp", "h", "ipp", "tpp", "cxx", "hxx", "ixx", "txx", "ino"] roots = [] comment-token = "//" language-server = { command = "clangd" } From 9c9c775a27f23b2fa5c8c856af0b15671916efd6 Mon Sep 17 00:00:00 2001 From: Ifiok Jr Date: Sat, 17 Dec 2022 15:09:14 +0000 Subject: [PATCH 172/352] Fix a typo in the docs (#5191) --- book/src/keymap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/src/keymap.md b/book/src/keymap.md index 139e8fddf613..153294007ee6 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -317,7 +317,7 @@ Mappings in the style of [vim-unimpaired](https://github.com/tpope/vim-unimpaire | `]c` | Go to next comment (**TS**) | `goto_next_comment` | | `[c` | Go to previous comment (**TS**) | `goto_prev_comment` | | `]T` | Go to next test (**TS**) | `goto_next_test` | -| `]T` | Go to previous test (**TS**) | `goto_prev_test` | +| `[T` | Go to previous test (**TS**) | `goto_prev_test` | | `]p` | Go to next paragraph | `goto_next_paragraph` | | `[p` | Go to previous paragraph | `goto_prev_paragraph` | | `]g` | Go to next change | `goto_next_change` | From b12c65678aacc577b070c70307ef6fce528e4d85 Mon Sep 17 00:00:00 2001 From: Eric Thorburn <60004386+hyderix@users.noreply.github.com> Date: Sat, 17 Dec 2022 20:03:18 +0100 Subject: [PATCH 173/352] Print the binary required by the debug adapter (#5195) This commit addresses issue 5193, where the author requested that the name of the binary needed is printed along with the rest of the health information. This commit adds a format! macro which formats in the name of the binary and then it will be printed along with the rest of the debug information. The value in cmd is referenced to the call to which, and then consumed upon the call to format! --- helix-term/src/health.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helix-term/src/health.rs b/helix-term/src/health.rs index e8fbb84d0982..6558fe19fb4c 100644 --- a/helix-term/src/health.rs +++ b/helix-term/src/health.rs @@ -281,9 +281,9 @@ fn probe_protocol(protocol_name: &str, server_cmd: Option) -> std::io::R writeln!(stdout, "Configured {}: {}", protocol_name, cmd_name)?; if let Some(cmd) = server_cmd { - let path = match which::which(cmd) { + let path = match which::which(&cmd) { Ok(path) => path.display().to_string().green(), - Err(_) => "Not found in $PATH".to_string().red(), + Err(_) => format!("'{}' not found in $PATH", cmd).red(), }; writeln!(stdout, "Binary for {}: {}", protocol_name, path)?; } From e6a2df8c798537a7dc5aff264eeccc773525aa6c Mon Sep 17 00:00:00 2001 From: Alex Kladov Date: Sat, 17 Dec 2022 19:30:43 +0000 Subject: [PATCH 174/352] Better sorting in picker in case of ties (#5169) --- helix-term/src/ui/mod.rs | 3 ++- helix-term/src/ui/picker.rs | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/helix-term/src/ui/mod.rs b/helix-term/src/ui/mod.rs index 5b5924bff0e8..ade1d8cf4c7f 100644 --- a/helix-term/src/ui/mod.rs +++ b/helix-term/src/ui/mod.rs @@ -207,13 +207,14 @@ pub fn file_picker(root: PathBuf, config: &helix_view::editor::Config) -> FilePi // Cap the number of files if we aren't in a git project, preventing // hangs when using the picker in your home directory - let files: Vec<_> = if root.join(".git").exists() { + let mut files: Vec = if root.join(".git").exists() { files.collect() } else { // const MAX: usize = 8192; const MAX: usize = 100_000; files.take(MAX).collect() }; + files.sort(); log::debug!("file_picker init {:?}", Instant::now().duration_since(now)); diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 2d471aae6e8e..aad3f81ceac3 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -12,7 +12,10 @@ use tui::{ use fuzzy_matcher::skim::SkimMatcherV2 as Matcher; use tui::widgets::Widget; -use std::{cmp::Ordering, time::Instant}; +use std::{ + cmp::{self, Ordering}, + time::Instant, +}; use std::{collections::HashMap, io::Read, path::PathBuf}; use crate::ui::{Prompt, PromptEvent}; @@ -344,11 +347,17 @@ impl Component for FilePicker { #[derive(PartialEq, Eq, Debug)] struct PickerMatch { - index: usize, score: i64, + index: usize, len: usize, } +impl PickerMatch { + fn key(&self) -> impl Ord { + (cmp::Reverse(self.score), self.len, self.index) + } +} + impl PartialOrd for PickerMatch { fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) @@ -357,10 +366,7 @@ impl PartialOrd for PickerMatch { impl Ord for PickerMatch { fn cmp(&self, other: &Self) -> Ordering { - self.score - .cmp(&other.score) - .reverse() - .then_with(|| self.len.cmp(&other.len)) + self.key().cmp(&other.key()) } } @@ -502,6 +508,7 @@ impl Picker { }) }), ); + self.matches.sort_unstable(); } From aecb524e503363c2eed2a5a72d8fd881aae18e4b Mon Sep 17 00:00:00 2001 From: Jonas Everaert <62475953+Jomy10@users.noreply.github.com> Date: Sat, 17 Dec 2022 20:34:00 +0100 Subject: [PATCH 175/352] Crystal language support (#4993) --- book/src/generated/lang-support.md | 1 + languages.toml | 12 +++++ runtime/queries/crystal/highlights.scm | 66 ++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 runtime/queries/crystal/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 1400fa875795..73e0bfcd5f6a 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -16,6 +16,7 @@ | common-lisp | ✓ | | | `cl-lsp` | | cpon | ✓ | | ✓ | | | cpp | ✓ | ✓ | ✓ | `clangd` | +| crystal | ✓ | | | | | css | ✓ | | | `vscode-css-language-server` | | cue | ✓ | | | `cuelsp` | | d | ✓ | ✓ | ✓ | `serve-d` | diff --git a/languages.toml b/languages.toml index d03726e72a91..42495e5c08da 100644 --- a/languages.toml +++ b/languages.toml @@ -223,6 +223,18 @@ args = { console = "internalConsole", attachCommands = [ "platform select remote name = "cpp" source = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev = "d5e90fba898f320db48d81ddedd78d52c67c1fed" } +[[language]] +name = "crystal" +scope = "source.cr" +file-types = ["cr"] +roots = ["shard.yml", "shard.lock"] +comment-token = "#" +indent = { tab-width = 2, unit = " " } + +[[grammar]] +name = "crystal" +source = { git = "https://github.com/will/tree-sitter-crystal", rev = "15597b307b18028b04d288561f9c29794621562b" } + [[language]] name = "c-sharp" scope = "source.csharp" diff --git a/runtime/queries/crystal/highlights.scm b/runtime/queries/crystal/highlights.scm new file mode 100644 index 000000000000..33a53e7f94cb --- /dev/null +++ b/runtime/queries/crystal/highlights.scm @@ -0,0 +1,66 @@ +[ + "class" + "struct" + "module" + + "def" + "alias" + "do" + "end" + + "require" + "include" + "extend" +] @keyword + +[ + "[" "]" + "(" ")" + "{" "}" +] @punctuation.bracket + +(operator) @operator + +(comment) @comment + +; literals + +(nil) @constant.builtin +(bool) @constant.builtin.boolean + +(integer) @constant.numeric.integer +(float) @constant.numeric.float + +[ + (string) + (char) + (commandLiteral) +] @string + +(symbol) @string.special.symbol + +(regex) @string.special.regex + +; variables + +(local_variable) @variable + +[ + (instance_variable) + (class_variable) +] @variable.other.member + +(constant) @constant + +; type defintitions + +(type_identifier) @constructor + +; method definition/call +(identifier) @function.method + +; types +(generic_type) @type +(union_type) @type +(type_identifier) @type + From 042d03269ecbe68e0461548bcf6918324c967bbb Mon Sep 17 00:00:00 2001 From: g-s-k Date: Sat, 17 Dec 2022 20:44:08 +0100 Subject: [PATCH 176/352] Add support for MATLAB/Octave files (#5192) --- book/src/generated/lang-support.md | 1 + languages.toml | 13 ++++ runtime/queries/matlab/highlights.scm | 97 +++++++++++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 runtime/queries/matlab/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 73e0bfcd5f6a..1a3aed79b914 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -78,6 +78,7 @@ | make | ✓ | | | | | markdown | ✓ | | | `marksman` | | markdown.inline | ✓ | | | | +| matlab | ✓ | | | | | mermaid | ✓ | | | | | meson | ✓ | | ✓ | | | mint | | | | `mint` | diff --git a/languages.toml b/languages.toml index 42495e5c08da..8972a6e94389 100644 --- a/languages.toml +++ b/languages.toml @@ -2068,3 +2068,16 @@ indent = { tab-width = 4, unit = " " } [[grammar]] name = "mermaid" source = { git = "https://github.com/monaqa/tree-sitter-mermaid", rev = "d787c66276e7e95899230539f556e8b83ee16f6d" } + +[[language]] +name = "matlab" +scope = "source.m" +file-types = ["m"] +comment-token = "%" +shebangs = ["octave-cli", "matlab"] +roots = [] +indent = { tab-width = 2, unit = " " } + +[[grammar]] +name = "matlab" +source = { git = "https://github.com/mstanciu552/tree-sitter-matlab", rev = "2d5d3d5193718a86477d4335aba5b34e79147326" } diff --git a/runtime/queries/matlab/highlights.scm b/runtime/queries/matlab/highlights.scm new file mode 100644 index 000000000000..c0e23e917541 --- /dev/null +++ b/runtime/queries/matlab/highlights.scm @@ -0,0 +1,97 @@ + ; highlights.scm + +function_keyword: (function_keyword) @keyword.function + +(function_definition +function_name: (identifier) @function +(end) @function) + +(parameter_list (identifier) @variable.parameter) + +[ + "if" + "elseif" + "else" + "switch" + "case" + "otherwise" +] @keyword.control.conditional + +(if_statement (end) @keyword.control.conditional) +(switch_statement (end) @keyword.control.conditional) + +["for" "while"] @keyword.control.repeat +(for_statement (end) @keyword.control.repeat) +(while_statement (end) @keyword.control.repeat) + +["try" "catch"] @keyword.control.exception +(try_statement (end) @keyword.control.exception) + +(function_definition end: (end) @keyword) + +["return" "break" "continue"] @keyword.return + +( +(identifier) @constant.builtin +(#any-of? @constant.builtin "true" "false") +) + +( + (identifier) @constant.builtin + (#eq? @constant.builtin "end") +) + +;; Punctuations + +[";" ","] @punctuation.special +(argument_list "," @punctuation.delimiter) +(vector_definition ["," ";"] @punctuation.delimiter) +(cell_definition ["," ";"] @punctuation.delimiter) +":" @punctuation.delimiter +(parameter_list "," @punctuation.delimiter) +(return_value "," @punctuation.delimiter) + +; ;; Brackets + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +;; Operators +"=" @operator +(operation [ ">" + "<" + "==" + "<=" + ">=" + "=<" + "=>" + "~=" + "*" + ".*" + "/" + "\\" + "./" + "^" + ".^" + "+"] @operator) + +;; boolean operator +[ + "&&" + "||" +] @operator + +;; Number +(number) @constant.numeric + +;; String +(string) @string + +;; Comment +(comment) @comment From 24cd7f6adf7a46b8386583b17f01839eb592a2eb Mon Sep 17 00:00:00 2001 From: Jonathan LEI Date: Sat, 10 Dec 2022 09:56:12 +0000 Subject: [PATCH 177/352] Make prompt suggestions greyed out --- book/src/themes.md | 1 + helix-term/src/ui/prompt.rs | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/book/src/themes.md b/book/src/themes.md index 322caea54b48..0f94828ebb9d 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -268,6 +268,7 @@ These scopes are used for theming the editor interface. | `ui.help` | Description box for commands | | `ui.text` | Command prompts, popup text, etc. | | `ui.text.focus` | | +| `ui.text.inactive` | Same as `ui.text` but when the text is inactive (e.g. suggestions) | | `ui.text.info` | The key: command text in `ui.popup.info` boxes | | `ui.virtual.ruler` | Ruler columns (see the [`editor.rulers` config][editor-section]) | | `ui.virtual.whitespace` | Visible whitespace characters | diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index b19b9a9fce90..5fb6745a90e5 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -352,6 +352,7 @@ impl Prompt { let prompt_color = theme.get("ui.text"); let completion_color = theme.get("ui.menu"); let selected_color = theme.get("ui.menu.selected"); + let suggestion_color = theme.get("ui.text.inactive"); // completion let max_len = self @@ -450,21 +451,29 @@ impl Prompt { // render buffer text surface.set_string(area.x, area.y + line, &self.prompt, prompt_color); - let input: Cow = if self.line.is_empty() { + let (input, is_suggestion): (Cow, bool) = if self.line.is_empty() { // latest value in the register list - self.history_register + match self + .history_register .and_then(|reg| cx.editor.registers.last(reg)) .map(|entry| entry.into()) - .unwrap_or_else(|| Cow::from("")) + { + Some(value) => (value, true), + None => (Cow::from(""), false), + } } else { - self.line.as_str().into() + (self.line.as_str().into(), false) }; surface.set_string( area.x + self.prompt.len() as u16, area.y + line, &input, - prompt_color, + if is_suggestion { + suggestion_color + } else { + prompt_color + }, ); } } From ba3c24aa0268735ac57321442d458ab6a1ac662c Mon Sep 17 00:00:00 2001 From: Jonathan LEI Date: Sat, 10 Dec 2022 09:56:37 +0000 Subject: [PATCH 178/352] Set ui.text.inactive for official themes --- base16_theme.toml | 1 + theme.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/base16_theme.toml b/base16_theme.toml index 63fc2f790e72..268a38df61bd 100644 --- a/base16_theme.toml +++ b/base16_theme.toml @@ -7,6 +7,7 @@ "ui.linenr.selected" = { fg = "white", bg = "black", modifiers = ["bold"] } "ui.selection" = { fg = "black", bg = "blue" } "ui.selection.primary" = { fg = "white", bg = "blue" } +"ui.text.inactive" = { fg = "gray" } "comment" = { fg = "gray" } "ui.statusline" = { fg = "black", bg = "white" } "ui.statusline.inactive" = { fg = "gray", bg = "white" } diff --git a/theme.toml b/theme.toml index 054093195a87..c7b5dc84e7e0 100644 --- a/theme.toml +++ b/theme.toml @@ -54,6 +54,7 @@ label = "honey" "ui.text" = { fg = "lavender" } "ui.text.focus" = { fg = "white" } +"ui.text.inactive" = "sirocco" "ui.virtual" = { fg = "comet" } "ui.virtual.indent-guide" = { fg = "comet" } From 99b346a9238b9e7c5b9b93abdf787213c4d67f92 Mon Sep 17 00:00:00 2001 From: Lukas Werling Date: Mon, 19 Dec 2022 18:00:47 +0100 Subject: [PATCH 179/352] tutor: Fix typos in 8.2 (#5213) --- runtime/tutor | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/tutor b/runtime/tutor index 418c4195487e..885ea0bffcc9 100644 --- a/runtime/tutor +++ b/runtime/tutor @@ -848,13 +848,13 @@ lines. 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. - 4. Exit insert and Type Q again to stop recording. + 4. Exit insert and type Q again to stop recording. 5. Move to the line below and put your cursor on '>' again. 6. Type q to repeat the macro. - --> ... sentence doesn't have it's first and last ... . - --> ... sentence doesn't have it's first and last ... . - This sentence doesn't have it's first and last word. + --> ... sentence doesn't have its first and last ... . + --> ... sentence doesn't have its first and last ... . + This sentence doesn't have its first and last word. ================================================================= = CHAPTER 8 RECAP = From 45c58961424cca35bcab692b49949d45d917ef7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:16:26 -0600 Subject: [PATCH 180/352] build(deps): bump anyhow from 1.0.66 to 1.0.68 (#5222) Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.66 to 1.0.68. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.66...1.0.68) --- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ae0a71f8c1b..52ed478fb6d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,9 +51,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.66" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" +checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" [[package]] name = "arc-swap" From bcb78c9382af059ccd89dd3c53a1846f2fff1d6c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:21:30 -0600 Subject: [PATCH 181/352] build(deps): bump toml from 0.5.9 to 0.5.10 (#5224) Bumps [toml](https://github.com/toml-rs/toml) from 0.5.9 to 0.5.10. - [Release notes](https://github.com/toml-rs/toml/releases) - [Commits](https://github.com/toml-rs/toml/commits/toml-v0.5.10) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52ed478fb6d7..3f4b081cba36 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2142,9 +2142,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" dependencies = [ "serde", ] From 453c7b46993c7ecf2eb8c0549b93085907c6d6c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:21:51 -0600 Subject: [PATCH 182/352] build(deps): bump thiserror from 1.0.37 to 1.0.38 (#5223) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.37 to 1.0.38. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.37...1.0.38) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] 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 3f4b081cba36..7e98a0f75e21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2018,18 +2018,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", From 38fd20c858d166ce9e5b421722b18dc9f7d8810f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:22:27 -0600 Subject: [PATCH 183/352] build(deps): bump indoc from 1.0.7 to 1.0.8 (#5226) Bumps [indoc](https://github.com/dtolnay/indoc) from 1.0.7 to 1.0.8. - [Release notes](https://github.com/dtolnay/indoc/releases) - [Commits](https://github.com/dtolnay/indoc/compare/1.0.7...1.0.8) --- updated-dependencies: - dependency-name: indoc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- helix-term/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7e98a0f75e21..1b4572bba57c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1386,9 +1386,9 @@ dependencies = [ [[package]] name = "indoc" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adab1eaa3408fb7f0c777a73e7465fd5656136fc93b670eb6df3c88c2c1344e3" +checksum = "da2d6f23ffea9d7e76c53eee25dfb67bcd8fde7f1198b0855350698c9f07c780" [[package]] name = "instant" diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index 30bfc7ea38a3..9f2e5188d78a 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -78,5 +78,5 @@ helix-loader = { version = "0.6", path = "../helix-loader" } [dev-dependencies] smallvec = "1.10" -indoc = "1.0.6" +indoc = "1.0.8" tempfile = "3.3.0" From f7a9717088fd00f875f03ff89e7229e64eb7f5fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:24:26 -0600 Subject: [PATCH 184/352] build(deps): bump serde_json from 1.0.89 to 1.0.91 (#5225) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.89 to 1.0.91. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.89...v1.0.91) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1b4572bba57c..e00e1f6381ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1825,9 +1825,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "itoa", "ryu", From 03baec8a2d83de59d7e8ada655022e4f81d1fa68 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Tue, 20 Dec 2022 02:36:56 +0300 Subject: [PATCH 185/352] build(nix): update inputs (#5219) --- flake.lock | 70 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index f097519e34af..4cf1018c4999 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "crane": { "flake": false, "locked": { - "lastModified": 1661875961, - "narHash": "sha256-f1h/2c6Teeu1ofAHWzrS8TwBPcnN+EEu+z1sRVmMQTk=", + "lastModified": 1670900067, + "narHash": "sha256-VXVa+KBfukhmWizaiGiHRVX/fuk66P8dgSFfkVN4/MY=", "owner": "ipetkov", "repo": "crane", - "rev": "d9f394e4e20e97c2a60c3ad82c2b6ef99be19e24", + "rev": "59b31b41a589c0a65e4a1f86b0e5eac68081468b", "type": "github" }, "original": { @@ -45,6 +45,7 @@ "nci", "devshell" ], + "flake-parts": "flake-parts", "flake-utils-pre-commit": [ "nci" ], @@ -57,6 +58,9 @@ "mach-nix": [ "nci" ], + "nix-pypi-fetcher": [ + "nci" + ], "nixpkgs": [ "nci", "nixpkgs" @@ -69,11 +73,11 @@ ] }, "locked": { - "lastModified": 1668851003, - "narHash": "sha256-X7RCQQynbxStZR2m7HW38r/msMQwVl3afD6UXOCtvx4=", + "lastModified": 1671323629, + "narHash": "sha256-9KHTPjIDjfnzZ4NjpE3gGIVHVHopy6weRDYO/7Y3hF8=", "owner": "nix-community", "repo": "dream2nix", - "rev": "c77e8379d8fe01213ba072e40946cbfb7b58e628", + "rev": "2d7d68505c8619410df2c6b6463985f97cbcba6e", "type": "github" }, "original": { @@ -82,6 +86,24 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1668450977, + "narHash": "sha256-cfLhMhnvXn6x1vPm+Jow3RiFAUSCw/l1utktCw5rVA4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "d591857e9d7dd9ddbfba0ea02b43b927c3c0f1fa", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1659877975, @@ -109,11 +131,11 @@ ] }, "locked": { - "lastModified": 1669011203, - "narHash": "sha256-Lymj4HktNEFmVXtwI0Os7srDXHZbZW0Nzw3/+5Hf8ko=", + "lastModified": 1671430291, + "narHash": "sha256-UIc7H8F3N8rK72J/Vj5YJdV72tvDvYjH+UPsOFvlcsE=", "owner": "yusdacra", "repo": "nix-cargo-integration", - "rev": "c5133b91fc1d549087c91228bd213f2518728a4b", + "rev": "b1b0d38b8c3b0d0e6a38638d5bbe10b0bc67522c", "type": "github" }, "original": { @@ -124,11 +146,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1668905981, - "narHash": "sha256-RBQa/+9Uk1eFTqIOXBSBezlEbA3v5OkgP+qptQs1OxY=", + "lastModified": 1671359686, + "narHash": "sha256-3MpC6yZo+Xn9cPordGz2/ii6IJpP2n8LE8e/ebUXLrs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "690ffff026b4e635b46f69002c0f4e81c65dfc2e", + "rev": "04f574a1c0fde90b51bf68198e2297ca4e7cccf4", "type": "github" }, "original": { @@ -138,6 +160,24 @@ "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1665349835, + "narHash": "sha256-UK4urM3iN80UXQ7EaOappDzcisYIuEURFRoGQ/yPkug=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "34c5293a71ffdb2fe054eb5288adc1882c1eb0b1", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "nci": "nci", @@ -153,11 +193,11 @@ ] }, "locked": { - "lastModified": 1668998422, - "narHash": "sha256-G/BklIplCHZEeDIabaaxqgITdIXtMolRGlwxn9jG2/Q=", + "lastModified": 1671416426, + "narHash": "sha256-kpSH1Jrxfk2qd0pRPJn1eQdIOseGv5JuE+YaOrqU9s4=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "68ab029c93f8f8eed4cf3ce9a89a9fd4504b2d6e", + "rev": "fbaaff24f375ac25ec64268b0a0d63f91e474b7d", "type": "github" }, "original": { From a7146f58f00b7d15f584c630ca6e123793a0a051 Mon Sep 17 00:00:00 2001 From: farwyler <1705805+farwyler@users.noreply.github.com> Date: Tue, 20 Dec 2022 00:40:08 +0100 Subject: [PATCH 186/352] Add missing comment injection for nix (#5208) --- runtime/queries/nix/injections.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/queries/nix/injections.scm b/runtime/queries/nix/injections.scm index 82d79cc762c6..a1a0ebb88620 100644 --- a/runtime/queries/nix/injections.scm +++ b/runtime/queries/nix/injections.scm @@ -1,3 +1,6 @@ +((comment) @injection.content + (#set! injection.language "comment")) + ; mark arbitary languages with a comment ((((comment) @injection.language) . (indented_string_expression (string_fragment) @injection.content)) From bdeefbfb23077fcbbfe1e7df6c6ac88516244bbc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 17:49:23 -0600 Subject: [PATCH 187/352] build(deps): bump serde from 1.0.150 to 1.0.151 (#5221) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.150 to 1.0.151. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.150...v1.0.151) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] 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 e00e1f6381ba..a6ca94954c00 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1805,18 +1805,18 @@ checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" [[package]] name = "serde" -version = "1.0.150" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" +checksum = "97fed41fc1a24994d044e6db6935e69511a1153b52c15eb42493b26fa87feba0" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.150" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" +checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8" dependencies = [ "proc-macro2", "quote", From 6ab8591715daf932d0dc45d0d5fb9e5a272f2fe1 Mon Sep 17 00:00:00 2001 From: Chirikumbrah <78883260+Chirikumbrah@users.noreply.github.com> Date: Wed, 21 Dec 2022 02:33:14 +0300 Subject: [PATCH 188/352] Better diagnostics highlighting for Dracula theme. (#5236) --- runtime/themes/dracula.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/themes/dracula.toml b/runtime/themes/dracula.toml index 90bdb446bd0a..0f459311c3ff 100644 --- a/runtime/themes/dracula.toml +++ b/runtime/themes/dracula.toml @@ -55,6 +55,9 @@ "markup.quote" = { fg = "yellow", modifiers = ["italic"] } "markup.raw" = { fg = "foreground" } +"diagnostic".underline = { color = "orange", style = "curl" } +"diagnostic.error".underline = { color = "red", style = "curl" } + [palette] background = "#282a36" background_dark = "#21222c" From d0a5e11c28a3ad2533b79e2922ca06aa7036516c Mon Sep 17 00:00:00 2001 From: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com> Date: Thu, 22 Dec 2022 00:10:12 +0100 Subject: [PATCH 189/352] fix(theme): Replace invalid `cyan` by `blue` in line with original theme (#5250) --- runtime/themes/monokai_pro_spectrum.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/themes/monokai_pro_spectrum.toml b/runtime/themes/monokai_pro_spectrum.toml index 89575e3a1414..f5787ca8c3b1 100644 --- a/runtime/themes/monokai_pro_spectrum.toml +++ b/runtime/themes/monokai_pro_spectrum.toml @@ -53,7 +53,7 @@ "constructor" = "blue" "function" = "green" "function.macro" = { fg = "blue" } -"function.builtin" = { fg = "cyan" } +"function.builtin" = { fg = "blue" } # operator, tags, units, punctuations "operator" = "red" From c4263d6a56c6490b34a43c7d393fce321514b6ef Mon Sep 17 00:00:00 2001 From: Chickenkeeper Date: Wed, 21 Dec 2022 23:10:45 +0000 Subject: [PATCH 190/352] Fix & Tweak Rust's Syntax Highlighting (#5238) --- runtime/queries/rust/highlights.scm | 31 ++++++++--------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm index d3c292708b63..66058034b79d 100644 --- a/runtime/queries/rust/highlights.scm +++ b/runtime/queries/rust/highlights.scm @@ -45,7 +45,8 @@ "'" @label (identifier) @label) (loop_label - (identifier) @type) + "'" @label + (identifier) @label) ; --- ; Punctuation @@ -102,8 +103,6 @@ (closure_parameters (identifier) @variable.parameter) - - ; ------- ; Keywords ; ------- @@ -129,9 +128,7 @@ [ "break" "continue" - "return" - "await" ] @keyword.control.return @@ -154,10 +151,7 @@ "trait" "for" - "unsafe" "default" - "macro_rules!" - "async" ] @keyword @@ -165,13 +159,13 @@ "struct" "enum" "union" - "type" ] @keyword.storage.type "let" @keyword.storage - "fn" @keyword.function +"unsafe" @keyword.special +"macro_rules!" @function.macro (mutable_specifier) @keyword.storage.modifier.mut @@ -202,11 +196,11 @@ (call_expression function: [ - ((identifier) @type.variant - (#match? @type.variant "^[A-Z]")) + ((identifier) @type.enum.variant + (#match? @type.enum.variant "^[A-Z]")) (scoped_identifier - name: ((identifier) @type.variant - (#match? @type.variant "^[A-Z]"))) + name: ((identifier) @type.enum.variant + (#match? @type.enum.variant "^[A-Z]"))) ]) ; --- @@ -237,8 +231,6 @@ ((identifier) @type (#match? @type "^[A-Z]")) - - (attribute (identifier) @_macro arguments: (token_tree (identifier) @constant.numeric.integer) @@ -246,7 +238,6 @@ ) @special - ; ------- ; Functions ; ------- @@ -303,8 +294,6 @@ (metavariable) @variable.parameter (fragment_specifier) @type - - ; ------- ; Operators ; ------- @@ -350,8 +339,6 @@ "'" ] @operator - - ; ------- ; Paths ; ------- @@ -382,8 +369,6 @@ (scoped_type_identifier path: (identifier) @namespace) - - ; ------- ; Remaining Identifiers ; ------- From 7905086b55eac2a817c16fe3a9ab987e718324c8 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 22 Dec 2022 19:21:02 -0600 Subject: [PATCH 191/352] Fix HTML injection within markdown (#5265) HTML nodes should be combined injections in the markdown block grammar. When nodes are together the highlighting works properly but when there is markdown content between HTML nodes like in a `
` tag, the highlighting of the closing tag breaks since tree-sitter-html looks for opening and closing tags. --- runtime/queries/markdown/injections.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/queries/markdown/injections.scm b/runtime/queries/markdown/injections.scm index e184db157aa6..e88393512f59 100644 --- a/runtime/queries/markdown/injections.scm +++ b/runtime/queries/markdown/injections.scm @@ -5,7 +5,10 @@ (language) @injection.language) (code_fence_content) @injection.content (#set! injection.include-unnamed-children)) -((html_block) @injection.content (#set! injection.language "html") (#set! injection.include-unnamed-children)) +((html_block) @injection.content + (#set! injection.language "html") + (#set! injection.include-unnamed-children) + (#set! injection.combined)) ((pipe_table_cell) @injection.content (#set! injection.language "markdown.inline") (#set! injection.include-unnamed-children)) From 7a1fa0c74fb2c3b7b1c9aea9aa77c5c612e0bd12 Mon Sep 17 00:00:00 2001 From: Gioele De Vitti Date: Fri, 23 Dec 2022 02:12:49 +0000 Subject: [PATCH 192/352] tutor: Add a content cycling section (#5161) --- runtime/tutor | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/runtime/tutor b/runtime/tutor index 885ea0bffcc9..1fc5605eab02 100644 --- a/runtime/tutor +++ b/runtime/tutor @@ -985,11 +985,33 @@ lines. --> How much would would a wouldchuck chuck --> if a wouldchuck could chuck would? - Note: Additionally, Alt-( and Alt-) cycle the *contents* of the - selections as well. + + + +================================================================= += 10.2 CYCLING THE CONTENT OF SELECTIONS = +================================================================= + + Type Alt-) and Alt-( to cycle the content of the selections + forward and backward respectively. + + 1. Move the cursor to the line marked '-->' below. + 2. Select both lines with xx or 2x. + 3. Type s to select, type "through|water|know" and enter. + 4. Use Alt-( and Alt-) to cycle the content of the selections. + + --> Jumping through the water, + --> daring to know. + + + + + + + ================================================================= -= 10.2 CHANGING CASE = += 10.3 CHANGING CASE = ================================================================= Type ~ to switch the case of all selected letters. @@ -1011,7 +1033,7 @@ lines. --> THIS sentence should ALL BE IN uppercase! ================================================================= -= 10.3 SPLITTING SELECTIONS = += 10.4 SPLITTING SELECTIONS = ================================================================= Type S to split each selection on a regex pattern. @@ -1039,6 +1061,7 @@ letters! that is not good grammar. you can fix this. * Use ) and ( to cycle the primary selection back and forward through selections respectively. * Type Alt-, to remove the primary selection. + * Type Alt-) and Alt-( to cycle the content of the selections. * Type ~ to alternate case of selected letters. * Use ` and Alt-` to set the case of selected letters to @@ -1053,7 +1076,6 @@ letters! that is not good grammar. you can fix this. - ================================================================= = = ================================================================= From 1b89d3e5350f83b2ffb86a86326bd2714308ee53 Mon Sep 17 00:00:00 2001 From: Jack Allison Date: Thu, 22 Dec 2022 21:23:34 -0500 Subject: [PATCH 193/352] Add file picker dialogue when opening a directory with :o (#2707) --- helix-term/src/commands/typed.rs | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index cb387fcb5b64..c3a7c9faabd9 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -65,12 +65,28 @@ fn open(cx: &mut compositor::Context, args: &[Cow], event: PromptEvent) -> ensure!(!args.is_empty(), "wrong argument count"); for arg in args { let (path, pos) = args::parse_file(arg); - let _ = cx.editor.open(&path, Action::Replace)?; - let (view, doc) = current!(cx.editor); - let pos = Selection::point(pos_at_coords(doc.text().slice(..), pos, true)); - doc.set_selection(view.id, pos); - // does not affect opening a buffer without pos - align_view(doc, view, Align::Center); + // If the path is a directory, open a file picker on that directory and update the status + // message + if std::fs::canonicalize(&path)?.is_dir() { + let callback = async move { + let call: job::Callback = job::Callback::EditorCompositor(Box::new( + move |editor: &mut Editor, compositor: &mut Compositor| { + let picker = ui::file_picker(path, &editor.config()); + compositor.push(Box::new(overlayed(picker))); + }, + )); + Ok(call) + }; + cx.jobs.callback(callback); + } else { + // Otherwise, just open the file + let _ = cx.editor.open(&path, Action::Replace)?; + let (view, doc) = current!(cx.editor); + let pos = Selection::point(pos_at_coords(doc.text().slice(..), pos, true)); + doc.set_selection(view.id, pos); + // does not affect opening a buffer without pos + align_view(doc, view, Align::Center); + } } Ok(()) } From 1107296ca9bfd728258a4571be35eb7c811ff3b3 Mon Sep 17 00:00:00 2001 From: DylanBulfin <31492860+DylanBulfin@users.noreply.github.com> Date: Thu, 22 Dec 2022 21:27:20 -0500 Subject: [PATCH 194/352] Add command to merge consecutive ranges in selection (#5047) --- book/src/keymap.md | 1 + helix-core/src/selection.rs | 95 ++++++++++++++++++++++++++++---- helix-term/src/commands.rs | 7 +++ helix-term/src/keymap/default.rs | 1 + 4 files changed, 92 insertions(+), 12 deletions(-) diff --git a/book/src/keymap.md b/book/src/keymap.md index 153294007ee6..272c758b6317 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -111,6 +111,7 @@ | `s` | Select all regex matches inside selections | `select_regex` | | `S` | Split selection into subselections on regex matches | `split_selection` | | `Alt-s` | Split selection on newlines | `split_selection_on_newline` | +| `Alt-_ ` | Merge consecutive selections | `merge_consecutive_selections` | | `&` | Align selection in columns | `align_selections` | | `_` | Trim whitespace from the selection | `trim_selections` | | `;` | Collapse selection onto a single cursor | `collapse_selection` | diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs index 1f28ecefb750..ffba46ab70ef 100644 --- a/helix-core/src/selection.rs +++ b/helix-core/src/selection.rs @@ -495,28 +495,53 @@ impl Selection { /// Normalizes a `Selection`. fn normalize(mut self) -> Self { - let primary = self.ranges[self.primary_index]; + let mut primary = self.ranges[self.primary_index]; self.ranges.sort_unstable_by_key(Range::from); + + self.ranges.dedup_by(|curr_range, prev_range| { + if prev_range.overlaps(curr_range) { + let new_range = curr_range.merge(*prev_range); + if prev_range == &primary || curr_range == &primary { + primary = new_range; + } + *prev_range = new_range; + true + } else { + false + } + }); + self.primary_index = self .ranges .iter() .position(|&range| range == primary) .unwrap(); - let mut prev_i = 0; - for i in 1..self.ranges.len() { - if self.ranges[prev_i].overlaps(&self.ranges[i]) { - self.ranges[prev_i] = self.ranges[prev_i].merge(self.ranges[i]); + self + } + + // Merges all ranges that are consecutive + pub fn merge_consecutive_ranges(mut self) -> Self { + let mut primary = self.ranges[self.primary_index]; + + self.ranges.dedup_by(|curr_range, prev_range| { + if prev_range.to() == curr_range.from() { + let new_range = curr_range.merge(*prev_range); + if prev_range == &primary || curr_range == &primary { + primary = new_range; + } + *prev_range = new_range; + true } else { - prev_i += 1; - self.ranges[prev_i] = self.ranges[i]; + false } - if i == self.primary_index { - self.primary_index = prev_i; - } - } + }); - self.ranges.truncate(prev_i + 1); + self.primary_index = self + .ranges + .iter() + .position(|&range| range == primary) + .unwrap(); self } @@ -1132,6 +1157,52 @@ mod test { &["", "abcd", "efg", "rs", "xyz"] ); } + + #[test] + fn test_merge_consecutive_ranges() { + let selection = Selection::new( + smallvec![ + Range::new(0, 1), + Range::new(1, 10), + Range::new(15, 20), + Range::new(25, 26), + Range::new(26, 30) + ], + 4, + ); + + let result = selection.merge_consecutive_ranges(); + + assert_eq!( + result.ranges(), + &[Range::new(0, 10), Range::new(15, 20), Range::new(25, 30)] + ); + assert_eq!(result.primary_index, 2); + + let selection = Selection::new(smallvec![Range::new(0, 1)], 0); + let result = selection.merge_consecutive_ranges(); + + assert_eq!(result.ranges(), &[Range::new(0, 1)]); + assert_eq!(result.primary_index, 0); + + let selection = Selection::new( + smallvec![ + Range::new(0, 1), + Range::new(1, 5), + Range::new(5, 8), + Range::new(8, 10), + Range::new(10, 15), + Range::new(18, 25) + ], + 3, + ); + + let result = selection.merge_consecutive_ranges(); + + assert_eq!(result.ranges(), &[Range::new(0, 15), Range::new(18, 25)]); + assert_eq!(result.primary_index, 0); + } + #[test] fn test_selection_contains() { fn contains(a: Vec<(usize, usize)>, b: Vec<(usize, usize)>) -> bool { diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 6cf494646d85..437e11b5c238 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -244,6 +244,7 @@ impl MappableCommand { select_regex, "Select all regex matches inside selections", split_selection, "Split selections on regex matches", split_selection_on_newline, "Split selection on newlines", + merge_consecutive_selections, "Merge consecutive selections", search, "Search for regex pattern", rsearch, "Reverse search for regex pattern", search_next, "Select next search match", @@ -1589,6 +1590,12 @@ fn split_selection_on_newline(cx: &mut Context) { doc.set_selection(view.id, selection); } +fn merge_consecutive_selections(cx: &mut Context) { + let (view, doc) = current!(cx.editor); + let selection = doc.selection(view.id).clone().merge_consecutive_ranges(); + doc.set_selection(view.id, selection); +} + #[allow(clippy::too_many_arguments)] fn search_impl( editor: &mut Editor, diff --git a/helix-term/src/keymap/default.rs b/helix-term/src/keymap/default.rs index ebcd125aa129..ef93dee08a77 100644 --- a/helix-term/src/keymap/default.rs +++ b/helix-term/src/keymap/default.rs @@ -76,6 +76,7 @@ pub fn default() -> HashMap { "s" => select_regex, "A-s" => split_selection_on_newline, + "A-_" => merge_consecutive_selections, "S" => split_selection, ";" => collapse_selection, "A-;" => flip_selections, From df1830ef28a7cb49abe31a18e4bd1bcfc7eb802a Mon Sep 17 00:00:00 2001 From: jliaoh <48660001+hunterliao29@users.noreply.github.com> Date: Thu, 22 Dec 2022 21:30:33 -0500 Subject: [PATCH 195/352] mouse operations respect scrolloff (#5255) --- helix-term/src/ui/editor.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index fc201853f7dc..35cf77abc9bf 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -1155,6 +1155,7 @@ impl EditorView { } editor.focus(view_id); + editor.ensure_cursor_in_view(view_id); return EventResult::Consumed(None); } @@ -1191,7 +1192,8 @@ impl EditorView { let primary = selection.primary_mut(); *primary = primary.put_cursor(doc.text().slice(..), pos, true); doc.set_selection(view.id, selection); - + let view_id = view.id; + cxt.editor.ensure_cursor_in_view(view_id); EventResult::Consumed(None) } @@ -1213,6 +1215,7 @@ impl EditorView { commands::scroll(cxt, offset, direction); cxt.editor.tree.focus = current_view; + cxt.editor.ensure_cursor_in_view(current_view); EventResult::Consumed(None) } From b1ca7ddf89c048a8da0d6cfe507ac3344e6f625f Mon Sep 17 00:00:00 2001 From: cor Date: Fri, 23 Dec 2022 15:03:54 +0100 Subject: [PATCH 196/352] Use curl underlines in the rose_pine theme (#5267) Also fixes the color "gold" being used for too many kinds of diagnostics, now there's a more conventional choice of diagnostics colors (redish = error, yellowish = warning, blueish = hint). --- runtime/themes/rose_pine.toml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/runtime/themes/rose_pine.toml b/runtime/themes/rose_pine.toml index 14e240dd505e..8558db3ab444 100644 --- a/runtime/themes/rose_pine.toml +++ b/runtime/themes/rose_pine.toml @@ -1,5 +1,6 @@ # Author: RayGervais # Author: ChrisHa +# Diagnostics patch author: cor "ui.background" = { bg = "base" } "ui.menu" = { fg = "text", bg = "overlay" } @@ -45,12 +46,18 @@ "diff.delta" = "rose" "diff.minus" = "love" -"info" = "gold" -"hint" = "gold" +"info" = "foam" +"hint" = "iris" "debug" = "rose" -"diagnostic" = "rose" +"warning" = "gold" "error" = "love" +"diagnostic" = { modifiers = ["underlined"] } +"diagnostic.error" = { underline = { style = "curl", color = "love" } } +"diagnostic.warning" = { underline = { style = "curl", color = "gold" } } +"diagnostic.info" = { underline = { style = "curl", color = "foam" } } +"diagnostic.hint" = { underline = { style = "curl", color = "iris" } } + "markup.heading.marker" = "subtle" "markup.heading.1" = { fg = "love", modifiers = ["bold"] } "markup.heading.2" = { fg = "gold", modifiers = ["bold"] } From 24c3b00d10858a02c6c1c351a7509e204c2bc647 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 23 Dec 2022 19:43:05 +0530 Subject: [PATCH 197/352] Avoid trailing `s` in message when only 1 file is opened (#5189) --- helix-term/src/application.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 7a50e007b9b9..5f013b9af0a6 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -227,7 +227,11 @@ impl Application { doc.set_selection(view_id, pos); } } - editor.set_status(format!("Loaded {} files.", nr_of_files)); + editor.set_status(format!( + "Loaded {} file{}.", + nr_of_files, + if nr_of_files == 1 { "" } else { "s" } // avoid "Loaded 1 files." grammo + )); // align the view to center after all files are loaded, // does not affect views without pos since it is at the top let (view, doc) = current!(editor); From f0c6e6c9eeb1f2772571bcefe02bd344fa70d62f Mon Sep 17 00:00:00 2001 From: Erasin Date: Sat, 24 Dec 2022 19:30:44 +0800 Subject: [PATCH 198/352] fix comment token of godot resource file (#5276) --- languages.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 8972a6e94389..53f65be7cf05 100644 --- a/languages.toml +++ b/languages.toml @@ -1460,7 +1460,7 @@ file-types = ["tscn","tres"] shebangs = [] roots = ["project.godot"] auto-format = false -comment-token = "#" +comment-token = ";" indent = { tab-width = 4, unit = "\t" } [[grammar]] From eb4ec3271005e9de7960a4dd08a9efbb648cb89f Mon Sep 17 00:00:00 2001 From: alois31 <36605164+alois31@users.noreply.github.com> Date: Sat, 24 Dec 2022 14:50:39 +0100 Subject: [PATCH 199/352] Fix opening new files (#5278) Commit 1b89d3e5350f83b2ffb86a86326bd2714308ee53 introduced a regression where opening a new file would no longer work, because attempting to canonicalize its path would lead to a "No such file or directory" error. Fall back to opening a new file when encountering an error to fix this case. --- helix-term/src/commands/typed.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index c3a7c9faabd9..c2ca1a47811b 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -67,7 +67,7 @@ fn open(cx: &mut compositor::Context, args: &[Cow], event: PromptEvent) -> let (path, pos) = args::parse_file(arg); // If the path is a directory, open a file picker on that directory and update the status // message - if std::fs::canonicalize(&path)?.is_dir() { + if let Ok(true) = std::fs::canonicalize(&path).map(|p| p.is_dir()) { let callback = async move { let call: job::Callback = job::Callback::EditorCompositor(Box::new( move |editor: &mut Editor, compositor: &mut Compositor| { From 1af76b738dd5bdae14b025d07d3001c4ad23e071 Mon Sep 17 00:00:00 2001 From: Alex Kladov Date: Sat, 24 Dec 2022 21:55:16 +0000 Subject: [PATCH 200/352] Add eb word selection trick to the tutor (#5247) --- runtime/tutor | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/runtime/tutor b/runtime/tutor index 1fc5605eab02..baf32c274e01 100644 --- a/runtime/tutor +++ b/runtime/tutor @@ -241,7 +241,7 @@ _________________________________________________________________ ================================================================= -= 3.2 MORE ON MOTIONS = += 3.2 MORE MOTIONS = ================================================================= As you saw, typing w moves the cursor forward until the start @@ -253,6 +253,19 @@ _________________________________________________________________ e - Move forward to the end of the current word. b - Move backward to the beginning of the current word. + To select the word under cursor, combine e and b. + + 1. Move the cursor to the line marked '-->' below. + 2. Move to a 'd' letter. + 3. Type e to select a half of the word. + 4. Type b to select the rest. + +--> The Middle Kingdom. + +================================================================= += 3.3 WORDS AND words = +================================================================= + The w,e,b motions also have counterparts - W,E,B - which traverse WORDS instead of words. WORDS are only separated by whitespace, whereas words can be separated by other characters @@ -262,8 +275,17 @@ _________________________________________________________________ + + + + + + + + + ================================================================= -= 3.3 THE CHANGE COMMAND = += 3.4 THE CHANGE COMMAND = ================================================================= Type c to change the current selection. @@ -285,7 +307,7 @@ _________________________________________________________________ ================================================================= -= 3.4 COUNTS WITH MOTIONS = += 3.5 COUNTS WITH MOTIONS = ================================================================= Type a number before a motion to repeat it that many times. @@ -307,7 +329,7 @@ _________________________________________________________________ ================================================================= -= 3.5 SELECT / EXTEND MODE = += 3.6 SELECT / EXTEND MODE = ================================================================= Type v to enter Select mode. @@ -329,7 +351,7 @@ _________________________________________________________________ ================================================================= -= 3.6 SELECTING LINES = += 3.7 SELECTING LINES = ================================================================= Type x to select a whole line. Type x again to select the next. @@ -351,7 +373,7 @@ _________________________________________________________________ subsequent lines. X on an empty line does nothing. ================================================================= -= 3.7 COLLAPSING SELECTIONS = += 3.8 COLLAPSING SELECTIONS = ================================================================= Type ; to collapse selections to single cursors. From a637461677bed1468af5a5d86c57113de3345247 Mon Sep 17 00:00:00 2001 From: "Soc Virnyl S. Estela" Date: Tue, 27 Dec 2022 03:11:42 +0800 Subject: [PATCH 201/352] tutor: add chapter for commenting lines (#5211) --- runtime/tutor | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/runtime/tutor b/runtime/tutor index baf32c274e01..408f74514cd0 100644 --- a/runtime/tutor +++ b/runtime/tutor @@ -1099,10 +1099,58 @@ letters! that is not good grammar. you can fix this. ================================================================= -= = += 11.1 COMMENTING A LINE = ================================================================= +Type Ctrl-c to comment the line under your cursor. +To uncomment the line, press Ctrl-c again. +1. Move your cursor to the line marked '-->' below. +2. Now comment the line marked with '-->'. +3. Now try uncommenting the line. + +--> Comment me please + + + + + + + + + + +================================================================= += 11.2 COMMENTING MULTIPLE LINES = +================================================================= + +Using the selections and multi-cursor functionality, you can +comment multiple lines as long as it is under the selection or +cursors. + +1. Move your cursor to the line marked with '-->' below. +2. Now try to select or add more cursors the other lines marked + with '-->'. +3. Comment those lines. + +--> How many are you going to comment? +--> Is this enough for a comment? +--> What are you doing?! +--> Stop commenting me! +--> AAAAaargh!!! + +Note: If there are already commented lines under selections or +multiple cursors, they won't be uncommented but commented again. + +================================================================= += CHAPTER 11 RECAP = +================================================================= + + * Use Ctrl-c to comment a line under your cursor. Type Ctrl-c + again to uncomment. + * To comment multiple lines, use the selections + and multi-cursors before typing Ctrl-c. + * Commented lines cannot be uncommented but commented again. From 792c2e3dbf1ae355f5cba829dff25d17d8b8c7d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Dec 2022 17:15:00 -0600 Subject: [PATCH 202/352] build(deps): bump git-repository from 0.29.0 to 0.30.2 (#5306) Bumps [git-repository](https://github.com/Byron/gitoxide) from 0.29.0 to 0.30.2. - [Release notes](https://github.com/Byron/gitoxide/releases) - [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md) - [Commits](https://github.com/Byron/gitoxide/compare/git-repository-v0.29.0...git-repository-v0.30.2) --- updated-dependencies: - dependency-name: git-repository dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 207 +++++++++++++++++++++++-------------------- helix-vcs/Cargo.toml | 2 +- 2 files changed, 112 insertions(+), 97 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a6ca94954c00..1243bc51d1d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,9 +63,9 @@ checksum = "983cd8b9d4b02a6dc6ffa557262eb5858a27a0038ffffe21a0f133eaa819a164" [[package]] name = "atoi" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" dependencies = [ "num-traits", ] @@ -120,16 +120,6 @@ version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" -[[package]] -name = "byte-unit" -version = "4.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581ad4b3d627b0c09a0ccb2912148f839acaca0b93cf54cbe42b6c674e86079c" -dependencies = [ - "serde", - "utf8-width", -] - [[package]] name = "bytecount" version = "0.6.3" @@ -211,9 +201,9 @@ dependencies = [ [[package]] name = "clru" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "218d6bd3dde8e442a975fa1cd233c0e5fded7596bccfe39f58eca98d22421e0a" +checksum = "b8191fa7302e03607ff0e237d4246cc043ff5b3cb9409d995172ba3bea16b807" [[package]] name = "codespan-reporting" @@ -280,7 +270,7 @@ dependencies = [ "futures-core", "libc", "mio", - "parking_lot", + "parking_lot 0.12.1", "signal-hook", "signal-hook-mio", "winapi", @@ -349,7 +339,7 @@ dependencies = [ "hashbrown 0.12.3", "lock_api", "once_cell", - "parking_lot_core", + "parking_lot_core 0.9.4", ] [[package]] @@ -551,9 +541,9 @@ dependencies = [ [[package]] name = "git-actor" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac9fb99c934ed45a62d9ae1e7b21949f2d869d1b82a07dcbf16ed61daa665870" +checksum = "7def29b46f25f95a2e196323cfb336eae9965e0a3c7c35ad9506f295c3a8e234" dependencies = [ "bstr 1.0.1", "btoi", @@ -565,9 +555,9 @@ dependencies = [ [[package]] name = "git-attributes" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e98446a2bf0eb5c8f29fa828d6529510a6fadeb59ce14ca98e58fa7e1e0199" +checksum = "f0affaed361598fdd06b2a184a566c823d0b5817b09f576018248fb267193a96" dependencies = [ "bstr 1.0.1", "compact_str", @@ -608,9 +598,9 @@ dependencies = [ [[package]] name = "git-config" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd1d13179bcf3dd68e83404f91a8d01c618f54eb97ef36c68ee5e6f30183a681" +checksum = "5ff189268cfb19d5151529ac30b6b708072ebfa1075643d785232675456ec320" dependencies = [ "bstr 1.0.1", "git-config-value", @@ -629,9 +619,9 @@ dependencies = [ [[package]] name = "git-config-value" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64561e9700f1fc737fa3c1c4ea55293be70dba98e45c54cf3715cb180f37a566" +checksum = "989a90c1c630513a153c685b4249b96fdf938afc75bf7ef2ae1ccbd3d799f5db" dependencies = [ "bitflags", "bstr 1.0.1", @@ -642,9 +632,9 @@ dependencies = [ [[package]] name = "git-credentials" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "621dd60288ae7b8f80bb0704f46d4d2b76fc1ec980a7804e48b02d94a927e331" +checksum = "28da3d029be10258007699d002321a3b1ebe45e67b0e140a4cf464ba3ee79b32" dependencies = [ "bstr 1.0.1", "git-command", @@ -658,9 +648,9 @@ dependencies = [ [[package]] name = "git-date" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33db9f4462b565a33507aee113f3383bf16b988d2c573f07691e34302b7aa0a" +checksum = "8a2874ce2f3a77cb144167901ea830969e5c991eac7bfee85e6e3f53ef9fcdf2" dependencies = [ "bstr 1.0.1", "itoa", @@ -670,9 +660,9 @@ dependencies = [ [[package]] name = "git-diff" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82f77407381267be95f1b26acfb32007258af342ee61729bb4271b1869bf5bb2" +checksum = "8f30011a43908645c492dfbea7b004e10528be6bd667bf5cdc12ff4297fe1e3c" dependencies = [ "git-hash", "git-object", @@ -682,9 +672,9 @@ dependencies = [ [[package]] name = "git-discover" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c2cfd1272824b126c6997ef479a71288d00fae14dc5144dfc48658f4dd24fbe" +checksum = "93c244b1cf7cf45501116e948506c25324e33ddc613f00557ff5bfded2132009" dependencies = [ "bstr 1.0.1", "git-hash", @@ -696,9 +686,9 @@ dependencies = [ [[package]] name = "git-features" -version = "0.24.1" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bdbe755d2129bc609437b6b18af1116f146128dda6070c15c0aa50201ac17c" +checksum = "0f98e6ede7b790dfba16bf3c62861ae75c3719485d675b522cf7d7e748a4011c" dependencies = [ "crc32fast", "flate2", @@ -713,9 +703,9 @@ dependencies = [ [[package]] name = "git-glob" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef858611602fce54b51e45671ca72f07fe6a3c0e24a0539c66b75dfd4d84bd77" +checksum = "3908404c9b76ac7b3f636a104142378d3eaa78623cbc6eb7c7f0651979d48e8a" dependencies = [ "bitflags", "bstr 1.0.1", @@ -731,11 +721,21 @@ dependencies = [ "thiserror", ] +[[package]] +name = "git-hashtable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c52b625ad8cc360a0b7f426266f21fb07bd49b8f4ccf1b3ca7bc89424db1dec4" +dependencies = [ + "git-hash", + "hashbrown 0.13.1", +] + [[package]] name = "git-index" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a87c32d2e012ee316d4037b2151e5893599379ff1fc2c6adb36d2d4d1c461e2c" +checksum = "20627f71f3a884b0ae50f9f3abb3a07d9b117d06e16110d25b85da4d71d478c0" dependencies = [ "atoi", "bitflags", @@ -766,9 +766,9 @@ dependencies = [ [[package]] name = "git-mailmap" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "480eecdfaf1bfd05973678520d182dc07afa25b133db18c52575fb65b782b7ba" +checksum = "f90e3ee2eaeebda8a12d17f4d99dff5b19d81536476020bcebb99ee121820466" dependencies = [ "bstr 1.0.1", "git-actor", @@ -777,9 +777,9 @@ dependencies = [ [[package]] name = "git-object" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce0f14f9cd8f0782e843898a2fb7b0c2f5a6e37bd4cdff4409bb8ec698597dad" +checksum = "35b658f1e3e149d88cb3e0a2234be749bb0cab65887405975dbe6f3190cf6571" dependencies = [ "bstr 1.0.1", "btoi", @@ -796,9 +796,9 @@ dependencies = [ [[package]] name = "git-odb" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13493da6cf0326454215414d29f933a1e26bdba3b9b60ad8cdcbe06f0639584b" +checksum = "55333419bbb25aa6d39e29155f747ad8e1777fe385f70f447be9d680824d23dd" dependencies = [ "arc-swap", "git-features", @@ -807,16 +807,16 @@ dependencies = [ "git-pack", "git-path", "git-quote", - "parking_lot", + "parking_lot 0.12.1", "tempfile", "thiserror", ] [[package]] name = "git-pack" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8391cbf293f0f8ffbb5e324f25741f5e1e2d35fb87b89ab222a025661e0454" +checksum = "9ed3c9af66949553af9795b9eac9d450a5bdceee9959352cda468997ddce0d2f" dependencies = [ "bytesize", "clru", @@ -825,22 +825,22 @@ dependencies = [ "git-diff", "git-features", "git-hash", + "git-hashtable", "git-object", "git-path", "git-tempfile", "git-traverse", - "hash_hasher", "memmap2", - "parking_lot", + "parking_lot 0.12.1", "smallvec", "thiserror", ] [[package]] name = "git-path" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f60cbc13bc0fdd95df5f4b80437197e2853116792894b1bf38d1a6b4a64f8c9" +checksum = "e40e68481a06da243d3f4dfd86a4be39c24eefb535017a862e845140dcdb878a" dependencies = [ "bstr 1.0.1", "thiserror", @@ -848,14 +848,14 @@ dependencies = [ [[package]] name = "git-prompt" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21c6aaeb3f0f8de91f5e0eb950282c6508e05babcedef768db5a6f085d6e5242" +checksum = "3612a486e507dd431ef0f7108eeaafc8fd1ed7bd0f205a88554f6f91fe5dccbf" dependencies = [ "git-command", "git-config-value", "nix", - "parking_lot", + "parking_lot 0.12.1", "thiserror", ] @@ -872,9 +872,9 @@ dependencies = [ [[package]] name = "git-ref" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22484043921e699edc170415789f1b882c8f3546e1fbbc447a0043ef07e088c4" +checksum = "c97b7d719e4320179fb64d081016e7faca56fed4a8ee4cf84e4697faad9235a3" dependencies = [ "git-actor", "git-features", @@ -891,9 +891,9 @@ dependencies = [ [[package]] name = "git-refspec" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac2e8f36e7d5d48903b60051dfb75aedfc4ea9ba66bdffa7a9081e8d276b0107" +checksum = "d478e9db0956d60cd386d3348b5ec093e3ae613105a7a75ff6084b886254eba8" dependencies = [ "bstr 1.0.1", "git-hash", @@ -905,12 +905,10 @@ dependencies = [ [[package]] name = "git-repository" -version = "0.29.0" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89cec253dd3fba44694f7468d907506a52d0055850ecd7d84f4bac07f00e73f" +checksum = "1925a65a9fea6587e969a7a85cb239c8e1e438cf6dc520406df1b4c9d0e83bdc" dependencies = [ - "byte-unit", - "clru", "git-actor", "git-attributes", "git-config", @@ -921,6 +919,7 @@ dependencies = [ "git-features", "git-glob", "git-hash", + "git-hashtable", "git-index", "git-lock", "git-mailmap", @@ -940,6 +939,7 @@ dependencies = [ "git-worktree", "log", "once_cell", + "prodash", "signal-hook", "smallvec", "thiserror", @@ -948,23 +948,23 @@ dependencies = [ [[package]] name = "git-revision" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e629289b0d7f7f2f2e46248527f5cac838e6a7cb9507eab06fc8473082db6cb6" +checksum = "f7516b1db551756b4d3176c4b7d18ccc4b79d35dcc5e74f768c90f5bb11bb6c9" dependencies = [ "bstr 1.0.1", "git-date", "git-hash", + "git-hashtable", "git-object", - "hash_hasher", "thiserror", ] [[package]] name = "git-sec" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecb370efde58da72827909292284b5c5b885e0621a342515a36976b0b3bf660" +checksum = "9e1802e8252fa223b0ad89a393aed461132174ced1e6842a41f56dc92a3fc14f" dependencies = [ "bitflags", "dirs", @@ -989,21 +989,21 @@ dependencies = [ [[package]] name = "git-traverse" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2746935c92d252e24f9d345e0a981510596faceb7edae821b9e4c8c35c285b" +checksum = "5e5141dde56d0c4861193c760e01fb61c7e03a32d0840ba93a0ac1c597588d4d" dependencies = [ "git-hash", + "git-hashtable", "git-object", - "hash_hasher", "thiserror", ] [[package]] name = "git-url" -version = "0.11.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dbd91c55b1b03a833ff8278776fed272918cd61cd48efe9a97ad1fea7ef93ec" +checksum = "8651924c9692a778f09141ca44d1bf2dada229fe9b240f1ff1bdecd9621a1a93" dependencies = [ "bstr 1.0.1", "git-features", @@ -1015,9 +1015,9 @@ dependencies = [ [[package]] name = "git-validate" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf83bae632fc064ca938ebfb987364d9083b7f98b1476805f0a2d5eebb48686" +checksum = "0431cf9352c596dc7c8ec9066ee551ce54e63c86c3c767e5baf763f6019ff3c2" dependencies = [ "bstr 1.0.1", "thiserror", @@ -1025,9 +1025,9 @@ dependencies = [ [[package]] name = "git-worktree" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eae0e0b1050208e611d5fac0d8366b29ef3f83849767ff9c4bcf570f0d5dc2b" +checksum = "17d748c54c3d904c914b987654a1416c7abe7cf048fdc83eeae69e6ac3d76f20" dependencies = [ "bstr 1.0.1", "git-attributes", @@ -1093,12 +1093,6 @@ dependencies = [ "memmap2", ] -[[package]] -name = "hash_hasher" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74721d007512d0cb3338cd20f0654ac913920061a4c4d0d8708edb3f2a698c0c" - [[package]] name = "hashbrown" version = "0.12.3" @@ -1258,7 +1252,7 @@ dependencies = [ "helix-core", "imara-diff", "log", - "parking_lot", + "parking_lot 0.12.1", "tempfile", "tokio", ] @@ -1531,14 +1525,14 @@ dependencies = [ [[package]] name = "nix" -version = "0.25.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb" +checksum = "46a58d1d356c6597d08cde02c2f09d785b09e28711837b1ed667dc652c08a694" dependencies = [ - "autocfg", "bitflags", "cfg-if", "libc", + "static_assertions", ] [[package]] @@ -1595,6 +1589,17 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + [[package]] name = "parking_lot" version = "0.12.1" @@ -1602,7 +1607,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.4", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", ] [[package]] @@ -1647,12 +1666,14 @@ dependencies = [ [[package]] name = "prodash" -version = "21.1.0" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e13d7bd38cdab08b3a8b780cedcc54238c84fdca4084eb188807b308bcf11e6" +checksum = "38e2b91fcc982d0d8ae5e9d477561c73e09c24c5c19bac4858e202f6f065a13e" dependencies = [ "bytesize", + "dashmap", "human_format", + "parking_lot 0.11.2", ] [[package]] @@ -2110,7 +2131,7 @@ dependencies = [ "memchr", "mio", "num_cpus", - "parking_lot", + "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", "socket2", @@ -2235,12 +2256,6 @@ dependencies = [ "serde", ] -[[package]] -name = "utf8-width" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" - [[package]] name = "version_check" version = "0.9.4" diff --git a/helix-vcs/Cargo.toml b/helix-vcs/Cargo.toml index e54cf828f51b..8e713638dd9f 100644 --- a/helix-vcs/Cargo.toml +++ b/helix-vcs/Cargo.toml @@ -16,7 +16,7 @@ helix-core = { version = "0.6", path = "../helix-core" } tokio = { version = "1", features = ["rt", "rt-multi-thread", "time", "sync", "parking_lot", "macros"] } parking_lot = "0.12" -git-repository = { version = "0.29", default-features = false , optional = true } +git-repository = { version = "0.30", default-features = false , optional = true } imara-diff = "0.1.5" log = "0.4" From eed80ef1c231a27ea76e6cb1b8800b299f56d834 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Dec 2022 17:28:21 -0600 Subject: [PATCH 203/352] build(deps): bump serde from 1.0.151 to 1.0.152 (#5307) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.151 to 1.0.152. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.151...v1.0.152) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] 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 1243bc51d1d2..3592e621ed0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1826,18 +1826,18 @@ checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" [[package]] name = "serde" -version = "1.0.151" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fed41fc1a24994d044e6db6935e69511a1153b52c15eb42493b26fa87feba0" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.151" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", From ebaf01924dd0e6251535d88ec0a2a00e88680d6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Dec 2022 17:28:40 -0600 Subject: [PATCH 204/352] build(deps): bump cc from 1.0.77 to 1.0.78 (#5308) Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.0.77 to 1.0.78. - [Release notes](https://github.com/rust-lang/cc-rs/releases) - [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.77...1.0.78) --- updated-dependencies: - dependency-name: cc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3592e621ed0f..96c39fd5c81d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -155,9 +155,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.77" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" +checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" [[package]] name = "cfg-if" From 1f4d277013783c9c537444299ba4e558b9047fe2 Mon Sep 17 00:00:00 2001 From: farwyler <1705805+farwyler@users.noreply.github.com> Date: Tue, 27 Dec 2022 15:57:09 +0100 Subject: [PATCH 205/352] Allow custom preprocessors for 'vue' injections (#5268) --- runtime/queries/vue/injections.scm | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/runtime/queries/vue/injections.scm b/runtime/queries/vue/injections.scm index 73df868b6926..1b053e748d3f 100644 --- a/runtime/queries/vue/injections.scm +++ b/runtime/queries/vue/injections.scm @@ -8,13 +8,37 @@ (raw_text) @injection.content) (#set! injection.language "javascript")) +;