runtime(haskell): allow spaces in backticked operators in syntax script
Commit:
https://github.com/vim/vim/commit/ddb88ab796bfb31267767c206684b3dd7ef0d040
Author: Mirek Kratochvil <[email protected]>
Date: Thu Nov 20 20:47:01 2025 +0000
runtime(haskell): allow spaces in backticked operators in syntax script
This formatting (although rare) is actually accepted by GHC, but vim
does not highlight it. This patch adds the simplest possible regex to
support the behavior.
Inconveniently, this might trigger weird formatting on lines that
contain errors, e.g. if the first backtick is removed from:
a `b` c `d` e
then `c` is going to be marked as an operator, which seems weird but is
valid.
closes: #18776
Signed-off-by: Mirek Kratochvil <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/syntax/haskell.vim b/runtime/syntax/haskell.vim
index 509aa2512..e71e1c807 100644
--- a/runtime/syntax/haskell.vim
+++ b/runtime/syntax/haskell.vim
@@ -2,6 +2,7 @@
" Language: Haskell
" Maintainer: Haskell Cafe mailinglist <[email protected]>
" Last Change: 2024 Mar 28 by Enrico Maria De Angelis
<[email protected]>
+" 2025 Nov 20 by Vim Project: Allow spaces in backticks
#18776
" Original Author: John Williams <[email protected]>
"
" Thanks to Ryan Crumley for suggestions and John Meacham for
@@ -46,8 +47,8 @@ syn match VarId
"\(\<[A-Z][a-zA-Z0-9_']*\.\)*\<[a-z][a-zA-Z0-9_']*\>" contains=@
" others are variables (e.g. functions).
syn match hsVarSym
"\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[-!#$%&\*\+/<=>\?@\^|~.][-!#$%&\*\+/<=>\?@\^|~:.]*"
syn match hsConSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=:[-!#$%&\*\+./<=>\?@\^|~:]*"
-syn match hsVarSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[a-z][a-zA-Z0-9_']*`"
-syn match hsConSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[A-Z][a-zA-Z0-9_']*`"
+syn match hsVarSym "` *\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[a-z][a-zA-Z0-9_']* *`"
+syn match hsConSym "` *\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[A-Z][a-zA-Z0-9_']* *`"
" (Non-qualified) identifiers which start with # are labels
syn match hsLabel "#[a-z][a-zA-Z0-9_']*\>"
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1vMBl6-00D88i-2L%40256bit.org.