Skip to content

Commit

Permalink
vim: support new ":def" functions of vim9 (#2590)
Browse files Browse the repository at this point in the history
(@masatake added the expected.tags file.)
  • Loading branch information
lacygoill committed Jul 8, 2020
1 parent edfd087 commit 81a8999
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Units/parser-vim.r/vim9-def-function.d/expected.tags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Func input.vim /^def Func()$/;" f
2 changes: 2 additions & 0 deletions Units/parser-vim.r/vim9-def-function.d/input.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def Func()
enddef
4 changes: 2 additions & 2 deletions parsers/vim.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ static void parseFunction (const unsigned char *line)
/* TODO - update struct to indicate inside function */
while ((line = readVimLine ()) != NULL)
{
if (wordMatchLen (line, "endfunction", 4))
if (wordMatchLen (line, "endfunction", 4) || wordMatchLen (line, "enddef", 6))
{
tagEntryInfo *e = getEntryInCorkQueue (index);
if (e)
Expand Down Expand Up @@ -584,7 +584,7 @@ static bool parseVimLine (const unsigned char *line, int infunction)
parseMap (skipWord (line));
}

else if (wordMatchLen (line, "function", 2))
else if (wordMatchLen (line, "function", 2) || wordMatchLen (line, "def", 3))
{
parseFunction (skipWord (line));
}
Expand Down

0 comments on commit 81a8999

Please sign in to comment.