From 8e9474c6e75dd91cf7391c96a06980d8ca816d49 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowicz Date: Fri, 18 Sep 2015 07:37:06 +0100 Subject: [PATCH] Fixes comment restoring on Windows. Windows line break is two characters long, so we need to take that into account. --- lib/text/comments-processor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/text/comments-processor.js b/lib/text/comments-processor.js index 941fc670..2063b53a 100644 --- a/lib/text/comments-processor.js +++ b/lib/text/comments-processor.js @@ -113,7 +113,7 @@ function restore(context, data, from, isSpecial) { cursor = nextMatch.end; } else { - cursor = nextMatch.end + (context.keepBreaks && data[nextMatch.end] == lineBreak ? 1 : 0); + cursor = nextMatch.end + (context.keepBreaks && data.substring(nextMatch.end, nextMatch.end + lineBreak.length) == lineBreak ? lineBreak.length : 0); } } -- 2.34.1