From 066fdbe3775fb1e69282df4e9ea2914dc107b249 Mon Sep 17 00:00:00 2001 From: Carman Fu <96031125+Futarimiti@users.noreply.github.com> Date: Sun, 4 Aug 2024 16:25:44 +0800 Subject: [PATCH] allow spaces between `\` and `case` in lambda case expressions It is syntactically permitted to insert spaces between `\` and `case` in a lambda case expression e.g. `\ case x -> ...`. Fix pattern to match these --- indent/haskell.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indent/haskell.vim b/indent/haskell.vim index 54f244a..bdbe92d 100644 --- a/indent/haskell.vim +++ b/indent/haskell.vim @@ -2,7 +2,7 @@ " Filename: indent/haskell.vim " Author: itchyny " License: MIT License -" Last Change: 2023/11/07 19:40:39. +" Last Change: 2024/08/04 16:24:02. " ============================================================================= if exists('b:did_indent') @@ -174,7 +174,7 @@ function! GetHaskellIndent() abort endif endif - if line =~# '\v\\case\s*%(--.*)?$' + if line =~# '\v\\\s*\s*%(--.*)?$' return match(line, '\v^\s*%(|.*)?\s*\zs') + &shiftwidth endif