-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "document-before-save-as" signal #3572
base: master
Are you sure you want to change the base?
Conversation
* | ||
* @since TODO | ||
*/ | ||
signal void (*document_before_save_as)(GObject *obj, GeanyDocument *doc, gpointer user_data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps add a boolean
return value to potentially allow the plugin to block saving the file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm not sure if plugins should be allowed to do that and what exactly would this be good for. Do you have some example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the plugin should not block a user saving a file, under any circumstances.
bd9e5c0
to
eab9cc1
Compare
Looks ok to me but I know nothing about GTK objects, but it looks the same as document_before_save :-) |
Right now only the "document-save" is fired when performing "save as" which lacks the information about the original file name (which, for instance, is necessary for the LSP client where it needs to notify the server that the "old" document was closed and the document under the new name opened).
eab9cc1
to
0dfd465
Compare
Right now only the "document-save" is fired when performing "save as" which lacks the information about the original file name (which, for instance, is necessary for the LSP client where it needs to notify the server that the "old" document was closed and the document under the new name opened).
Right now the plugin at https://github.com/techee/geany-lsp has the code using this signal commented-out - I'll uncomment it once it's added to Geany (so renaming a file might cause problems synchronizing the document with the server with the current implementation).