Skip to content

Commit

Permalink
Merge pull request #22 from raiph/patch-5
Browse files Browse the repository at this point in the history
Speedup display of regex match
  • Loading branch information
jnthn committed Apr 30, 2014
2 parents 4230f5b + 6d6fb6b commit e9cc44e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Debugger/UI/CommandLine.pm
Expand Up @@ -131,8 +131,10 @@ my class SourceFile {
if $cur ~~ Cursor {
my $pos = $cur.pos;
my $str = $cur.target;
my $before = $str.substr(0, $pos).subst(/\n/, '\n', :g).subst(/\t/, '\t', :g);
my $after = $str.substr($pos).subst(/\n/, '\n', :g).subst(/\t/, '\t', :g);
my $bfrom = [max] 0, $pos - 77;
my $blen = [min] 77, $pos;
my $before = $str.substr($bfrom, $blen).subst(/\n/, '\n', :g).subst(/\t/, '\t', :g);
my $after = $str.substr($pos, 144).subst(/\n/, '\n', :g).subst(/\t/, '\t', :g);
if $before.chars + $after.chars > 77 {
if $after.chars > 43 {
$after = $after.substr(0, 40) ~ '...';
Expand Down

0 comments on commit e9cc44e

Please sign in to comment.