From 56dedd10a77278398e4f44e3b5d1c1a7dba89895 Mon Sep 17 00:00:00 2001 From: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com> Date: Mon, 3 Feb 2025 13:48:44 +0000 Subject: [PATCH] fix: add `regex` to ignored layer configs --- helix-core/src/syntax.rs | 7 +++---- languages.toml | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs index 11201b26b..4a6ad7576 100644 --- a/helix-core/src/syntax.rs +++ b/helix-core/src/syntax.rs @@ -1449,14 +1449,13 @@ impl Syntax { if is_encompassing { let this_gap = ts_range.end_byte - ts_range.start_byte; if this_gap < min_gap - // ignore the "comment" language family - // as that would mean we can't uncomment anything, or - // the comments would be incorrect. + // ignore the language family for which it won't make + // sense to consider their comment. // // Since uncommenting would attempt to use the comment // language's non-existing comment tokens // TODO: add this as a language configuration key? - && !matches!(self.layer_config(layer_id).language_name.as_ref(), "jsdoc" | "comment") + && !matches!(self.layer_config(layer_id).language_name.as_ref(), "jsdoc" | "comment" | "regex") { best_fit = Some(layer_id); min_gap = this_gap; diff --git a/languages.toml b/languages.toml index 072e25304..7b1ebd2e0 100644 --- a/languages.toml +++ b/languages.toml @@ -1355,8 +1355,7 @@ scope = "source.svelte" injection-regex = "svelte" file-types = ["svelte"] indent = { tab-width = 2, unit = " " } -comment-token = "//" -block-comment-tokens = { start = "/*", end = "*/" } +block-comment-tokens = { start = "" } language-servers = [ "svelteserver" ] [[grammar]]