blurymind / YarnClassic

A tool for writing interactive dialogue in games!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ctrl+S after "Save as Yarn" not working

i1qwert opened this issue · comments

Steps:

  1. Open yarn editor
  2. Type something in node
  3. Menu -> Save as Yarn -> Save somewhere
  4. Edit again
  5. Hit Ctrl + S
  6. Check yarn file and see that it hasn't changed

Expected: saving with Ctrl+S after saving as yarn

same happens after just opening yarn file, editing it and trying to save with Ctrl+S

possibly broken recently by the input refactoring 😢
@daviddq can you look into this? Sorry I didn't catch the regression at the pr. These refactorings are big.

When yarn on electron has a path to a local file (the user has saved it or opened an existing one) - ctrl+s should overwrite the file.

Note that this cant work for the web app, because we dont have access to the user's filesystem!
@i1qwert you are not running into this bug in the web app are you?

commented

Ctrl+S opens the browser's "save file" dialog in the webapp and saves the HTML page.

Currently the shortcut to save is Ctrl+Alt+S:

image

Ctrl+S opens the browser's "save file" dialog in the webapp and saves the HTML page.

Currently the shortcut to save is Ctrl+Alt+S:

image

can we make it ctrl+S again? Thats the standard in most software and it was ctrl+s in electron before :)

Ctrl+s for electron, ctrl+alt+s for the web app

actually maybe both ctrl+s and ctrl+alt+s should save the file. No need to add checks if its in electron

commented

a) It was Ctrl+Alt+S back in 0.2.4, way before I started working on this project:

Captura de pantalla 2020-05-29 a las 13 11 39

b) Ctrl+S won't work on webapp since it's captured by the browser.

c) Ctrl+S is already being handled. I just tested in the Electron-Mac 0.4.20 build and worked properly.

commented

I just tested on Electron-Windows 0.4.20 and none of the save shortcuts work (Ctrl+S, Ctrl+Alt+S, Ctrl+Shitf+S)

interesting, does windows have a different way of detecting the ctrl key? I have no access to a windows computer

commented

I don't think so. I need to find the way to debug in Electron. We already have an issue in Electron (arrows not drawing until a node is edited and saved #168) and I would like to tackle both.

to be clear the intended design for ctrl+s is to write changes to the currently edited file. It needs to know the path to it, know its format and know to save the changes.

If there is no path (no file saved or opened yet), then it needs to offer to save it to somewhere.

I dont care about ctrl+shift+s saving json and ctrl+alt+s saving yarn so much. I do care for a quick shortcut that saves progress - with progress being key word here

btw electron's api has useful methods to register global shortcuts
https://www.electronjs.org/docs/tutorial/keyboard-shortcuts
but they are electron specific. I would prefer to keep as much as the code platform independent as possible :)

Why not use electron's debugger? Run yarn on localhost then cd to yarn/electron's folder and run npm start. Electron version of yarn
in dev mode opens with the debugger.

good catch and thanks to @daviddq for fixing this. Please download the latest electron build and test again. Let us know if it persists
https://github.com/YarnSpinnerTool/YarnEditor/releases/tag/v0.4.22

yep, now it kinda works great but still there is a little problem - when you save at fresh start with Ctrl + Alt + S , you later expect it to save it with the Ctrl + S automatically, but it keeps opening save dialog.

BUT Ctrl + S works fine after you open yarn file