diff --git a/autotests/folding/highlight.lua.fold b/autotests/folding/highlight.lua.fold
--- a/autotests/folding/highlight.lua.fold
+++ b/autotests/folding/highlight.lua.fold
@@ -158,3 +158,14 @@
--! \brief gfind is deprecated
string.gfind('s')
string.gmatch('f')
+
+function foo()
+ if x then
+ function() end
+ bar=function()
+ if y then
+ if z then end
+ end
+ end
+ end
+end
diff --git a/autotests/html/highlight.lua.html b/autotests/html/highlight.lua.html
--- a/autotests/html/highlight.lua.html
+++ b/autotests/html/highlight.lua.html
@@ -164,4 +164,15 @@
--! \brief gfind is deprecated
string.gfind('s')
string.gmatch('f')
+
+function foo()
+ if x then
+ function() end
+ bar=function()
+ if y then
+ if z then end
+ end
+ end
+ end
+end