Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimaoth committed Oct 22, 2024
1 parent f18698f commit 9797c76
Show file tree
Hide file tree
Showing 21 changed files with 310 additions and 272 deletions.
13 changes: 8 additions & 5 deletions config/default_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,13 @@ proc loadDefaultKeybindings*(clearExisting: bool = false) {.expose("load-default
addCommand "editor", "<LEADER>gl", "choose-location"
addCommand "editor", "<LEADER>gg", "choose-git-active-files", false
addCommand "editor", "<LEADER>GG", "choose-git-active-files", true
addCommand "editor", "<LEADER>ge", "explore-files"
addCommand "editor", "<LEADER>gw", "explore-workspace-primary"
addCommand "editor", "<LEADER>gu", "explore-user-config-dir"
addCommand "editor", "<LEADER>ga", "explore-app-config-dir"
addCommand "editor", "<LEADER>gh", "explore-help"
addCommand "editor", "<LEADER>ge", "explore-files", ""
addCommand "editor", "<LEADER>gv", "explore-files", "", showVFS=true
addCommand "editor", "<LEADER>gw", "explore-files", "ws0://"
addCommand "editor", "<LEADER>gW", "explore-files", "ws0://".normalizePath
addCommand "editor", "<LEADER>gu", "explore-files", "home://.nev"
addCommand "editor", "<LEADER>ga", "explore-files", "app://config"
addCommand "editor", "<LEADER>gh", "explore-files", "app://docs"
addCommand "editor", "<LEADER>gp", "explore-current-file-directory"
addCommand "editor", "<LEADER>gs", "search-global-interactive"
addCommand "editor", "<LEADER>gk", "browse-keybinds"
Expand Down Expand Up @@ -183,6 +185,7 @@ proc loadDefaultKeybindings*(clearExisting: bool = false) {.expose("load-default
addCommand "popup.selector.git", "<C-r>", "revert-selected"
addCommand "popup.selector.file-explorer", "<C-UP>", "go-up"
addCommand "popup.selector.file-explorer", "<C-r>", "go-up"
addCommand "popup.selector.file-explorer", "<CS-y>", "enter-normalized"

addCommandBlock "editor", "<LEADER>al":
runLastConfiguration()
Expand Down
Binary file modified config/wasm/harpoon.wasm
Binary file not shown.
Binary file modified config/wasm/keybindings_plugin.wasm
Binary file not shown.
Binary file modified config/wasm/vscode_config_plugin.wasm
Binary file not shown.
33 changes: 7 additions & 26 deletions scripting/editor_api_wasm.nim
Original file line number Diff line number Diff line change
Expand Up @@ -558,38 +558,19 @@ proc installTreesitterParser*(language: string; host: string = "github.com") {.
argsJsonString.cstring)


proc editor_exploreFiles_void_App_string_wasm(arg: cstring): cstring {.importc.}
proc exploreFiles*(root: string = "") {.gcsafe, raises: [].} =
proc editor_exploreFiles_void_App_string_bool_bool_wasm(arg: cstring): cstring {.
importc.}
proc exploreFiles*(root: string = ""; showVFS: bool = false;
normalize: bool = true) {.gcsafe, raises: [].} =
var argsJson = newJArray()
argsJson.add root.toJson()
argsJson.add showVFS.toJson()
argsJson.add normalize.toJson()
let argsJsonString = $argsJson
let res {.used.} = editor_exploreFiles_void_App_string_wasm(
argsJsonString.cstring)


proc editor_exploreUserConfigDir_void_App_wasm(arg: cstring): cstring {.importc.}
proc exploreUserConfigDir*() {.gcsafe, raises: [].} =
var argsJson = newJArray()
let argsJsonString = $argsJson
let res {.used.} = editor_exploreUserConfigDir_void_App_wasm(
let res {.used.} = editor_exploreFiles_void_App_string_bool_bool_wasm(
argsJsonString.cstring)


proc editor_exploreAppConfigDir_void_App_wasm(arg: cstring): cstring {.importc.}
proc exploreAppConfigDir*() {.gcsafe, raises: [].} =
var argsJson = newJArray()
let argsJsonString = $argsJson
let res {.used.} = editor_exploreAppConfigDir_void_App_wasm(
argsJsonString.cstring)


proc editor_exploreHelp_void_App_wasm(arg: cstring): cstring {.importc.}
proc exploreHelp*() {.gcsafe, raises: [].} =
var argsJson = newJArray()
let argsJsonString = $argsJson
let res {.used.} = editor_exploreHelp_void_App_wasm(argsJsonString.cstring)


proc editor_exploreWorkspacePrimary_void_App_wasm(arg: cstring): cstring {.
importc.}
proc exploreWorkspacePrimary*() {.gcsafe, raises: [].} =
Expand Down
14 changes: 14 additions & 0 deletions scripting/vfs_api_wasm.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ proc mountVfs*(parentPath: string; prefix: string; config: JsonNode) {.gcsafe,
argsJsonString.cstring)


proc vfs_normalizePath_string_VFSService_string_wasm(arg: cstring): cstring {.
importc.}
proc normalizePath*(path: string): string {.gcsafe, raises: [].} =
var argsJson = newJArray()
argsJson.add path.toJson()
let argsJsonString = $argsJson
let res {.used.} = vfs_normalizePath_string_VFSService_string_wasm(
argsJsonString.cstring)
try:
result = parseJson($res).jsonTo(typeof(result))
except:
raiseAssert(getCurrentExceptionMsg())


proc vfs_dumpVfsHierarchy_void_VFSService_wasm(arg: cstring): cstring {.importc.}
proc dumpVfsHierarchy*() {.gcsafe, raises: [].} =
var argsJson = newJArray()
Expand Down
Loading

0 comments on commit 9797c76

Please sign in to comment.