From 0e8ea13696206aa8ad289d539a5df62f34a73dec Mon Sep 17 00:00:00 2001 From: Ollie Charles Date: Sat, 10 Dec 2022 20:03:18 +0000 Subject: [PATCH 0001/1238] 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 28dafd7ad..4dca81047 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 000000000..9870dc4a4 --- /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 0002/1238] 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 0e76ebbbe..ee174e69d 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 833616e04..2aa924755 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 29a9f2e75..80d44a826 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 f61c4c450..107e48dd1 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 0003/1238] 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 2bac5be08..1310417e4 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 973cf82ea..c13a66736 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 0004/1238] 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 392b5f8c9..322caea54 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 0c6d924f6..f8ee0890d 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 c65750f4e..1c911eb5f 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 0005/1238] 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 06af52bd3..dae675dfc 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 0006/1238] 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 2277a0bd9..9835145ce 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 0007/1238] 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 6390ef858..66e6ac039 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 03fcaa553..2119a48d6 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 0008/1238] 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 dae675dfc..e6bc344cc 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 5606e93d3..d3c292708 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 3b7a42755..468193745 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 0009/1238] 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 b204214fc..040a039c4 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 0010/1238] 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 040a039c4..6ae0a71f8 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 05c5467ea..d04edcd52 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 0011/1238] 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 deeff80e1..3a4896f1e 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 c242f0894..8c105bfcf 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 0012/1238] 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 8c105bfcf..9518a5373 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 0013/1238] 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 3a4896f1e..0d6fcb3e8 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 0014/1238] 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 4dca81047..fa7b6edd3 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 e6bc344cc..e28476d31 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 000000000..b546d39f2 --- /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 0015/1238] 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 fa7b6edd3..1400fa875 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 000000000..f2077037d --- /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 0016/1238] 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 2119a48d6..cb387fcb5 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 f1219ec5d..b2c8a79f7 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 0017/1238] 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 5e9ca3d88..8b5d20eca 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 0018/1238] 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 107e48dd1..5b5924bff 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 0b8a93ae8..5b2bc8060 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 8b5d20eca..821a282cf 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 0019/1238] 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 810e3adf1..8052dcac2 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 0020/1238] 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 821a282cf..35597843b 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 0021/1238] 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 35597843b..2d471aae6 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 0022/1238] 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 8052dcac2..86b0c5fa7 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 0023/1238] 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 1310417e4..0f04ecba6 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 0024/1238] 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 66e6ac039..269d63e37 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 cb387fcb5..90dde7e14 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 9dad36209..18620b7bb 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 0025/1238] 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 0f04ecba6..6cf494646 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 0026/1238] 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 269d63e37..66e6ac039 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 90dde7e14..cb387fcb5 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 18620b7bb..9dad36209 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 0027/1238] 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 e28476d31..d03726e72 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 0028/1238] 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 139e8fddf..153294007 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 0029/1238] 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 e8fbb84d0..6558fe19f 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 0030/1238] 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 5b5924bff..ade1d8cf4 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 2d471aae6..aad3f81ce 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 0031/1238] 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 1400fa875..73e0bfcd5 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 d03726e72..42495e5c0 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 000000000..33a53e7f9 --- /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 0032/1238] 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 73e0bfcd5..1a3aed79b 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 42495e5c0..8972a6e94 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 000000000..c0e23e917 --- /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 0033/1238] 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 322caea54..0f94828eb 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 b19b9a9fc..5fb6745a9 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 0034/1238] 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 63fc2f790..268a38df6 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 054093195..c7b5dc84e 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 0035/1238] 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 418c41954..885ea0bff 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 0036/1238] 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 6ae0a71f8..52ed478fb 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 0037/1238] 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 52ed478fb..3f4b081cb 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 0038/1238] 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 3f4b081cb..7e98a0f75 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 0039/1238] 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 7e98a0f75..1b4572bba 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 30bfc7ea3..9f2e5188d 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 0040/1238] 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 1b4572bba..e00e1f638 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 0041/1238] build(nix): update inputs (#5219) --- flake.lock | 70 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index f097519e3..4cf1018c4 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 0042/1238] 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 82d79cc76..a1a0ebb88 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 0043/1238] 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 e00e1f638..a6ca94954 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 0044/1238] 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 90bdb446b..0f459311c 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 0045/1238] 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 89575e3a1..f5787ca8c 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 0046/1238] 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 d3c292708..66058034b 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 0047/1238] 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 e184db157..e88393512 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 0048/1238] 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 885ea0bff..1fc5605ea 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 0049/1238] 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 cb387fcb5..c3a7c9faa 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 0050/1238] 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 153294007..272c758b6 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 1f28ecefb..ffba46ab7 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 6cf494646..437e11b5c 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 ebcd125aa..ef93dee08 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 0051/1238] 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 fc201853f..35cf77abc 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 0052/1238] 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 14e240dd5..8558db3ab 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 0053/1238] 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 7a50e007b..5f013b9af 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 0054/1238] 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 8972a6e94..53f65be7c 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 0055/1238] 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 c3a7c9faa..c2ca1a478 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 0056/1238] 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 1fc5605ea..baf32c274 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 0057/1238] 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 baf32c274..408f74514 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 0058/1238] 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 a6ca94954..1243bc51d 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 e54cf828f..8e713638d 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 0059/1238] 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 1243bc51d..3592e621e 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 0060/1238] 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 3592e621e..96c39fd5c 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 0061/1238] 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 73df868b6..1b053e748 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")) +; + {{/if}} +
- - - - +
{{> header}} -