Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim: support new ":def" functions of vim9 #2590

Merged
merged 2 commits into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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