Closed ghost closed 6 years ago
Following code might be related to the issue:
https://github.com/adventuregamestudio/ags/blob/ags3/Editor/scintilla/src/CellBuffer.h#L129
/// The save point is a marker in the undo stack where the container has stated that /// the buffer was saved. Undo and redo can move over the save point. void SetSavePoint();
Nevermind above. I think I found what may be the cause of this problem
This is how Scintilla control determines whether Undo is allowed:
case SCI_CANUNDO: return (pdoc->CanUndo() && !pdoc->IsReadOnly()) ? 1 : 0;
Note the IsReadOnly() check.
Apparently Editor sets Scintilla in Read-only mode when it makes a save: https://github.com/adventuregamestudio/ags/blob/ags3/Editor/AGS.Editor/Panes/ScintillaWrapper.cs#L468
public void SetSavePoint() { this.scintillaControl1.SetSavePoint(); this.scintillaControl1.IsReadOnly = true; }
But does not unset it until certain actions (like typing).
Hurray for your god-like efficiency!
Well, there is still a question of how to fix this. Why does Editor put text control in the readonly mode anyway? Is it to protect it during saving/compilation process? If so, perhaps the proper solution is to put it back to writeable mode after all operations are completed.
Hmm, "resolves" keyword failed for some reason. Anyway, this was fixed by #467.
Steps to reproduce (from user):
I noticed that Undo tool button is active, but pressing it does nothing and it gets disabled afterwards.