1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Map ranges and stuff correctly.

This commit is contained in:
Rob Rix 2015-10-23 21:19:37 -04:00
parent 865dbe2eed
commit c01624abe9

View File

@ -91,10 +91,12 @@
/// Diff -> String -> String -> DOM /// Diff -> String -> String -> DOM
function diffToDOM(diff, which, source) { function diffToDOM(diff, which, source) {
return rangeAndSyntaxToDOM(diff.roll.extract[which], diff.roll.unwrap, source, function(diff) { if (diff.pure != null) { return diff.pure; }
function getRange(diff) {
if (diff.pure != null) { return diff.pure["data-range"]; } if (diff.pure != null) { return diff.pure["data-range"]; }
if (diff.roll != null) { return diff.roll.extract[which]; } if (diff.roll != null) { return diff.roll.extract[which]; }
}, function(diff) { return diffToDOM(diff, which, source); }) }
return rangeAndSyntaxToDOM(getRange(diff), diff.roll.unwrap, source, getRange, function(diff) { return diffToDOM(diff, which, source); })
} }
/// Range -> Syntax a -> String -> (a -> Range) -> (a -> DOM) -> DOM /// Range -> Syntax a -> String -> (a -> Range) -> (a -> DOM) -> DOM