Skip to content

Commit

Permalink
Fixed compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimaoth committed Sep 8, 2024
1 parent 85adc76 commit f340a72
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion scripting/editor_text_api.nim
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ proc getCompletions*(self: TextDocumentEditor) =
editor_text_getCompletions_void_TextDocumentEditor_impl(self)
proc gotoSymbol*(self: TextDocumentEditor) =
editor_text_gotoSymbol_void_TextDocumentEditor_impl(self)
proc fuzzySearchLines*(self: TextDocumentEditor; minScore: float = float.low;
proc fuzzySearchLines*(self: TextDocumentEditor; minScore: float = 0.2;
sort: bool = true) =
editor_text_fuzzySearchLines_void_TextDocumentEditor_float_bool_impl(self,
minScore, sort)
Expand Down
2 changes: 1 addition & 1 deletion scripting/editor_text_api_wasm.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3178,7 +3178,7 @@ proc gotoSymbol*(self: TextDocumentEditor) =

proc editor_text_fuzzySearchLines_void_TextDocumentEditor_float_bool_wasm(
arg: cstring): cstring {.importc.}
proc fuzzySearchLines*(self: TextDocumentEditor; minScore: float = float.low;
proc fuzzySearchLines*(self: TextDocumentEditor; minScore: float = 0.2;
sort: bool = true) =
var argsJson = newJArray()
argsJson.add block:
Expand Down
2 changes: 1 addition & 1 deletion scripting/plugin_api_internal.nim
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ proc editor_text_gotoSymbol_void_TextDocumentEditor_impl*(
self: TextDocumentEditor) =
discard
proc editor_text_fuzzySearchLines_void_TextDocumentEditor_float_bool_impl*(
self: TextDocumentEditor; minScore: float = float.low; sort: bool = true) =
self: TextDocumentEditor; minScore: float = 0.2; sort: bool = true) =
discard
proc editor_text_gotoWorkspaceSymbol_void_TextDocumentEditor_string_impl*(
self: TextDocumentEditor; query: string = "") =
Expand Down
10 changes: 5 additions & 5 deletions src/app.nim
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ proc tryCloseDocument*(self: App, document: Document, force: bool): bool
proc closeUnusedDocuments*(self: App)
proc tryOpenExisting*(self: App, path: string, appFile: bool = false, append: bool = false): Option[DocumentEditor]
proc setOption*(self: App, option: string, value: JsonNode, override: bool = true)
proc addCommandScript*(self: App, context: string, subContext: string, keys: string, action: string, arg: string = "", description: string = "", source: tuple[filename: string, line: int, column: int] = ("", 0, 0))
proc addCommandScript*(self: App, context: string, subContext: string, keys: string, action: string, arg: string = "", description: string = "")
proc currentEventHandlers*(self: App): seq[EventHandler]
proc getEditorsForDocument(self: App, document: Document): seq[DocumentEditor]
proc showEditor*(self: App, editorId: EditorId, viewIndex: Option[int] = int.none)
Expand Down Expand Up @@ -945,14 +945,14 @@ proc loadKeybindingsFromJson*(self: App, json: JsonNode, filename: string) =
(commandStr[0..<spaceIndex], commandStr[spaceIndex+1..^1])

# todo: line
self.addCommandScript(scope, "", keys, name, args, source = (filename, 0, 0))
self.addCommandScript(scope, "", keys, name, args)

elif command.kind == JObject:
let name = command["command"].getStr
let args = command["args"].elems.mapIt($it).join(" ")
let description = command.fields.getOrDefault("description", newJString("")).getStr
# todo: line
self.addCommandScript(scope, "", keys, name, args, description, source = (filename, 0, 0))
self.addCommandScript(scope, "", keys, name, args, description)

except CatchableError:
when not defined(js):
Expand Down Expand Up @@ -3663,7 +3663,7 @@ proc addLeader*(self: App, leader: string) {.expose("editor").} =
for config in self.eventHandlerConfigs.values:
config.setLeaders self.leaders

proc addCommandScript*(self: App, context: string, subContext: string, keys: string, action: string, arg: string = "", description: string = "", source: tuple[filename: string, line: int, column: int] = ("", 0, 0)) {.expose("editor").} =
proc addCommandScript*(self: App, context: string, subContext: string, keys: string, action: string, arg: string = "", description: string = "") {.expose("editor").} =
let command = if arg.len == 0: action else: action & " " & arg
# log(lvlInfo, fmt"Adding command to '{context}': ('{subContext}', '{keys}', '{command}')")

Expand All @@ -3675,7 +3675,7 @@ proc addCommandScript*(self: App, context: string, subContext: string, keys: str
if description.len > 0:
self.commandDescriptions[context & subContext & keys] = description

self.getEventHandlerConfig(context).addCommand(subContext, keys, command, source)
self.getEventHandlerConfig(context).addCommand(subContext, keys, command)
self.invalidateCommandToKeysMap()

proc removeCommand*(self: App, context: string, keys: string) {.expose("editor").} =
Expand Down

0 comments on commit f340a72

Please sign in to comment.