|
1 | | -import * as vscode from "vscode" |
2 | | -import {LogInfo} from "./model" |
3 | | -import {Parser, ColorToHex} from './parser' |
| 1 | +import * as vscode from "vscode"; |
| 2 | +import {LogInfo} from "./model"; |
| 3 | +import {Parser, ColorToHex} from "./parser"; |
4 | 4 |
|
5 | 5 | const timestampRE = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{7}Z/; |
6 | 6 |
|
@@ -34,41 +34,41 @@ export function updateDecorations(activeEditor: vscode.TextEditor, logInfo: LogI |
34 | 34 |
|
35 | 35 | for (let lineNo = 0; lineNo < logInfo.updatedLogLines.length; lineNo++) { |
36 | 36 | // .filter() preserves the order of the array |
37 | | - const lineStyles = logInfo.styleFormats.filter(style => style.line == lineNo) |
38 | | - let pos = 0 |
| 37 | + const lineStyles = logInfo.styleFormats.filter(style => style.line == lineNo); |
| 38 | + let pos = 0; |
39 | 39 | for (let styleNo = 0; styleNo < lineStyles.length; styleNo++) { |
40 | | - const style = lineStyles[styleNo] |
41 | | - const endPos = pos + style.content.length |
| 40 | + const style = lineStyles[styleNo]; |
| 41 | + const endPos = pos + style.content.length; |
42 | 42 | const range = new vscode.Range(lineNo, pos, lineNo, endPos); |
43 | | - pos = endPos |
| 43 | + pos = endPos; |
44 | 44 |
|
45 | 45 | if (style.style) { |
46 | | - const key = Parser.styleKey(style.style) |
47 | | - let fgHex = "" |
48 | | - let bgHex = "" |
| 46 | + const key = Parser.styleKey(style.style); |
| 47 | + let fgHex = ""; |
| 48 | + let bgHex = ""; |
49 | 49 |
|
50 | 50 | // Convert to hex colors if RGB-formatted, or use lookup for predefined colors |
51 | 51 | if (style.style.isFgRGB) { |
52 | | - const rgbValues = style.style.fg.split(',') |
| 52 | + const rgbValues = style.style.fg.split(","); |
53 | 53 | if (rgbValues.length == 3) { |
54 | | - fgHex = "#" |
| 54 | + fgHex = "#"; |
55 | 55 | for (let i = 0; i < 3; i++) { |
56 | | - fgHex.concat(parseInt(rgbValues[i]).toString(16)) |
| 56 | + fgHex.concat(parseInt(rgbValues[i]).toString(16)); |
57 | 57 | } |
58 | 58 | } |
59 | 59 | } else { |
60 | | - fgHex = ColorToHex[style.style.fg] |
| 60 | + fgHex = ColorToHex[style.style.fg]; |
61 | 61 | } |
62 | 62 | if (style.style.isBgRGB) { |
63 | | - const rgbValues = style.style.bg.split(',') |
| 63 | + const rgbValues = style.style.bg.split(","); |
64 | 64 | if (rgbValues.length == 3) { |
65 | | - bgHex = "#" |
| 65 | + bgHex = "#"; |
66 | 66 | for (let i = 0; i < 3; i++) { |
67 | | - bgHex.concat(parseInt(rgbValues[i]).toString(16)) |
| 67 | + bgHex.concat(parseInt(rgbValues[i]).toString(16)); |
68 | 68 | } |
69 | 69 | } |
70 | 70 | } else { |
71 | | - bgHex = ColorToHex[style.style.bg] |
| 71 | + bgHex = ColorToHex[style.style.bg]; |
72 | 72 | } |
73 | 73 |
|
74 | 74 | if (!ctypes[key]) { |
|
0 commit comments