Fix command parsing bug when commenting after a command

When a comment was present directly on the same line after a command,
we did not correctly see the command as terminated and would join
continue parsing the next line.
This commit is contained in:
Maxime Coste 2017-05-25 08:30:49 +01:00
parent 3e4e4f6210
commit f014eb7052
5 changed files with 10 additions and 2 deletions

View File

@ -193,8 +193,8 @@ void skip_blanks_and_comments(Reader& reader)
++(++reader);
else if (c == '#')
{
for (bool eol = false; reader and not eol; ++reader)
eol = *reader == '\n';
while (reader and *reader != '\n')
++reader;
}
else
break;

View File

@ -0,0 +1 @@
:my-command<ret>

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@
foo

View File

@ -0,0 +1,5 @@
def my-command %{
buffer-next # go to next
%sh{ echo buffer-previous }
exec ifoo<esc>
}