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:
parent
3e4e4f6210
commit
f014eb7052
|
@ -193,8 +193,8 @@ void skip_blanks_and_comments(Reader& reader)
|
||||||
++(++reader);
|
++(++reader);
|
||||||
else if (c == '#')
|
else if (c == '#')
|
||||||
{
|
{
|
||||||
for (bool eol = false; reader and not eol; ++reader)
|
while (reader and *reader != '\n')
|
||||||
eol = *reader == '\n';
|
++reader;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
|
1
test/regression/0-comment-after-command/cmd
Normal file
1
test/regression/0-comment-after-command/cmd
Normal file
|
@ -0,0 +1 @@
|
||||||
|
:my-command<ret>
|
1
test/regression/0-comment-after-command/in
Normal file
1
test/regression/0-comment-after-command/in
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
1
test/regression/0-comment-after-command/out
Normal file
1
test/regression/0-comment-after-command/out
Normal file
|
@ -0,0 +1 @@
|
||||||
|
foo
|
5
test/regression/0-comment-after-command/rc
Normal file
5
test/regression/0-comment-after-command/rc
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
def my-command %{
|
||||||
|
buffer-next # go to next
|
||||||
|
%sh{ echo buffer-previous }
|
||||||
|
exec ifoo<esc>
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user