jonas/tig — Issue #32: Diff preview colors lines wrong
Author: ravinggenius
Created: 2012-02-17 15:30:07+00:00
State: open

A regression seems to have been introduced in version 0.18 (confirmed not present in version 0.17). In version 0.17 tig colors this diff correctly; but in version 0.18, tig colors the first line of the diff red as if it were a deletion, though it really was not. (I am referring to the line containing ` - result = render ...`. Please note the space followed by the dash.)

```
Author: Raving Genius
AuthorDate: Thu Feb 16 16:12:51 2012 -0500
Commit: Raving Genius
CommitDate: Thu Feb 16 16:12:51 2012 -0500

General code cleanup
---
app/views/admin/line_items/top_off_bundle.js.haml | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/views/admin/line_items/top_off_bundle.js.haml b/app/views/admin/line_items/top_off_bundle.js.haml
index c481dac..0171722 100644
--- a/app/views/admin/line_items/top_off_bundle.js.haml
+++ b/app/views/admin/line_items/top_off_bundle.js.haml
@@ -2,10 +2,10 @@
- result = render 'admin/customers/order', :order => @order
:plain
var formatMoney = function (num) {
- var p = num.toFixed(2).split(".");
- return "$" + p[0].split("").reverse().reduce(function(acc, num, i, orig) {
- return num + (i && !(i % 3) ? "," : "") + acc;
- }, "") + "." + p[1];
+ var p = num.toFixed(2).split('.');
+ return '$' + p[0].split('').reverse().reduce(function (acc, num, i, orig) {
+ return num + (i && !(i % 3) ? ',' : '') + acc;
+ }, '') + '.' + p[1];
};

$('#order_tab').html("#{j result}");
```