summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/command_manager.cc4
-rw-r--r--test/regression/0-comment-after-command/cmd1
-rw-r--r--test/regression/0-comment-after-command/in1
-rw-r--r--test/regression/0-comment-after-command/out1
-rw-r--r--test/regression/0-comment-after-command/rc5
5 files changed, 10 insertions, 2 deletions
diff --git a/src/command_manager.cc b/src/command_manager.cc
index 2af06c76..e2294b37 100644
--- a/src/command_manager.cc
+++ b/src/command_manager.cc
@@ -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;
diff --git a/test/regression/0-comment-after-command/cmd b/test/regression/0-comment-after-command/cmd
new file mode 100644
index 00000000..ec7cb854
--- /dev/null
+++ b/test/regression/0-comment-after-command/cmd
@@ -0,0 +1 @@
+:my-command<ret>
diff --git a/test/regression/0-comment-after-command/in b/test/regression/0-comment-after-command/in
new file mode 100644
index 00000000..8b137891
--- /dev/null
+++ b/test/regression/0-comment-after-command/in
@@ -0,0 +1 @@
+
diff --git a/test/regression/0-comment-after-command/out b/test/regression/0-comment-after-command/out
new file mode 100644
index 00000000..257cc564
--- /dev/null
+++ b/test/regression/0-comment-after-command/out
@@ -0,0 +1 @@
+foo
diff --git a/test/regression/0-comment-after-command/rc b/test/regression/0-comment-after-command/rc
new file mode 100644
index 00000000..96606f44
--- /dev/null
+++ b/test/regression/0-comment-after-command/rc
@@ -0,0 +1,5 @@
+def my-command %{
+ buffer-next # go to next
+ %sh{ echo buffer-previous }
+ exec ifoo<esc>
+}