Skip to content

Commit

Permalink
Item14710: fixed changes not displayed sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Jun 11, 2018
1 parent d483bdf commit d8665dd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions data/System/DiffPlugin.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1515501688" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1528716796" format="1.1" version="1"}%
---+!! %TOPIC%
%FORMFIELD{"Description"}%

Expand Down Expand Up @@ -98,8 +98,9 @@ scripts with a call to =diff=.

---++ Change History
%TABLE{columnwidths="7em" tablewidth="100%"}%
| 09 Jan 2018 | throw an access exception instead of showing an inline error diffing revisions |
| 01 Jun 2016 | initial release |
| 11 Jun 2018 | fix changes not displayed under certain conditions |
| 09 Jan 2018 | throw an access exception instead of showing an inline error diffing revisions |
| 01 Jun 2016 | initial release |

%META:FORM{name="PackageForm"}%
%META:FIELD{name="Author" title="Author" value="Michael Daum"}%
Expand All @@ -111,4 +112,4 @@ scripts with a call to =diff=.
%META:FIELD{name="License" title="License" value="GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]])"}%
%META:FIELD{name="Home" title="Home" value="https://foswiki.org/Extensions/%25$ROOTMODULE%25"}%
%META:FIELD{name="Support" title="Support" value="https://foswiki.org/Support/%25$ROOTMODULE%25"}%
%META:FILEATTACHMENT{name="DiffScreenshot.png" attachment="DiffScreenshot.png" attr="" comment="" date="1515501688" size="112670" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="DiffScreenshot.png" attachment="DiffScreenshot.png" attr="" comment="" date="1528716796" size="112670" user="ProjectContributor" version="1"}%
4 changes: 2 additions & 2 deletions lib/Foswiki/Plugins/DiffPlugin.pm
Expand Up @@ -21,8 +21,8 @@ use warnings;
use Foswiki::Func ();
#use Foswiki::Plugins::DiffPlugin::Core(); # only enable during development of DiffPlugin

our $VERSION = '1.01';
our $RELEASE = '09 Jan 2018';
our $VERSION = '1.02';
our $RELEASE = '11 Jun 2018';
our $SHORTDESCRIPTION = 'Compare difference between topics and revisions';
our $NO_PREFS_IN_TOPIC = 1;
our $core;
Expand Down
5 changes: 3 additions & 2 deletions lib/Foswiki/Plugins/DiffPlugin/Core.pm
Expand Up @@ -400,6 +400,7 @@ sub _diffType {
$action = 'changed';
($old, $new) = _diffLine($oldVal, $newVal);
next if $old eq $new;

} else {
$action = 'removed';
$old = _formatDiff([['-', $oldVal]]);
Expand Down Expand Up @@ -476,8 +477,8 @@ sub _formatDiff {
sub _diffLine {
my ($old, $new, $split) = @_;

return ("", "") unless $old && $new;

$old //= "";
$new //= "";
$split ||= '';

my @seq1 = map {_entityEncode($_)} split /$split/, $old;
Expand Down

0 comments on commit d8665dd

Please sign in to comment.