From 60fce357fb95d01e943811cbb2f4bd80aee1d3e0 Mon Sep 17 00:00:00 2001 From: CalebLarsen <43345286+CalebLarsen@users.noreply.github.com> Date: Tue, 24 Jun 2025 08:08:25 -0500 Subject: [PATCH 01/20] queries: Fix Rust function parameter locals tracking (#13828) --- runtime/queries/rust/locals.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/queries/rust/locals.scm b/runtime/queries/rust/locals.scm index 7958ef04d..a9ca760d6 100644 --- a/runtime/queries/rust/locals.scm +++ b/runtime/queries/rust/locals.scm @@ -14,8 +14,10 @@ ; Definitions -(parameter - pattern: (identifier) @local.definition.variable.parameter) +(function_item + (parameters + (parameter + pattern: (identifier) @local.definition.variable.parameter))) (closure_parameters (identifier) @local.definition.variable.parameter) From 974ac9eaf3797661880006fedc10933cec8d2e86 Mon Sep 17 00:00:00 2001 From: Md Atiquz Zaman <77184888+atiquz@users.noreply.github.com> Date: Tue, 24 Jun 2025 18:39:14 +0530 Subject: [PATCH 02/20] Sidra Theme - A super customizable, balanced dark theme for Helix (#13575) --- runtime/themes/sidra.toml | 219 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 runtime/themes/sidra.toml diff --git a/runtime/themes/sidra.toml b/runtime/themes/sidra.toml new file mode 100644 index 000000000..44a9474fe --- /dev/null +++ b/runtime/themes/sidra.toml @@ -0,0 +1,219 @@ +# License: MIT License +# Sidra Theme for the Helix Editor +# Author: Md Atiquz Zaman +# Repo: https://github.com/atiquz/sidra +# Inspired by: One Monokai, Dracula, One Dark Pro +# Description: A customizable, balanced dark theme built for readability and flexibility. + + +# =========================== +# UI Element Styling +# =========================== + + +# USER INTERFACE +"ui.background" = { fg = "foreground", bg = "background" } +"ui.background.separator" = { fg = "white" } + +"ui.linenr" = { fg = "fg_linenr" } +"ui.linenr.selected" = { fg = "fg_linenr_sld" } + +"ui.help" = { fg = "fg_help", bg = "bg_help" } +"ui.popup" = { bg = "bg_popup" } +"ui.window" = { fg = "fg_window" } + +"ui.text" = { fg = "fg_text" } +"ui.text.focus" = { fg = "fg_text_focus" } +"ui.text.inactive" = { fg = "fg_text_inactive" } + +"ui.virtual" = { fg = "fg_virtual" } +"ui.virtual.ruler" = { bg = "bg_virtual_ruler" } +"ui.virtual.indent-guide" = { fg = "fg_virtual_indent" } + +"ui.debug" = { fg = "fg_debug", modifiers = ["bold"] } +"ui.debug.active" = { fg = "fg_debug_active", modifiers = ["bold"] } +"ui.debug.breakpoint" = { fg = "fg_debug_breakpoint", modifiers = ["bold"] } + +"ui.menu" = { fg = "gray", bg = "black" } +"ui.menu.selected" = { fg = "black", bg = "gray" } + +# CURSOR +"ui.cursor" = { fg = "foreground", bg = "bg_normal", modifiers = ["dim"] } +"ui.cursor.match" = { fg = "foreground", bg = "bg_match", modifiers = ["dim"] } +"ui.cursor.normal" = { fg = "background", bg = "bg_normal", modifiers = ["dim"] } +"ui.cursor.insert" = { fg = "background", bg = "bg_insert", modifiers = ["dim"] } +"ui.cursor.select" = { fg = "background", bg = "bg_select", modifiers = ["dim"] } +"ui.cursor.primary.normal" = { fg = "background", bg = "bg_normal" } +"ui.cursor.primary.insert" = { fg = "background", bg = "bg_insert" } +"ui.cursor.primary.select" = { fg = "background", bg = "bg_select" } +"ui.cursorline" = { bg = "bg_cursorline" } +"ui.cursorline.primary" = { bg = "bg_cursorline" } + + +# SELECTION +"ui.selection" = { fg = "white", bg = "bg_selection" } +"ui.selection.primary" = { fg = "white", bg = "bg_selection" } + + +# STATUS LINE +"ui.statusline" = { fg = "fg_statusline", bg = "bg_statusline" } +"ui.statusline.inactive" = { fg = "fg_inactive", bg = "bg_inactive" } +"ui.statusline.normal" = { fg = "black", bg = "bg_normal", modifiers = ["bold"] } +"ui.statusline.insert" = { fg = "black", bg = "bg_insert", modifiers = ["bold"] } +"ui.statusline.select" = { fg = "black", bg = "bg_select", modifiers = ["bold"] } + +# MARKUP +"markup.heading" = { fg = "markup_heading" } +"markup.bold" = { fg = "markup_bold", modifiers = ["bold"] } +"markup.italic" = { fg = "markup_italic", modifiers = ["italic"] } +"markup.strikethrough" = { fg = "markup_strikethrough", modifiers = ["crossed_out", "bold"] } +"markup.link.url" = { fg = "markup_link_url", modifiers = ["underlined"] } +"markup.link.text" = { fg = "markup_link_text" } +"markup.raw" = { fg = "markup_raw" } + + +# GIT +"diff.plus" = { fg = "plus", modifiers = ["bold"] } +"diff.minus" = { fg = "minus", modifiers = ["bold"] } +"diff.delta" = { fg = "delta", modifiers = ["bold"] } + + +# HINT INFO ERROR & WARNING +"diagnostic.hint" = { underline = { color = "cl_hint", style = "curl" } } +"diagnostic.info" = { underline = { color = "cl_info", style = "curl" } } +"diagnostic.error" = { underline = { color = "cl_error", style = "curl" } } +"diagnostic.warning" = { underline = { color = "cl_warning", style = "curl" } } + +hint = "cl_hint" +info = "cl_info" +error = "cl_error" +warning = "cl_warning" + + +# =========================== +# SYNTAX COLORS +# =========================== + + +# === ATTRIBUTES & KEYWORDS === +attribute = "#a7bf67" # Olive green +keyword = "#A4A2B4" # Muted lavender gray +"keyword.directive" = "#D3D3D3" # Light gray (used to be "light-gray") +namespace = "#7095bf" # Steel blue + +# === SYMBOLS & OPERATORS === +punctuation = "#FFFFFF" # White +"punctuation.delimiter" = "#FFFFFF" # White (delimiter punctuation) +operator = "#987654" # Dusty brown (used to be "muddy") +special = "#c90076" # Pink Color + +# === VARIABLES === +variable = "#7ec67f" # Soft green +"variable.other.member" = "#7ec67f" # Soft green (class or object members) +"variable.parameter" = "#a8ffb4" # Pale mint green +"variable.builtin" = "#a8ffb4" # Pale mint green (special language vars) + +# === TYPES === +type = "#efbe4c" # Golden yellow +"type.builtin" = "#efbe4c" # Golden yellow (built-in types) +constructor = "#c19ef7" # Light lilac + +# === FUNCTIONS === +function = "#987654" # Dusty brown (used to be "muddy") +"function.macro" = "#987654" # Dusty brown (macro functions) +"function.builtin" = "#db985e" # Orange tan + +# === TAGS === +tag = "#d37a78" # Soft salmon pink + +# === COMMENTS === +comment = "#D3D3D3" # Light gray + +# === CONSTANTS === +constant = "#A5C4D4" # Pale blue +"constant.builtin" = "#f1fa8c" # Bright yellow +"constant.numeric" = "#b577b0" # Muted violet +"constant.character.escape" = "#c95c56" # Coral red (escape characters) + +# === STRINGS === +string = "#d6a560" # Sandy yellow-orange + +# === LABELS === +label = "#abcc8a" # Pale green + + + +# =========================== +# Color Palette +# =========================== + +[palette] + +# ===== MODES COLORS ===== + +bg_normal = "#BD93F9" # Light purple +bg_insert = "#50fa7b" # Neon green +bg_select = "#8be9fd" # Cyan blue +bg_match = "#D3D3D3" # Light gray + +# ===== GIT COLORS ===== + +plus = "#4F6F52" # Forest green +minus = "#B80000" # Vivid red +delta = "#3876BF" # Steel blue + +# ===== MARKUP COLORS ===== + +markup_heading = "#ff69b4" # Hot pink +markup_bold = "#e7c547" # Bright yellow +markup_italic = "#b294bb" # Lavender +markup_strikethrough = "#d7005f" # Deep pink-red +markup_link_url = "#3876BF" # Steel blue +markup_link_text = "#FFA500" # Orange +markup_raw = "#808080" # Medium gray + +# ===== PRIMARY UI COLORS ===== + +foreground = "#D3D3D3" # Light gray (default text) +background = "#1f1f21" # Very dark gray (background) + +# ===== UI INTERFACE COLORS ===== + +fg_linenr = "#747575" # Dull silver (line numbers) +fg_linenr_sld = "#c7dddd" # Light cyan (selected line number) +fg_help = "#D3D3D3" # Light gray (help text) +bg_help = "#35353a" # Charcoal (help background) +bg_popup = "#3b3b3d" # Dark gray (popup background) +fg_window = "#F1DCA7" # Soft cream (window border/title) + +fg_text = "#D3D3D3" # Light gray (main text) +fg_text_focus = "#83c679" # Light green (focused text) +fg_text_inactive = "#93a56f" # Olive green (inactive text) + +# ===== VIRTUAL COLORS ===== + +fg_virtual = "#F1DCA7" # Cream (virtual text) +bg_virtual_ruler = "#363638" # Deep gray (ruler background) +fg_virtual_indent = "#5B5B5A" # Medium-dark gray (indent guides) + +# ===== DEBUGGING COLORS ===== + +fg_debug = "#634450" # Plum (debug info) +fg_debug_active = "#3876BF" # Blue (active debug line) +fg_debug_breakpoint = "#B80000" # Red (breakpoint marker) + +# ===== CURSOR, SELECTION, STATUSLINE ===== + +bg_cursorline = "#2d303e" # Slate blue-gray (cursor line) +bg_selection = "#71797E" # Cool gray (selected text background) +fg_statusline = "#D3D3D3" # Light gray (statusline text) +bg_statusline = "#303030" # Dark gray (statusline background) +fg_inactive = "#4b5059" # Dim gray (inactive statusline text) +bg_inactive = "#303030" # Dark gray (inactive statusline bg) + +# ===== HINT INFO ERROR & WARNING COLORS ===== + +cl_hint = "#f1fa8c" # Bright yellow +cl_info = "#f1fa8c" # Same as hint +cl_error = "#ff69b4" # Bright pink +cl_warning = "#f1fa8c" # Same as hint From c3c4895179d4bc5a00e22fdf129d41c1af96226a Mon Sep 17 00:00:00 2001 From: CalebLarsen <43345286+CalebLarsen@users.noreply.github.com> Date: Wed, 25 Jun 2025 08:21:24 -0500 Subject: [PATCH 03/20] fix: Make code-action popup auto close like other popups (#13832) --- helix-term/src/commands/lsp.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index a6d4b424d..ac9dd6e27 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -807,7 +807,9 @@ pub fn code_action(cx: &mut Context) { }); picker.move_down(); // pre-select the first item - let popup = Popup::new("code-action", picker).with_scrollbar(false); + let popup = Popup::new("code-action", picker) + .with_scrollbar(false) + .auto_close(true); compositor.replace_or_push("code-action", popup); }; From b9f980f567aa0d43426e78030fbb6d2723734e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20Plagborg=20Bak=20S=C3=B8rensen?= <57013304+kpbaks@users.noreply.github.com> Date: Thu, 26 Jun 2025 19:06:50 +0200 Subject: [PATCH 04/20] languages: detect `~/.gem/credentials` as yaml (#13843) --- languages.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/languages.toml b/languages.toml index 536962e1e..63b538420 100644 --- a/languages.toml +++ b/languages.toml @@ -1424,6 +1424,7 @@ file-types = [ { glob = ".clangd" }, { glob = ".clang-format" }, { glob = ".clang-tidy" }, + { glob = ".gem/credentials" }, "sublime-syntax" ] comment-token = "#" From a9d51ef2582a226758773dc3e45565c7d6f2d05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20Plagborg=20Bak=20S=C3=B8rensen?= <57013304+kpbaks@users.noreply.github.com> Date: Thu, 26 Jun 2025 19:51:10 +0200 Subject: [PATCH 05/20] queries: inject all lines in a newline escaped RUN Dockerfile instruction as bash (#13845) --- runtime/queries/dockerfile/injections.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/queries/dockerfile/injections.scm b/runtime/queries/dockerfile/injections.scm index 20396f1ae..cf11bcfd5 100644 --- a/runtime/queries/dockerfile/injections.scm +++ b/runtime/queries/dockerfile/injections.scm @@ -1,6 +1,7 @@ ((comment) @injection.content (#set! injection.language "comment")) -([(shell_command) (shell_fragment)] @injection.content - (#set! injection.language "bash")) +((shell_command (shell_fragment) @injection.content) + (#set! injection.language "bash") + (#set! injection.combined)) From 44293dfd2248d82f39bb8e5b91cbb1daf2e24290 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Fri, 27 Jun 2025 10:39:38 -0400 Subject: [PATCH 06/20] Change tree-sitter parser for Git commit message files The gbprod grammar is more complete and featureful than mine, and more actively maintained. I will archive my tree-sitter-git-commit in favor of gbprod's. The new queries are based on the ones in the repo upstream but I modified them to look similar to the highlights before this commit. Also I've updated the tab-width so that change nodes in the generated message are indented correctly. --- languages.toml | 7 +++--- runtime/queries/git-commit/highlights.scm | 30 +++++++++++------------ runtime/queries/git-commit/injections.scm | 4 +-- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/languages.toml b/languages.toml index 63b538420..a2dc2053d 100644 --- a/languages.toml +++ b/languages.toml @@ -1859,13 +1859,14 @@ name = "git-commit" scope = "git.commitmsg" file-types = [{ glob = "COMMIT_EDITMSG" }, { glob = "MERGE_MSG" }] comment-token = "#" -indent = { tab-width = 2, unit = " " } +indent = { tab-width = 4, unit = " " } rulers = [51, 73] text-width = 72 +grammar = "gitcommit" [[grammar]] -name = "git-commit" -source = { git = "https://github.com/the-mikedavis/tree-sitter-git-commit", rev = "6f193a66e9aa872760823dff020960c6cedc37b3" } +name = "gitcommit" +source = { git = "https://github.com/gbprod/tree-sitter-gitcommit", rev = "a716678c0f00645fed1e6f1d0eb221481dbd6f6d" } [[language]] name = "diff" diff --git a/runtime/queries/git-commit/highlights.scm b/runtime/queries/git-commit/highlights.scm index 319d76569..bc84d0371 100644 --- a/runtime/queries/git-commit/highlights.scm +++ b/runtime/queries/git-commit/highlights.scm @@ -1,18 +1,18 @@ +[(comment) (generated_comment) (scissor)] @comment (subject) @markup.heading -(path) @string.special.path (branch) @string.special.symbol -(commit) @constant -(item) @markup.link.url -(header) @tag +(filepath) @string.special.path +(arrow) @punctuation.delimiter +(subject (subject_prefix) @function) +(prefix (type) @keyword) +(prefix (scope) @variable.parameter) +(prefix [ "(" ")" ":" ] @punctuation.delimiter) +(prefix "!" @punctuation.special) +(trailer (token) @variable.other.member) +(trailer (value) @string) +(breaking_change (token) @special) -(change kind: "new file" @diff.plus) -(change kind: "deleted" @diff.minus) -(change kind: "modified" @diff.delta) -(change kind: "renamed" @diff.delta.moved) - -(trailer - key: (trailer_key) @variable.other.member - value: (trailer_value) @string) - -[":" "=" "->" (scissors)] @punctuation.delimiter -(comment) @comment +(change kind: (new)) @diff.plus +(change kind: (deleted)) @diff.minus +(change kind: (modified)) @diff.delta +(change kind: [(renamed) (typechange)]) @diff.delta.moved diff --git a/runtime/queries/git-commit/injections.scm b/runtime/queries/git-commit/injections.scm index 79f7691a9..823188e01 100644 --- a/runtime/queries/git-commit/injections.scm +++ b/runtime/queries/git-commit/injections.scm @@ -1,6 +1,4 @@ -(((scissors) - (message) @injection.content) - (#set! injection.include-children) +((diff) @injection.content (#set! injection.language "diff")) ((rebase_command) @injection.content From 930340e646f2ae8801519cbda48ea2832872a771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Fern=C3=A1ndez=20Serrata?= <76864299+Rudxain@users.noreply.github.com> Date: Sat, 28 Jun 2025 13:04:34 -0400 Subject: [PATCH 07/20] feat: recognize mimeapps.list as INI (#13850) --- languages.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/languages.toml b/languages.toml index a2dc2053d..a5015dd2c 100644 --- a/languages.toml +++ b/languages.toml @@ -2963,6 +2963,7 @@ file-types = [ "service", "automount", "desktop", + { glob = "mimeapps.list" }, "device", "mount", "nspawn", From d654a07d3d85d055b47ff9d92ab7c5faa57a7e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20K=C3=B6hnen?= Date: Sat, 28 Jun 2025 23:59:32 +0200 Subject: [PATCH 08/20] queries/dockerfile: injections for heredocs (#13852) --- runtime/queries/dockerfile/injections.scm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/runtime/queries/dockerfile/injections.scm b/runtime/queries/dockerfile/injections.scm index cf11bcfd5..fae7e3370 100644 --- a/runtime/queries/dockerfile/injections.scm +++ b/runtime/queries/dockerfile/injections.scm @@ -5,3 +5,12 @@ (#set! injection.language "bash") (#set! injection.combined)) +((run_instruction + (heredoc_block (heredoc_line) @injection.content . "\n" @injection.content)) + (#set! injection.language "bash") + (#set! injection.combined)) + +((copy_instruction + (path (heredoc_marker)) . (path) @injection.filename + (heredoc_block (heredoc_line) @injection.content . "\n" @injection.content)) + (#set! injection.combined)) From f75d71844f27a13b313603af42c58a5c6d6b608e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20Plagborg=20Bak=20S=C3=B8rensen?= <57013304+kpbaks@users.noreply.github.com> Date: Sun, 29 Jun 2025 00:00:58 +0200 Subject: [PATCH 09/20] queries: inject nix into `lib.literalExression` string contents (#13851) --- runtime/queries/nix/injections.scm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/runtime/queries/nix/injections.scm b/runtime/queries/nix/injections.scm index ce53d39e3..f9e0267bf 100644 --- a/runtime/queries/nix/injections.scm +++ b/runtime/queries/nix/injections.scm @@ -255,4 +255,18 @@ (#set! injection.combined)) ((indented_string_expression (string_fragment) @injection.shebang @injection.content) - (#set! injection.combined)) \ No newline at end of file + (#set! injection.combined)) + +; string contents of lib.literalExpression is nix code +((apply_expression + function: [ + (select_expression) ; `lib.literalExpression` + (variable_expression) ; `literalExpression` this is the case when the symbol is brougth into scope e.g. `let inherit (lib) literalExpression; in` + ] @_func + argument: [ + (indented_string_expression (string_fragment) @injection.content) ; lib.literalExpression ''...'' + (string_expression (string_fragment) @injection.content) ; lib.literalExpression "..." + ]) + (#any-of? @_func "lib.literalExpression" "literalExpression") + (#set! injection.language "nix") + (#set! injection.combined)) From e03f10018785a29893012b433f8e0f39c2ee9fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Krmpoti=C4=87?= Date: Mon, 30 Jun 2025 16:11:53 +0200 Subject: [PATCH 10/20] Fix typo in helix-tui text module docs (#13860) --- helix-tui/src/text.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-tui/src/text.rs b/helix-tui/src/text.rs index c4313e15f..1317a0095 100644 --- a/helix-tui/src/text.rs +++ b/helix-tui/src/text.rs @@ -10,7 +10,7 @@ //! These types form a hierarchy: [`Spans`] is a collection of [`Span`] and each line of [`Text`] //! is a [`Spans`]. //! -//! Keep it mind that a lot of widgets will use those types to advertise what kind of string is +//! Keep in mind that a lot of widgets will use those types to advertise what kind of string is //! supported for their properties. Moreover, `tui` provides convenient `From` implementations so //! that you can start by using simple `String` or `&str` and then promote them to the previous //! primitives when you need additional styling capabilities. From 305f8bc16599376f117d468c9cf63838133dd9fb Mon Sep 17 00:00:00 2001 From: CalebLarsen <43345286+CalebLarsen@users.noreply.github.com> Date: Mon, 30 Jun 2025 09:21:37 -0500 Subject: [PATCH 11/20] Re-detect `.editorconfig` on `:config-reload` (#13443) --- helix-term/src/application.rs | 2 ++ helix-view/src/document.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 17b58420c..cf09aac0d 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -401,6 +401,8 @@ impl Application { // Re-parse any open documents with the new language config. let lang_loader = self.editor.syn_loader.load(); for document in self.editor.documents.values_mut() { + // Re-detect .editorconfig + document.detect_editor_config(); document.detect_language(&lang_loader); let diagnostics = Editor::doc_diagnostics( &self.editor.language_servers, diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index fb89e2e0c..a0a56113c 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -1172,7 +1172,7 @@ impl Document { } } - pub(crate) fn detect_editor_config(&mut self) { + pub fn detect_editor_config(&mut self) { if self.config.load().editor_config { if let Some(path) = self.path.as_ref() { self.editor_config = EditorConfig::find(path); From 0d799235f693f0ab4e7b6d21a8b1f99881bb7166 Mon Sep 17 00:00:00 2001 From: Nik Revenco Date: Mon, 23 Jun 2025 20:03:30 +0100 Subject: [PATCH 12/20] feat: Inject markdown into Go's block documentation comments more chore: capture unlimited number of comments Each commen --- runtime/queries/go/injections.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/runtime/queries/go/injections.scm b/runtime/queries/go/injections.scm index d7b03da35..48dfae369 100644 --- a/runtime/queries/go/injections.scm +++ b/runtime/queries/go/injections.scm @@ -1,6 +1,33 @@ ((comment) @injection.content (#set! injection.language "comment")) +; Inject markdown into documentation comments +; +; Go's comments are documentation comments when they are directly followed +; by one of Go's statements (e.g. `type`, `func`, `const`) +; +; This is only a partial implementation, which covers only +; block comments. For line comments (which are more common), +; upstream changes to the grammar are required. +( + (comment) @injection.content . (comment)* . [ + (package_clause) ; `package` + (type_declaration) ; `type` + (method_declaration) ; `func` + (var_declaration) ; `var` + (const_declaration) ; `const` + ; var ( + ; A = 1 + ; B = 2 + ; ) + (const_spec) + ; const ( + ; A = 1 + ; B = 2 + ; ) + (var_spec) + ] + (#set! injection.language "markdown")) (call_expression (selector_expression) @_function From b036fa0b9bcbf33456da9e37f952f84af08dbb5d Mon Sep 17 00:00:00 2001 From: Nik Revenco Date: Tue, 24 Jun 2025 21:04:20 +0100 Subject: [PATCH 13/20] fix: Highlight `'x'` as a character in Go --- runtime/queries/go/highlights.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/queries/go/highlights.scm b/runtime/queries/go/highlights.scm index 485b5cb8d..0d65eb16f 100644 --- a/runtime/queries/go/highlights.scm +++ b/runtime/queries/go/highlights.scm @@ -180,9 +180,10 @@ [ (interpreted_string_literal) (raw_string_literal) - (rune_literal) ] @string +(rune_literal) @constant.character + (escape_sequence) @constant.character.escape [ From 4d782bbd18fe16e53f17d0517bb33875e93c3125 Mon Sep 17 00:00:00 2001 From: Peter Retzlaff Date: Mon, 30 Jun 2025 16:32:32 +0200 Subject: [PATCH 14/20] Add "Dark Synthwave" theme (#13857) --- runtime/themes/dark-synthwave.toml | 114 ++++++++++++++++++ .../themes/licenses/dark-synthwave.license | 21 ++++ 2 files changed, 135 insertions(+) create mode 100644 runtime/themes/dark-synthwave.toml create mode 100644 runtime/themes/licenses/dark-synthwave.license diff --git a/runtime/themes/dark-synthwave.toml b/runtime/themes/dark-synthwave.toml new file mode 100644 index 000000000..9bb8a479a --- /dev/null +++ b/runtime/themes/dark-synthwave.toml @@ -0,0 +1,114 @@ +# Dark Synthwave +# Based on Dark SynthWave '84 for VS Code (https://github.com/brainomite/dark-synthwave-vscode/tree/main) +# +# Author : Peter Retzlaff +# License: MIT License + +# UI Colors +"ui.background" = { bg = "black", fg = "blood-red" } +"ui.cursor" = { fg = "white", modifiers = ["reversed"] } +"ui.cursor.primary" = { fg = "white", modifiers = ["reversed"] } +"ui.cursor.match" = { bg = "selection-blue" } +"ui.text" = "white" +"ui.text.focus" = { fg = "dark-grey", bg = "synth-red" } +"ui.text.inactive" = "grey" +"ui.linenr" = "grey" +"ui.linenr.selected" = "white" +"ui.statusline" = { fg = "white", bg = "black" } +"ui.statusline.inactive" = { fg = "grey", bg = "black"} +"ui.statusline.separator" = "synth-red" +"ui.popup" = { fg = "#f8f8f0", bg = "#1E1E1E" } +"ui.popup.info" = { fg = "synth-red", bg = "black" } +"ui.window" = "synth-red" +"ui.help" = { fg = "#f8f8f0", bg = "#1E1E1E" } +"ui.virtual.jump-label" = {fg = "synth-red", modifiers = ["bold"]} +"ui.selection" = { bg = "selection-blue" } +"ui.selection.primary" = { bg = "selection-blue" } +"ui.menu" = { fg = "white", bg = "black" } +"ui.menu.selected" = { fg = "dark-grey", bg = "synth-red" } +"ui.picker" = { fg = "neon-yellow" } +"ui.picker.header.column.active" = { modifiers = ["bold"] } +"ui.background.separator" = "synth-red" + +# Diagnostic colors +"warning" = "warning" +"error" = "error" +"info" = "info" +"hint" = "info" +"diagnostic.warning" = { underline = { color = "warning", style = "curl" } } +"diagnostic.error" = { underline = { color = "error", style = "curl" } } +"diagnostic.info" = { underline = { color = "info", style = "curl" } } +"diagnostic.hint" = { underline = { color = "info", style = "curl" } } + +# Syntax highlighting +"comment" = { fg = "mauve", modifiers = ["italic"] } +"constant" = "salmon" +"constant.numeric" = "salmon" +"constant.character.escape" = "beaming-blue" +"constant.builtin" = "synthetic-green" +"constant.builtin.boolean" = "synthetic-green" +"string" = "orange" +"string.regexp" = "salmon" +"variable" = "pelati-red" +"variable.builtin" = { fg = "blood-red", modifiers = ["bold"] } +"variable.parameter" = { fg = "jess-green", modifiers = ["italic"] } +"type" = "blood-red" +"constructor" = "blood-red" +"function" = "beaming-blue" +"keyword" = "neon-yellow" +"keyword.control" = "neon-yellow" +"keyword.control.import" = "jade" +"keyword.operator" = "neon-yellow" +"keyword.directive" = "jade" +"keyword.storage.type" = "neon-yellow" +"keyword.storage.modifier" = "neon-yellow" + +# "label" = "neon-yellow" +"namespace" = "blood-red" +"operator" = "neon-yellow" +# "special" = "beaming-blue" + +"punctuation.bracket" = "neon-yellow" +"tag" = "jade" +"attribute" = { fg = "neon-yellow", modifiers = ["italic"] } + +"markup.heading" = { fg = "#ff7edb", modifiers = ["bold"] } +"markup.bold" = { fg = "#2ee2fa", modifiers = ["bold"] } +"markup.italic" = { fg = "#2ee2fa", modifiers = ["italic"] } +"markup.link.url" = { fg = "jade", modifiers = ["italic"] } +"markup.link.text" = "neon-yellow" +"markup.quote" = { fg = "jade", modifiers = ["italic"] } +"markup.raw" = "pelati-red" +"markup.raw.inline" = "pelati-red" +"markup.raw.block" = "pelati-red" + +# Git gutter +"diff.plus.gutter" = "#47ffa0" +"diff.minus.gutter" = "error" +"diff.delta.gutter" = "info" + +# bufferline +"ui.bufferline" = { fg = "grey", bg = "#000000"} +"ui.bufferline.active" = { fg = "dark-grey", bg = "synth-red" } + +[palette] +black = "#000000" +white = "#ffffff" +neon-yellow = "#fede5d" +blood-red = "#fe4450" +pelati-red = "#f73232" +synth-red = "#ff3366" +salmon = "#f97e72" +beaming-blue = "#36f9f6" +selection-blue = "#001069" +synthetic-green = "#1afc65" +jess-green = "#28b881" +orange = "#ff8b39" +jade = "#72f1b8" +mauve = "#848bbd" +grey = "#808080" +dark-grey = "#141414" +error = "#ff5252" +warning = "#ffab40" +info = "#40c4ff" + diff --git a/runtime/themes/licenses/dark-synthwave.license b/runtime/themes/licenses/dark-synthwave.license new file mode 100644 index 000000000..4d5572bdd --- /dev/null +++ b/runtime/themes/licenses/dark-synthwave.license @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Aaron Young + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 0ca12250bc60f8266ce639e9d6f7d7ae0fc2983c Mon Sep 17 00:00:00 2001 From: Sean Barag Date: Mon, 30 Jun 2025 10:44:55 -0400 Subject: [PATCH 15/20] helix-view: expand primary selection line range in shell commands (#13840) --- book/src/command-line.md | 2 ++ helix-view/src/expansion.rs | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/book/src/command-line.md b/book/src/command-line.md index 2c0723fae..b2eae131a 100644 --- a/book/src/command-line.md +++ b/book/src/command-line.md @@ -49,6 +49,8 @@ The following variables are supported: | `line_ending` | A string containing the line ending of the currently focused document. For example on Unix systems this is usually a line-feed character (`\n`) but on Windows systems this may be a carriage-return plus a line-feed (`\r\n`). The line ending kind of the currently focused document can be inspected with the `:line-ending` command. | | `language` | A string containing the language name of the currently focused document.| | `selection` | A string containing the contents of the primary selection of the currently focused document. | +| `selection_line_start` | The line number of the start of the primary selection in the currently focused document, starting at 1. | +| `selection_line_end` | The line number of the end of the primary selection in the currently focused document, starting at 1. | Aside from editor variables, the following expansions may be used: diff --git a/helix-view/src/expansion.rs b/helix-view/src/expansion.rs index 99baf4bfb..b81166ede 100644 --- a/helix-view/src/expansion.rs +++ b/helix-view/src/expansion.rs @@ -37,6 +37,10 @@ pub enum Variable { Language, // Primary selection Selection, + // The one-indexed line number of the start of the primary selection in the currently focused document. + SelectionLineStart, + // The one-indexed line number of the end of the primary selection in the currently focused document. + SelectionLineEnd, } impl Variable { @@ -47,6 +51,8 @@ impl Variable { Self::LineEnding, Self::Language, Self::Selection, + Self::SelectionLineStart, + Self::SelectionLineEnd, ]; pub const fn as_str(&self) -> &'static str { @@ -57,6 +63,8 @@ impl Variable { Self::LineEnding => "line_ending", Self::Language => "language", Self::Selection => "selection", + Self::SelectionLineStart => "selection_line_start", + Self::SelectionLineEnd => "selection_line_end", } } @@ -68,6 +76,8 @@ impl Variable { "line_ending" => Some(Self::LineEnding), "language" => Some(Self::Language), "selection" => Some(Self::Selection), + "selection_line_start" => Some(Self::SelectionLineStart), + "selection_line_end" => Some(Self::SelectionLineEnd), _ => None, } } @@ -232,5 +242,13 @@ fn expand_variable(editor: &Editor, variable: Variable) -> Result Ok(Cow::Owned( doc.selection(view.id).primary().fragment(text).to_string(), )), + Variable::SelectionLineStart => { + let start_line = doc.selection(view.id).primary().line_range(text).0; + Ok(Cow::Owned((start_line + 1).to_string())) + } + Variable::SelectionLineEnd => { + let end_line = doc.selection(view.id).primary().line_range(text).1; + Ok(Cow::Owned((end_line + 1).to_string())) + } } } From 91dff9393dc53dc6214b7fb50882f5c55c8837d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20Plagborg=20Bak=20S=C3=B8rensen?= <57013304+kpbaks@users.noreply.github.com> Date: Mon, 30 Jun 2025 16:45:22 +0200 Subject: [PATCH 16/20] languages: add Caddyfile support (#13859) Co-authored-by: Michael Davis --- book/src/generated/lang-support.md | 1 + languages.toml | 14 +++++ runtime/queries/caddyfile/highlights.scm | 72 +++++++++++++++++++++++ runtime/queries/caddyfile/indents.scm | 8 +++ runtime/queries/caddyfile/injections.scm | 2 + runtime/queries/caddyfile/locals.scm | 5 ++ runtime/queries/caddyfile/textobjects.scm | 16 +++++ 7 files changed, 118 insertions(+) create mode 100644 runtime/queries/caddyfile/highlights.scm create mode 100644 runtime/queries/caddyfile/indents.scm create mode 100644 runtime/queries/caddyfile/injections.scm create mode 100644 runtime/queries/caddyfile/locals.scm create mode 100644 runtime/queries/caddyfile/textobjects.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index dad557d96..f16644a19 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -18,6 +18,7 @@ | c | ✓ | ✓ | ✓ | `clangd` | | c-sharp | ✓ | ✓ | | `OmniSharp` | | cabal | | | | `haskell-language-server-wrapper` | +| caddyfile | ✓ | ✓ | ✓ | | | cairo | ✓ | ✓ | ✓ | `cairo-language-server` | | capnp | ✓ | | ✓ | | | cel | ✓ | | | | diff --git a/languages.toml b/languages.toml index a5015dd2c..032fbc0b6 100644 --- a/languages.toml +++ b/languages.toml @@ -4436,3 +4436,17 @@ language-servers = [ "luau" ] [[grammar]] name = "luau" source = { git = "https://github.com/polychromatist/tree-sitter-luau", rev = "ec187cafba510cddac265329ca7831ec6f3b9955" } + +[[language]] +name = "caddyfile" +scope = "source.caddyfile" +injection-regex = "caddyfile" +file-types = [{ glob = "Caddyfile" }] +comment-tokens = ["#"] +indent = { tab-width = 4, unit = " " } +formatter = { command = "caddy", args = ["fmt", "-"] } +auto-format = true + +[[grammar]] +name = "caddyfile" +source = { git = "https://github.com/caddyserver/tree-sitter-caddyfile", rev = "b04bdb4ec53e40c44afbf001e15540f60a296aef" } diff --git a/runtime/queries/caddyfile/highlights.scm b/runtime/queries/caddyfile/highlights.scm new file mode 100644 index 000000000..492d2aec7 --- /dev/null +++ b/runtime/queries/caddyfile/highlights.scm @@ -0,0 +1,72 @@ +(comment) @comment +[ + (environment_variable) + (placeholder) +] @constant + +[ + (network_address) + (ip_address_or_cidr) +] @string.special.url + +(path) @string.special.path + +[ + (snippet_name) + (named_route_identifier) + (site_address) +] @keyword + +(directive (directive_name) @variable.other.member) + +; declaration of a named matcher +(named_matcher (matcher_identifier (matcher_name)) @function.macro) + +; reference to a named matcher +(matcher (matcher_identifier (matcher_name)) @function.macro) + +; directive within a named matcher declaration +(matcher_directive (matcher_directive_name) @function.method) + +; any other matcher (wildcard and path) +(matcher) @function.macro + +[ + (interpreted_string_literal) + (raw_string_literal) + (heredoc) + (cel_expression) +] @string +(escape_sequence) @constant.character.escape + +[ + (duration_literal) + (int_literal) +] @constant.numeric + +[ + "{" + "}" +] @punctuation.bracket + +(global_options + (directive) @keyword.directive) + +(directive + name: (directive_name) + (argument) @type) + +; matches directive arguments that looks like an absolute path +; e.g. +; log { +; output file /var/log/caddy.log +; } +(directive + (argument) @string.special.path + (#match? @string.special.path "^/")) + +((argument) @constant.builtin.boolean + (#any-of? @constant.builtin.boolean "on" "off")) + +((argument) @type.enum.variant + (#any-of? @type.enum.variant "tcp" "udp" "ipv4" "ipv6")) diff --git a/runtime/queries/caddyfile/indents.scm b/runtime/queries/caddyfile/indents.scm new file mode 100644 index 000000000..46b17f3a2 --- /dev/null +++ b/runtime/queries/caddyfile/indents.scm @@ -0,0 +1,8 @@ +[ + (block) + (matcher_block) +] @indent + +((global_options) @indent) + +"}" @outdent diff --git a/runtime/queries/caddyfile/injections.scm b/runtime/queries/caddyfile/injections.scm new file mode 100644 index 000000000..321c90add --- /dev/null +++ b/runtime/queries/caddyfile/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/caddyfile/locals.scm b/runtime/queries/caddyfile/locals.scm new file mode 100644 index 000000000..1a27ccea9 --- /dev/null +++ b/runtime/queries/caddyfile/locals.scm @@ -0,0 +1,5 @@ +(block) @local.scope + +(named_matcher (matcher_identifier (matcher_name)) @local.definition.function.macro) + +(matcher) @local.reference diff --git a/runtime/queries/caddyfile/textobjects.scm b/runtime/queries/caddyfile/textobjects.scm new file mode 100644 index 000000000..8a9fd7e98 --- /dev/null +++ b/runtime/queries/caddyfile/textobjects.scm @@ -0,0 +1,16 @@ +(comment) @comment.inside +(comment)+ @comment.around + +(directive + name: (directive_name) @parameter.inside) @parameter.around + +(global_options + "{" (_)* @class.inside "}") @class.around + +(snippet_definition + (block) @class.inside) @class.around + +(named_route + (block) @class.inside) @class.around + +(site_definition (block) @class.inside) @class.around From e5f9937c1d960f4643d6a4431ffa5dd396b26d55 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Mon, 30 Jun 2025 10:45:47 -0500 Subject: [PATCH 17/20] docs: escape pipe in typeable command name (#13869) --- book/src/generated/typable-cmd.md | 2 +- xtask/src/docgen.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/book/src/generated/typable-cmd.md b/book/src/generated/typable-cmd.md index 219f6b95f..e416e813f 100644 --- a/book/src/generated/typable-cmd.md +++ b/book/src/generated/typable-cmd.md @@ -78,7 +78,7 @@ | `:log-open` | Open the helix log file. | | `: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`, `:\|` | 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 | | `:reset-diff-change`, `:diffget`, `:diffg` | Reset the diff change at the cursor position. | diff --git a/xtask/src/docgen.rs b/xtask/src/docgen.rs index d31c396df..79ecfea12 100644 --- a/xtask/src/docgen.rs +++ b/xtask/src/docgen.rs @@ -36,7 +36,8 @@ pub fn typable_commands() -> Result { "Description".to_owned(), ])); - let cmdify = |s: &str| format!("`:{}`", s); + // escape | so it doesn't get rendered as a column separator + let cmdify = |s: &str| format!("`:{}`", s.replace('|', "\\|")); for cmd in TYPABLE_COMMAND_LIST { let names = std::iter::once(&cmd.name) From 0043c16506f1c76f7b1c860a04608549d7827fab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 17:06:54 +0900 Subject: [PATCH 18/20] build(deps): bump indexmap in the rust-dependencies group (#13872) Bumps the rust-dependencies group with 1 update: [indexmap](https://github.com/indexmap-rs/indexmap). Updates `indexmap` from 2.9.0 to 2.10.0 - [Changelog](https://github.com/indexmap-rs/indexmap/blob/main/RELEASES.md) - [Commits](https://github.com/indexmap-rs/indexmap/compare/2.9.0...2.10.0) --- updated-dependencies: - dependency-name: indexmap dependency-version: 2.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rust-dependencies ... 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 d775ff1ed..5201e2435 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1864,9 +1864,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown 0.15.4", diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index cf3c4b475..5e4367f00 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -61,7 +61,7 @@ tokio-stream = "0.1" futures-util = { version = "0.3", features = ["std", "async-await"], default-features = false } arc-swap = { version = "1.7.1" } termini = "1" -indexmap = "2.9" +indexmap = "2.10" # Logging fern = "0.7" From 6081a5df81b5e85cf8b91798d601595a11ce26ec Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 1 Jul 2025 09:40:40 -0400 Subject: [PATCH 19/20] queries: Fix precedence of Fennel highlights --- runtime/queries/fennel/highlights.scm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/queries/fennel/highlights.scm b/runtime/queries/fennel/highlights.scm index fe90279ae..384e0349f 100644 --- a/runtime/queries/fennel/highlights.scm +++ b/runtime/queries/fennel/highlights.scm @@ -1,6 +1,11 @@ ; Most primitive nodes (shebang) @keyword.directive +[ + (symbol) + (symbol_binding) +] @variable + (comment) @comment (fn_form @@ -186,8 +191,3 @@ (string) (string_binding) ] @string - -[ - (symbol) - (symbol_binding) -] @variable From 6a090471a800b1001bdfd2b6e0b710c1cd439a4e Mon Sep 17 00:00:00 2001 From: Tino <89810988+ymcx@users.noreply.github.com> Date: Tue, 1 Jul 2025 17:06:54 +0300 Subject: [PATCH 20/20] Fix panic in `goto_word` when `editor.jump-label-alphabet` is empty (#13863) --- helix-term/src/commands.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 2cbdeb451..38e52e18c 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -6728,6 +6728,10 @@ fn jump_to_word(cx: &mut Context, behaviour: Movement) { // Calculate the jump candidates: ranges for any visible words with two or // more characters. let alphabet = &cx.editor.config().jump_label_alphabet; + if alphabet.is_empty() { + return; + } + let jump_label_limit = alphabet.len() * alphabet.len(); let mut words = Vec::with_capacity(jump_label_limit); let (view, doc) = current_ref!(cx.editor);