View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002666||Far Manager||Plugins API.Editor||public||2014-05-06 17:00||2014-05-07 17:16|
|Target Version||Fixed in Version|
|Summary||0002666: New events for ProcessEditorEventW|
|Description||For my plugins, I would find it quite useful if the ProcessEditorEventW function got expanded. Specifically, I need:|
- EE_CANCLOSE, which would get called just before EE_CLOSE and with the same arguments. If it returned TRUE (the default value), then normal closing would commence, otherwise the closing would be aborted and the edited file would remain in the editor.
- Split EE_SAVE into "EE_BEFORESAVE" and "EE_AFTERSAVE".
- I don't need that yet, but it would follow that EE_LOAD would also have a BEFORE and AFTER variant.
|Tags||No tags attached.|
EE_CANCLOSE: Should it occur before or after asking user about unsaved changes?
(or maybe instead)
Perhaps several different return values would solve that:
1 - discard changes and close
2 - save changes and close
3 - ask about changes and close
4 - don't close
||Do we need EE_CANCLOSE in case of ECTL_QUIT (http://api.farmanager.com/ru/service_functions/editorcontrol.html#ECTL_QUIT)?|
||In my opinion, EE_CANCLOSE should be called regardless of the reason for EE_QUIT - including ECTL_QUIT. If the default value is "ask about changes and close", a plugin developer doesn't need to do anything to get the same behavior as today.|
ECTL_QUIT closes editor unconditionally, w/o asking about any unsaved changes.
Plugin that sent ECTL_QUIT may rely that editor is closed.
So I am pretty sure that we do not need EE_CANCLOSE here.
Why not set the default value to 1 in this case then? For user-initiated quit the default would be 3.
But I am not using ECTL_QUIT at all, so consider that just a suggestion.
It is not about default value at all
1) "Plugin A" calls ECTL_QUIT, expecting immediately quit w/o saving
2) "Plugin B" catches EE_CANCLOS and sets return value different from 1
3) "Plugin A" gets in trouble (crash, hang, HDD format)
|2014-05-06 17:00||pepak||New Issue|
|2014-05-06 17:19||JohnDoe||Note Added: 0012369|
|2014-05-06 17:21||JohnDoe||Note Edited: 0012369||View Revisions|
|2014-05-06 17:33||pepak||Note Added: 0012370|
|2014-05-06 17:42||JohnDoe||Note Added: 0012371|
|2014-05-06 18:53||pepak||Note Added: 0012372|
|2014-05-07 10:02||JohnDoe||Note Added: 0012373|
|2014-05-07 10:16||JohnDoe||Note Edited: 0012373||View Revisions|
|2014-05-07 17:09||pepak||Note Added: 0012380|
|2014-05-07 17:16||JohnDoe||Note Added: 0012381|