From 712226b4c61fe644d711aa5af5ed60182311f3e0 Mon Sep 17 00:00:00 2001 From: thacuber2a03 <70547062+thacuber2a03@users.noreply.github.com> Date: Wed, 5 Feb 2025 00:32:49 -0400 Subject: [PATCH] rc/filetype/lua.kak: fix indent/insert hooks not working when local is prepended to function --- rc/filetype/lua.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/filetype/lua.kak b/rc/filetype/lua.kak index 148db983fe..070ac00584 100644 --- a/rc/filetype/lua.kak +++ b/rc/filetype/lua.kak @@ -118,7 +118,7 @@ define-command -hidden lua-indent-on-new-line %[ , Kx \ \A\h*-- \ \A[^\n]*\b(end|until)\b \ - \A(\h*\b(do|else|elseif|for|function|if|repeat|while)\b|[^\n]*[({]$|[^\n]*\bfunction\b\h*[(]) \ + \A(\h*\b(do|else|elseif|for|(local\h+)?function|if|repeat|while)\b|[^\n]*[({]$|[^\n]*\bfunction\b\h*[(]) \ ] ] @@ -136,7 +136,7 @@ define-command -hidden lua-insert-on-new-line %[ # check that starts with a block keyword that is not closed on the same line execute-keys -draft \ kx \ - ^\h*\b(else|elseif|do|for|function|if|while)\b|[^\n]\bfunction\b\h*[(] \ + ^\h*\b(else|elseif|do|for|(local\h+)?function|if|while)\b|[^\n]\bfunction\b\h*[(] \ \bend\b # check that the block is empty and is not closed on a different line execute-keys -draft i ^[^\n]+\n[^\n]+\n jx ^x\b(else|elseif|end)\b