fix
This commit is contained in:
@@ -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+$/,
|
||||
}
|
||||
|
||||
9
src/shared/extensions/baseTheme.ts
Normal file
9
src/shared/extensions/baseTheme.ts
Normal 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",
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user