Skip to content

Commit ddb88ab

Browse files
exaexachrisbra
authored andcommitted
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]>
1 parent d434f6c commit ddb88ab

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

runtime/syntax/haskell.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
" Language: Haskell
33
" Maintainer: Haskell Cafe mailinglist <[email protected]>
44
" Last Change: 2024 Mar 28 by Enrico Maria De Angelis <[email protected]>
5+
" 2025 Nov 20 by Vim Project: Allow spaces in backticks #18776
56
" Original Author: John Williams <[email protected]>
67
"
78
" 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=@
4647
" others are variables (e.g. functions).
4748
syn match hsVarSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[-!#$%&\*\+/<=>\?@\\^|~.][-!#$%&\*\+/<=>\?@\\^|~:.]*"
4849
syn match hsConSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=:[-!#$%&\*\+./<=>\?@\\^|~:]*"
49-
syn match hsVarSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[a-z][a-zA-Z0-9_']*`"
50-
syn match hsConSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[A-Z][a-zA-Z0-9_']*`"
50+
syn match hsVarSym "` *\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[a-z][a-zA-Z0-9_']* *`"
51+
syn match hsConSym "` *\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[A-Z][a-zA-Z0-9_']* *`"
5152

5253
" (Non-qualified) identifiers which start with # are labels
5354
syn match hsLabel "#[a-z][a-zA-Z0-9_']*\>"

0 commit comments

Comments
 (0)