Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ensure the source is terminated with a newline.

  • Loading branch information...
commit 6cae226b24bcaef515d7481a640f39f2810df61f 1 parent eee670d
@jnthn authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/Debugger/UI/CommandLine.pm
View
5 lib/Debugger/UI/CommandLine.pm
@@ -13,6 +13,11 @@ my class SourceFile {
has @!line_offsets;
method BUILD(:$!filename, :$!source) {
+ # Ensure source ends with a newline.
+ unless $!source ~~ /\n$/ {
+ $!source ~= "\n";
+ }
+
# Store (abbreviated if needed) lines.
@!lines = lines($!source).map(-> $l {
$l.chars > 77 ?? $l.substr(0, 74) ~ '...' !! $l
Please sign in to comment.
Something went wrong with that request. Please try again.