diff --git a/src/absytree.nim b/src/absytree.nim index df2d72f3..bd9c26c6 100644 --- a/src/absytree.nim +++ b/src/absytree.nim @@ -86,6 +86,15 @@ when enableGui: log lvlInfo, fmt"True colors: {trueColorSupport}" # Do this after every import +# Don't remove those imports, they are needed by createNimScriptContextConstructorAndGenerateBindings +import std/[macrocache] +import ast/model_document +import text/text_editor +import text/language/lsp_client +import selector_popup +when not defined(js): + import wasm3, wasm3/[wasm3c, wasmconversions] + createNimScriptContextConstructorAndGenerateBindings() # Initialize renderer diff --git a/src/absytree_js.nim b/src/absytree_js.nim index 4517714c..946aa7e1 100644 --- a/src/absytree_js.nim +++ b/src/absytree_js.nim @@ -16,6 +16,12 @@ import app import ui/node +# Don't remove those imports, they are needed by createNimScriptContextConstructorAndGenerateBindings +import std/[macrocache] +import ast/model_document +import text/text_editor +import text/language/lsp_client +import selector_popup createNimScriptContextConstructorAndGenerateBindings() # Initialize renderer diff --git a/src/app.nim b/src/app.nim index 0586bad6..749affd8 100644 --- a/src/app.nim +++ b/src/app.nim @@ -1963,10 +1963,6 @@ proc handleAction(self: App, action: string, arg: string): bool = return true template createNimScriptContextConstructorAndGenerateBindings*(): untyped = - import ast/model_document - import text/text_editor - import text/language/lsp_client - import selector_popup when not defined(js): proc createAddins(): VmAddins = addCallable(myImpl): @@ -1996,7 +1992,4 @@ template createNimScriptContextConstructorAndGenerateBindings*(): untyped = proc createScriptContextImpl(filepath: string, searchPaths: seq[string]): Future[ScriptContext] = createScriptContextNim(filepath, searchPaths) createScriptContext = createScriptContextImpl - when not defined(js): - import wasm3, wasm3/[wasm3c, wasmconversions] - createEditorWasmImportConstructor() \ No newline at end of file diff --git a/src/input.nim b/src/input.nim index e20a8bcb..89c28277 100644 --- a/src/input.nim +++ b/src/input.nim @@ -198,7 +198,7 @@ proc createOrUpdateState(dfa: var CommandDFA, currentState: int, inputCode: int6 linkState(dfa, currentState, nextState, inputCode, mods) return nextState -proc parseNextInput(input: openArray[Rune], index: int, leader: (int64, Modifiers) = (0, {})): tuple[inputCode: int64, mods: Modifiers, nextIndex: int, persistent: bool] = +proc parseNextInput(input: openArray[Rune], index: int, leader: (int64, Modifiers) = (0.int64, {})): tuple[inputCode: int64, mods: Modifiers, nextIndex: int, persistent: bool] = result.inputCode = 0 result.mods = {} result.nextIndex = index diff --git a/src/platform/terminal_platform.nim b/src/platform/terminal_platform.nim index b93539f8..d0b9797e 100644 --- a/src/platform/terminal_platform.nim +++ b/src/platform/terminal_platform.nim @@ -298,7 +298,7 @@ proc setForegroundColor(self: TerminalPlatform, color: chroma.Color) = self.buffer.setForegroundColor(color.toStdColor) else: let stdColor = color.toStdColor.extractRGB - let fgColor = getClosestColor[tui.ForegroundColor](stdColor.r, stdColor.g, stdColor.b, fgWhite) + let fgColor = getClosestColor[tui.ForegroundColor](stdColor.r, stdColor.g, stdColor.b, tui.fgWhite) self.buffer.setForegroundColor(fgColor) proc setBackgroundColor(self: TerminalPlatform, color: chroma.Color) = @@ -306,7 +306,7 @@ proc setBackgroundColor(self: TerminalPlatform, color: chroma.Color) = self.buffer.setBackgroundColor(color.toStdColor, color.a) else: let stdColor = color.toStdColor.extractRGB - let bgColor = getClosestColor[tui.BackgroundColor](stdColor.r, stdColor.g, stdColor.b, bgBlack) + let bgColor = getClosestColor[tui.BackgroundColor](stdColor.r, stdColor.g, stdColor.b, tui.bgBlack) self.buffer.setBackgroundColor(bgColor) proc fillRect(self: TerminalPlatform, bounds: Rect, color: chroma.Color) = diff --git a/src/scripting/scripting_wasm.nim b/src/scripting/scripting_wasm.nim index e700921d..d5fada49 100644 --- a/src/scripting/scripting_wasm.nim +++ b/src/scripting/scripting_wasm.nim @@ -135,7 +135,6 @@ method handleScriptAction*(self: ScriptContextWasm, name: string, args: JsonNode # because this goes through all exposed functions at compile time to create the wasm import data. # That's why it's in a template template createEditorWasmImportConstructor*() = - import std/[macrocache] proc createEditorWasmImportsImpl(): WasmImports = macro addEditorFunctions(imports: WasmImports): untyped = var list = nnkStmtList.newTree()