Closed steveRoll-git closed 3 years ago
@steveRoll-git, good catch; thank you for the report!
The following patch fixes the issue for me:
diff --git a/lualibs/lua_parser_loose.lua b/lualibs/lua_parser_loose.lua
index abf6ce32..432f2149 100644
--- a/lualibs/lua_parser_loose.lua
+++ b/lualibs/lua_parser_loose.lua
@@ -82,7 +82,7 @@ function PARSE.parse_scope(lx, f, level)
-- Detect end of previous statement
if c.tag == 'Eof' -- trigger 'Statement' at the end of file
or c.tag == 'Keyword' and (
- c[1] == 'break' or c[1] == 'goto' or c[1] == 'do' or c[1] == 'while' or c[1] == 'else' or
+ c[1] == 'break' or c[1] == 'goto' or c[1] == 'do' or c[1] == 'while' or c[1] == 'else' or c[1] == 'elseif' or
c[1] == 'repeat' or c[1] == 'if' or c[1] == 'for' or c[1] == 'function' and lx:peek().tag == 'Id' or
c[1] == 'local' or c[1] == ';' or c[1] == 'until' or c[1] == 'return' or c[1] == 'end')
or c.tag == 'Id' and
Yes, it fixed it for me too.
The outline doesn't close a function when there's an
elseif
keyword right after arepeat until
block. For example, this code:will cause the outline to look like this:![image](https://user-images.githubusercontent.com/40004112/98158537-bd767a80-1ee3-11eb-9a36-2b951480abe1.png)
(By the way, this is similar to #946 which I also reported a while back. There could be more keywords that cause this)