fix
Some checks failed
Deploy / deploy (build, debian, 22, /root/OJDeploy/data/clientnext) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822, /root/OJ/data/dist) (push) Has been cancelled

This commit is contained in:
2026-05-09 01:54:02 -06:00
parent 5890373f46
commit 83e89b473f
9 changed files with 57 additions and 31 deletions

View File

@@ -5,7 +5,7 @@ import type {
CompletionSource,
} from "@codemirror/autocomplete"
import type { EditorView } from "@codemirror/view"
import { LANGUAGE } from "utils/types"
import type { LANGUAGE } from "utils/types"
import { c } from "./c"
import { python } from "./python"
@@ -25,7 +25,7 @@ export function enhanceCompletion(language: LANGUAGE): CompletionSource {
context: CompletionContext,
): Promise<CompletionResult | null> {
const word = context.matchBefore(/\w+/)
if (!word) return null
if (!word && !context.explicit) return null
const trulyLanguage = language.startsWith("Python") ? "python" : "c"
const completions: Completion[] = (
@@ -63,7 +63,7 @@ export function enhanceCompletion(language: LANGUAGE): CompletionSource {
})
return {
from: word.from,
from: word ? word.from : context.pos,
options: completions,
validFor: /^\w+$/,
}

View File

@@ -0,0 +1,9 @@
import { EditorView } from "@codemirror/view"
export const styleTheme = EditorView.baseTheme({
"& .cm-scroller": { "font-family": "Monaco" },
"&.cm-editor.cm-focused": { outline: "none" },
"&.cm-editor .cm-tooltip.cm-tooltip-autocomplete ul": {
"font-family": "Monaco",
},
})