🚨 Format code

This commit is contained in:
2025-09-24 21:44:42 +08:00
parent 1462d8a753
commit f5bfff80b7
76 changed files with 839 additions and 863 deletions

View File

@@ -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;
}

View File

@@ -24,4 +24,4 @@ function drawLineGutter(gutter: Record<Line, Color>, ctx: DrawContext, lineNumbe
}
export { GUTTER_WIDTH, drawLineGutter }
export { GUTTER_WIDTH, drawLineGutter };

View File

@@ -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;
}

View File

@@ -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) {

View File

@@ -144,7 +144,7 @@ export class SelectionState extends LineBasedState<Array<Selection>> {
}
public drawLine(ctx: DrawContext, lineNumber: number) {
let {
const {
context,
lineHeight,
charWidth,