@nitra/cursor 1.35.4 → 1.35.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -187,8 +187,10 @@ function findOffendersInBody(body) {
|
|
|
187
187
|
*/
|
|
188
188
|
function computeLineOffsets(body) {
|
|
189
189
|
const offsets = [0]
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
let pos = 0
|
|
191
|
+
for (const ch of body) {
|
|
192
|
+
if (ch === '\n') offsets.push(pos + 1)
|
|
193
|
+
pos += 1
|
|
192
194
|
}
|
|
193
195
|
return offsets
|
|
194
196
|
}
|