summaryrefslogtreecommitdiff
path: root/src/vim9class.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-12-20 13:38:22 +0000
committerBram Moolenaar <Bram@vim.org>2022-12-20 13:38:22 +0000
commit418b54788106efd94bbc71a4b100afae1080cbfc (patch)
treecf6adaa37e7d2727993fcdf0e6142b0a4ebc1737 /src/vim9class.c
parent104b2ff4d0ec9248ba0b979aa3bbccb65fcad422 (diff)
downloadvim-git-418b54788106efd94bbc71a4b100afae1080cbfc.tar.gz
patch 9.0.1083: empty and comment lines in a class cause an errorv9.0.1083
Problem: Empty and comment lines in a class cause an error. Solution: Skip empty and comment lines. (closes #11734)
Diffstat (limited to 'src/vim9class.c')
-rw-r--r--src/vim9class.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vim9class.c b/src/vim9class.c
index a91a4a5d5..94fe9e227 100644
--- a/src/vim9class.c
+++ b/src/vim9class.c
@@ -248,6 +248,16 @@ ex_class(exarg_T *eap)
break;
char_u *line = skipwhite(theline);
+ // Skip empty and comment lines.
+ if (*line == NUL)
+ continue;
+ if (*line == '#')
+ {
+ if (vim9_bad_comment(line))
+ break;
+ continue;
+ }
+
char_u *p = line;
if (checkforcmd(&p, "endclass", 4))
{