Skip to content

Commit

Permalink
Only format functions when name is followed by an open parenthesis.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilles Darold committed Mar 22, 2017
1 parent de1a7c3 commit ce7ffd0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/pgFormatter/Beautify.pm
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,16 @@ sub html_highlight_code {

for my $k ( sort { length( $b ) <=> length( $a ) } @{ $self->{ 'dict' }->{ 'pg_functions' } } ) {
if ( $self->{ 'uc_functions' } == 1 ) {
$code =~ s/(?<!:)\b$k\b/<span class="kw2_l">$k<\/span>/igs;
$code =~ s/(?<!:)\b$k\s*(/<span class="kw2_l">$k<\/span>(/igs;
}
elsif ( $self->{ 'uc_functions' } == 2 ) {
$code =~ s/(?<!:)\b$k\b/<span class="kw2_u">$k<\/span>/igs;
$code =~ s/(?<!:)\b$k\s*(/<span class="kw2_u">$k<\/span>(/igs;
}
elsif ( $self->{ 'uc_functions' } == 3 ) {
$code =~ s/(?<!:)\b$k\b/<span class="kw2_c">\L$k\E<\/span>/igs;
$code =~ s/(?<!:)\b$k\s*(/<span class="kw2_c">\L$k\E<\/span>(/igs;
}
else {
$code =~ s/(?<!:)\b$k\b/<span class="kw2">$k<\/span>/igs;
$code =~ s/(?<!:)\b$k\s*(/<span class="kw2">$k<\/span>(/igs;
}
}

Expand Down

0 comments on commit ce7ffd0

Please sign in to comment.