Windows 10 64-bit, OmegaT 4.1.3_2
- Open a project
- Go to some segment
- Enter some text into the Notes pane
- Move to another segment
- Save the project
- Go back to the Notes pane of the segment which has the note
- Do the menu command Edit / Undo Last Action (Ctrl+Z)
- Notice how nothing happens to the note (as expected)
- Now, instead of using the menu, press Ctrl+Z on the keyboard
- Notice how the note is erased
Expected: Ctrl+Z should do the same as the menu option (where the accelerator Ctrl+Z is mentioned)
I can reproduce the behavior on master branch.
When observed in debugger, I find that when selecting
Edit>Undo Last Action, a focus is not in a Note pane because menu dialog has, soUndoaction is try against main editor.When entering
Ctrl-Zwith the focus in Note pane,Undoaction calls a function of Noteundo()In
MainWindowMenuHandler.java:462This explains a behavior.
When OmegaT saves the project,
EditroController#commitAndDeactivateis called. the metohd callsUndoManager#resetduring the process.OmegaT does not call similar function of Note pane controller, and there is no similar method in the pane.
Last edit: Hiroshi Miura 2024-02-03
A fact is slightly different. Note pane does not have a different lifecycle than Editor pane.
Editor pane
contentsis lived during editing a source file.Note pane
contentsis alive during editing a target ** segment.**When moving next segment, Note pane start new editor history.
After saving the project, and go back to the segment with note, note pane has a history;
We can reset edit history after step 2 then it will become intended behavior.
Fix is proposed
https://github.com/omegat-org/omegat/pull/939