summaryrefslogtreecommitdiff
path: root/lib/prado/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-04-12 15:20:17 +0200
committeremkael <emkael@tlen.pl>2016-04-12 15:21:54 +0200
commit23ef7357b6fe8b104f196f4ebf1e9d3b960deb95 (patch)
tree2de3944f9fa2d03cf74475407e0e7647408bee26 /lib/prado/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer
parent45f4f865a4d332d579023f2723b0dd981bcd3659 (diff)
* Prado upgrade to 3.3.r51702c7564454b18232e19fa9ca0d05ed33c4b3c
Diffstat (limited to 'lib/prado/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer')
-rw-r--r--lib/prado/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/prado/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php b/lib/prado/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php
index 88d1376..1f4ec07 100644
--- a/lib/prado/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php
+++ b/lib/prado/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php
@@ -179,7 +179,13 @@ class Text_Highlighter_Renderer_Console extends Text_Highlighter_Renderer
$nlines = substr_count($this->_output, "\n") + 1;
$len = strlen($nlines);
$i = 1;
- $this->_output = preg_replace('~^~em', '" " . str_pad($i++, $len, " ", STR_PAD_LEFT) . ": "', $this->_output);
+ $this->_output = preg_replace_callback(
+ '~^~m',
+ function($matches) use(&$i, $len) {
+ return " " . str_pad($i++, $len, " ", STR_PAD_LEFT) . ": ";
+ },
+ $this->_output
+ );
}
$this->_output .= HL_CONSOLE_DEFCOLOR . "\n";
}