From c5982caa2e7089b1ace770dab8da1de167fa2f94 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Sun, 23 Jan 2011 16:50:04 +0800 Subject: InlineWordLevelDiff regex should be /xsu - FS#2142 --- inc/DifferenceEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/DifferenceEngine.php') diff --git a/inc/DifferenceEngine.php b/inc/DifferenceEngine.php index dd096a55a..1e1d4c3a3 100644 --- a/inc/DifferenceEngine.php +++ b/inc/DifferenceEngine.php @@ -932,7 +932,7 @@ class InlineWordLevelDiff extends MappedDiff { } function _split($lines) { - if (!preg_match_all('/ ( [^\S\n]+ | [0-9_A-Za-z\x80-\xff]+ | . ) (?: (?!< \n) [^\S\n])? /xs', + if (!preg_match_all('/ ( [^\S\n]+ | [0-9_A-Za-z\x80-\xff]+ | . ) (?: (?!< \n) [^\S\n])? /xsu', implode("\n", $lines), $m)) { return array(array(''), array('')); } -- cgit v1.2.3 From c495dc45dedcf43c372ac75d0f966501950bfb6e Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 31 Jan 2011 13:59:22 +0100 Subject: Added colspan option for the InlineDiffFormatter --- inc/DifferenceEngine.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'inc/DifferenceEngine.php') diff --git a/inc/DifferenceEngine.php b/inc/DifferenceEngine.php index 1e1d4c3a3..36322d222 100644 --- a/inc/DifferenceEngine.php +++ b/inc/DifferenceEngine.php @@ -1087,6 +1087,7 @@ class TableDiffFormatter extends DiffFormatter { * */ class InlineDiffFormatter extends DiffFormatter { + var $colspan = 4; function InlineDiffFormatter() { $this->leading_context_lines = 2; @@ -1113,7 +1114,7 @@ class InlineDiffFormatter extends DiffFormatter { $xbeg .= "," . $xlen; if ($ylen != 1) $ybeg .= "," . $ylen; - $r = '@@ '.$lang['line']." -$xbeg +$ybeg @@"; + $r = '@@ '.$lang['line']." -$xbeg +$ybeg @@"; $r .= ' '.$lang['deleted'].''; $r .= ' '.$lang['created'].''; $r .= "\n"; @@ -1132,19 +1133,19 @@ class InlineDiffFormatter extends DiffFormatter { function _added($lines) { foreach ($lines as $line) { - print(''. $line . "\n"); + print(''. $line . "\n"); } } function _deleted($lines) { foreach ($lines as $line) { - print('' . $line . "\n"); + print('' . $line . "\n"); } } function _context($lines) { foreach ($lines as $line) { - print(''.$line."\n"); + print(''.$line."\n"); } } @@ -1153,7 +1154,7 @@ class InlineDiffFormatter extends DiffFormatter { $add = $diff->inline(); foreach ($add as $line) - print(''.$line."\n"); + print(''.$line."\n"); } } -- cgit v1.2.3 From 4f2305cb147b801ff6ef57ed417a366a83e2d92e Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Sun, 6 Feb 2011 16:49:20 +0100 Subject: Fix whitespace handling in inline diff (closes FS#2161) --- inc/DifferenceEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/DifferenceEngine.php') diff --git a/inc/DifferenceEngine.php b/inc/DifferenceEngine.php index 36322d222..906a17b2d 100644 --- a/inc/DifferenceEngine.php +++ b/inc/DifferenceEngine.php @@ -943,7 +943,7 @@ class InlineWordLevelDiff extends MappedDiff { $orig = new _HWLDF_WordAccumulator; foreach ($this->edits as $edit) { if ($edit->type == 'copy') - $orig->addWords($edit->orig); + $orig->addWords($edit->closing); elseif ($edit->type == 'change'){ $orig->addWords($edit->orig, 'del'); $orig->addWords($edit->closing, 'add'); -- cgit v1.2.3