diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-01-26 17:21:43 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-01-26 17:21:43 -0400 |
commit | 41b77f88f1dd8f15674b3c03a1932c26b2e8baac (patch) | |
tree | 67604aa2fa6748894a97aefec9aece7294e3380b /src/util/sugar.js | |
parent | 16286da93ad64ab3d944d02bb9faa7a7310e0ce1 (diff) |
sugar: iterateMultiline: don't colorize where
Diffstat (limited to 'src/util/sugar.js')
-rw-r--r-- | src/util/sugar.js | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/util/sugar.js b/src/util/sugar.js index 7dd173a0..90d47b7c 100644 --- a/src/util/sugar.js +++ b/src/util/sugar.js @@ -6,8 +6,6 @@ // It will likely only do exactly what I want it to, and only in the cases I // decided were relevant enough to 8other handling. -import {colors} from './cli.js'; - // Apparently JavaScript doesn't come with a function to split an array into // chunks! Weird. Anyway, this is an awesome place to use a generator, even // though we don't really make use of the 8enefits of generators any time we @@ -461,14 +459,12 @@ export function* iterateMultiline(content, iterator, { const columnNumber = index - startOfLine; - let where = null; - if (formatWhere) { - where = - colors.yellow( - (isMultiline - ? `line: ${lineNumber + 1}, col: ${columnNumber + 1}` - : `pos: ${index + 1}`)); - } + const where = + (formatWhere && isMultiline + ? `line: ${lineNumber + 1}, col: ${columnNumber + 1}` + : formatWhere + ? `pos: ${index + 1}` + : null); countLineBreaks(index, length); |