WrapEarnPass created an issue (geany/geany#4604)

It seems the document-save signal is misbehaving
I only have my new plugin loaded (everything else is disabled).

https://www.geany.org/manual/reference/signals.html says

> document-save
> Sent when a new document is saved.

I take this to mean "untitled non-disk saved document is saved to disk for the 
first time"
But, that isn't what is happening
```
Autorun-Message: 09:19:45.983: before save end
Autorun-Message: 09:19:45.995: on save start
Autorun-Message: 09:19:45.995: doc not changed?
```

So an existing disk backed document with changes fires the document-before-save 
signal with doc->changed set true, as expected, and then fires the 
document-save signal with doc->changed set to false. Even though nothing 
happened in document-before-save, the contents of the scintilla editor differ 
from what was written to disk before, doc->changed should be true. Or, if 
following the documentation as intent, document-save should never have fired at 
all.

Now if I disconnect the before-save handler.
```
Autorun-Message: 09:32:09.900: on_project_open end
Autorun-Message: 09:32:16.290: on save start
Autorun-Message: 09:32:16.290: doc not changed?
```
The plugin initialized, I added a bunch of new lines and saved an existing 
disk-backed document.

So, the !changed  flag isn't being modified by the outcome of the 
document-before-save handler.

I created a new untitled document from geany>File>New, then saved it using 
geany>File>Save As

09:36:44: New file "untitled" opened.
09:37:20: File 
/home/build/Projects/geany-plugins-remote/geany-plugins/autorun/src/newgarbage.h
 saved.
```
Autorun-Message: 09:37:20.450: on save start
Autorun-Message: 09:37:20.450: doc not changed?
```
So, even for the one specific case the document-save signal is documented to 
handle, it does not set the doc->changed flag?

Maybe related to geany/geany#4603

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/4604
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/issues/[email protected]>

Reply via email to