diff --git a/config/wasm/harpoon.wasm b/config/wasm/harpoon.wasm index db92e1d1..d1be2fa8 100644 Binary files a/config/wasm/harpoon.wasm and b/config/wasm/harpoon.wasm differ diff --git a/config/wasm/keybindings_plugin.wasm b/config/wasm/keybindings_plugin.wasm index 99b28097..b5775dc8 100644 Binary files a/config/wasm/keybindings_plugin.wasm and b/config/wasm/keybindings_plugin.wasm differ diff --git a/config/wasm/vscode_config_plugin.wasm b/config/wasm/vscode_config_plugin.wasm index a6df0bab..10c37362 100644 Binary files a/config/wasm/vscode_config_plugin.wasm and b/config/wasm/vscode_config_plugin.wasm differ diff --git a/scripting/editor_api.nim b/scripting/editor_api.nim index 23f1ff48..487c86a9 100644 --- a/scripting/editor_api.nim +++ b/scripting/editor_api.nim @@ -180,6 +180,8 @@ proc chooseFile*(preview: bool = true; scaleX: float = 0.8; scaleY: float = 0.8; ## Press to close the dialogue editor_chooseFile_void_App_bool_float_float_float_impl(preview, scaleX, scaleY, previewScale) +proc openLastEditor*() = + editor_openLastEditor_void_App_impl() proc chooseOpen*(preview: bool = true; scaleX: float = 0.8; scaleY: float = 0.8; previewScale: float = 0.6) = editor_chooseOpen_void_App_bool_float_float_float_impl(preview, scaleX, diff --git a/scripting/editor_api_wasm.nim b/scripting/editor_api_wasm.nim index f97a0370..7bf46bde 100644 --- a/scripting/editor_api_wasm.nim +++ b/scripting/editor_api_wasm.nim @@ -1017,6 +1017,13 @@ proc chooseFile*(preview: bool = true; scaleX: float = 0.8; scaleY: float = 0.8; argsJsonString.cstring) +proc editor_openLastEditor_void_App_wasm(arg: cstring): cstring {.importc.} +proc openLastEditor*() = + var argsJson = newJArray() + let argsJsonString = $argsJson + let res {.used.} = editor_openLastEditor_void_App_wasm(argsJsonString.cstring) + + proc editor_chooseOpen_void_App_bool_float_float_float_wasm(arg: cstring): cstring {. importc.} proc chooseOpen*(preview: bool = true; scaleX: float = 0.8; scaleY: float = 0.8; diff --git a/scripting/plugin_api_internal.nim b/scripting/plugin_api_internal.nim index c05c0a39..d7611f20 100644 --- a/scripting/plugin_api_internal.nim +++ b/scripting/plugin_api_internal.nim @@ -810,6 +810,8 @@ proc editor_chooseFile_void_App_bool_float_float_float_impl*( preview: bool = true; scaleX: float = 0.8; scaleY: float = 0.8; previewScale: float = 0.5) = discard +proc editor_openLastEditor_void_App_impl*() = + discard proc editor_chooseOpen_void_App_bool_float_float_float_impl*( preview: bool = true; scaleX: float = 0.8; scaleY: float = 0.8; previewScale: float = 0.6) = diff --git a/src/app.nim b/src/app.nim index a072bd15..693cd616 100644 --- a/src/app.nim +++ b/src/app.nim @@ -2745,6 +2745,11 @@ proc chooseFile*(self: App, preview: bool = true, scaleX: float = 0.8, scaleY: f self.pushPopup popup +proc openLastEditor*(self: App) {.expose("editor").} = + if self.hiddenViews.len > 0: + let view = self.hiddenViews.pop() + self.addView(view, addToHistory=false, append=false) + proc chooseOpen*(self: App, preview: bool = true, scaleX: float = 0.8, scaleY: float = 0.8, previewScale: float = 0.6) {.expose("editor").} = defer: self.platform.requestRender() @@ -2752,7 +2757,8 @@ proc chooseOpen*(self: App, preview: bool = true, scaleX: float = 0.8, scaleY: f proc getItems(): seq[FinderItem] = var items = newSeq[FinderItem]() let allViews = self.views & self.hiddenViews - for i, view in allViews: + for i in countdown(allViews.high, 0): + let view = allViews[i] if not (view of EditorView): continue