🚨 Format code
This commit is contained in:
@@ -46,7 +46,7 @@ export type Options = {
|
||||
const Config = Facet.define<MinimapConfig | null, Required<Options>>({
|
||||
combine: (c) => {
|
||||
const configs: Array<Options> = [];
|
||||
for (let config of c) {
|
||||
for (const config of c) {
|
||||
if (!config) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -24,4 +24,4 @@ function drawLineGutter(gutter: Record<Line, Color>, ctx: DrawContext, lineNumbe
|
||||
}
|
||||
|
||||
|
||||
export { GUTTER_WIDTH, drawLineGutter }
|
||||
export { GUTTER_WIDTH, drawLineGutter };
|
||||
@@ -218,7 +218,7 @@ const minimapClass = ViewPlugin.fromClass(
|
||||
/* Small leading buffer */
|
||||
drawContext.offsetX += 2;
|
||||
|
||||
for (let gutter of gutters) {
|
||||
for (const gutter of gutters) {
|
||||
drawLineGutter(gutter, drawContext, i + 1);
|
||||
drawContext.offsetX += GUTTER_WIDTH;
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ function computeLinesState(state: EditorState): Lines {
|
||||
|
||||
while (!lineCursor.done) {
|
||||
const lineText = lineCursor.value;
|
||||
let from = textOffset;
|
||||
let to = from + lineText.length;
|
||||
const from = textOffset;
|
||||
const to = from + lineText.length;
|
||||
|
||||
// Iterate through folded ranges until we're at or past the current line
|
||||
while (foldedRangeCursor.value && foldedRangeCursor.to < from) {
|
||||
@@ -34,8 +34,8 @@ function computeLinesState(state: EditorState): Lines {
|
||||
const lineEndsInFold = to > foldFrom && to <= foldTo;
|
||||
|
||||
if (lineStartInFold) {
|
||||
let lastLine = lines.pop() ?? [];
|
||||
let lastRange = lastLine.pop();
|
||||
const lastLine = lines.pop() ?? [];
|
||||
const lastRange = lastLine.pop();
|
||||
|
||||
// If the last range is folded, we extend the folded range
|
||||
if (lastRange && lastRange.folded) {
|
||||
|
||||
@@ -144,7 +144,7 @@ export class SelectionState extends LineBasedState<Array<Selection>> {
|
||||
}
|
||||
|
||||
public drawLine(ctx: DrawContext, lineNumber: number) {
|
||||
let {
|
||||
const {
|
||||
context,
|
||||
lineHeight,
|
||||
charWidth,
|
||||
|
||||
Reference in New Issue
Block a user