From 92fc03349b7bd74c9f3445b8816a107d4906f5b1 Mon Sep 17 00:00:00 2001 From: Joe Reynolds Date: Thu, 31 May 2018 21:02:14 +0100 Subject: [PATCH] Add 1 to linecount --- dist/src/selectors.js | 2 +- dist/src/selectors.js.map | 2 +- src/selectors.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/src/selectors.js b/dist/src/selectors.js index fe69267..f7cab0b 100644 --- a/dist/src/selectors.js +++ b/dist/src/selectors.js @@ -111,7 +111,7 @@ class Selectors { // We have two divide by 2 because for some reason // The file is twice the line count of the original // file, TODO - Fix this. - const lineCount = Math.floor((i - index) / 2); + const lineCount = Math.floor((i - index) / 2) + 1; return lineCount; } } diff --git a/dist/src/selectors.js.map b/dist/src/selectors.js.map index 1377d1c..b9faad2 100644 --- a/dist/src/selectors.js.map +++ b/dist/src/selectors.js.map @@ -1 +1 @@ -{"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../src/selectors.ts"],"names":[],"mappings":";;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAI5C,yCAAqC;AAErC;IAEW,QAAQ,CAAC,IAAY;QACxB,MAAM,YAAY,GAAW,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC3D,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;QACjE,OAAO,SAAS,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACI,OAAO,CAAC,SAAmB;QAC9B,MAAM,YAAY,GAAe,EAAE,CAAC;QAEpC,iEAAiE;QACjE,WAAW;QACX,MAAM,qBAAqB,GAAa,EAAE,CAAC;QAC3C,oDAAoD;QACpD,oDAAoD;QACpD,cAAc;QACd,4BAA4B;QAC5B,sBAAsB;QACtB,IAAI;QACJ,qBAAqB;QACrB,oBA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AC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IACjD,CAAC;IAEO,uBAAuB,CAAC,SAAmB,EAAE,KAAa;QAC9D,wEAAwE;QACxE,gCAAgC;QAChC,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC3C,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;gBAC5B,kDAAkD;gBAClD,mDAAmD;gBACnD,yBAAyB;gBACzB,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;gBAClD,OAAO,SAAS,CAAC;aACpB;SACJ;IAEL,CAAC;CACJ;AAEQ,8BAAS"} \ No newline at end of file diff --git a/src/selectors.ts b/src/selectors.ts index c9a315e..7100a6f 100644 --- a/src/selectors.ts +++ b/src/selectors.ts @@ -130,7 +130,7 @@ class Selectors { // We have two divide by 2 because for some reason // The file is twice the line count of the original // file, TODO - Fix this. - const lineCount = Math.floor((i - index) / 2); + const lineCount = Math.floor((i - index) / 2) + 1; return lineCount; } }