I apologize in advance, this is a pretty weird scenario.
Steps to reproduce: 1. Open a new file (Ctrl-N) 1. Type something into it, for example `hello world` 1. Save it (Ctrl-S), but leave the file chooser open (so it's not really saved) 1. From the command line (different window, same user, same X.org session), run `geany necronomicon.txt`, where `necronomicon.txt` is an existing file with, say, `Hail Satan!` in it. Observe that Geany opens the file and switches to it. Of course the file chooser is focused instead, because it's modal. But if you move it out of the way, you see `necronomicon.txt` open. 1. Enter `lovely_message.txt` in the file chooser and press OK.
Expected behavior: a lovely message in `lovely_message.txt`, and a demonic one in `necronomicon.txt`
Actual behavior: a demonic message in `lovely_message.txt`, with `necronomicon.txt` untouched, and the "new unsaved tab" is still unsaved.
My interpretation: apparently, Geany decides which file it wants to save 1) *after* the file chooser is done, and 2) depends only on which tab happens to be open.
So the order 3-4-5 is my fault, and a pretty extravagant use case. But I think there are other ways to handle this which are more predictable by the user.
Using Geany 1.29, "Jowar, compiled 2016-11-16 or later". I could not find any similar bug, so I expect (without trying it out) that it also fails with a newer version.
I think there are a few weird edge cases like this. It seems like this particular one would pretty easy to solve by attaching a pointer to the document to the Save As dialog when it's triggered instead of saving the active/current document.
This is an example of the fact that Geany is NOT re-entrant, it simply is not written to do several things at once. It will likely happen to any dialog or other operation where the main loop is operating during a Geany action, so also builds, and most other spawns.
It just needs to track the document to save when a save action occurs, or disable the command-line pipe thing when a modal dialog is open. Seems like it would be an easy fix, not some fatal flaw.
Its not some fatal flaw, its just the reality of Geany implementation. My point is not that THIS fix isn't easy, just that there may be other places that need fixing.
On 3 May 2017 at 15:32, Matthew Brush notifications@github.com wrote:
It just needs to track the document to save when a save action occurs, or disable the command-line pipe thing when a modal dialog is open. Seems like it would be an easy fix, not some fatal flaw.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/geany/geany/issues/1487#issuecomment-298826295, or mute the thread https://github.com/notifications/unsubscribe-auth/AAxgTXRLWEWb2RTdqZz8r-LeZkOp7yiiks5r2BF6gaJpZM4NOghU .
github-comments@lists.geany.org