Currently I found Cudatext can't save a file as the content displayed on the editor currently if the file is modified by another external process. It asked me if I want to reload or just cancel. I chose cancel and press Ctrl+S then quit Cudatext. I open the file in another text editor (Pluma) and the content is not the original content displayed on Cudatext but the content overwrote by the external process. In the other words, Cudatext doesn't save the text at all. Neither Ctrl+S or File/Save work.
The standard behavior on other editors is if I refused to reload the new content of the file from the disk and still choose the save the content currently displayed by the editors, they will ask me if I really want to save the file and if I choose yes it will save the file as my request. I don't know if it's Cudatext's non-standard behavior or it's really a bug.
How to reproduce: if you play Supertux2, when you opened the .stsg file at $HOME/.local/share/supertux2/profile1 to apply the hack, save the file but do not close the editor. After you played a while, you exit Supertux2 and the editor will ask you to reload the file or cancel because it was externally modified. The rest is already reported in detail above.
Cudatext save a file externally modified by another process
Cudatext behavior about a file being externally modified by Pluma.
Long story short: It seemed Cudatext constantly reload the file content from disk, without user intervention. Even though sometimes it not update the displayed text to match the file content (when the text file is big enough like the Supertux2's .stsg game save? it updated the content of my one line test file immediately), it already loaded the modified file content. The warning it displayed to ask the user's opinion is just to ask for the sake of asking. When the user choose to Cancel reloading, it still has the modified file content (maybe loaded in memory?) even though not updating the displayed text. So when issuing Ctrl+S, there is nothing to save, as the content now (the modified content) is already matched to the file on the disk!
Workaround: Cudatext's Cancel button is not reliable. It's not enough to click Cancel and just issue Ctrl+S. You have to enter a character into the displayed text then delete it and issue Ctrl+S. The file will be saved as expected.
Long story short: It seemed Cudatext constantly reload the file content from disk, without user intervention. Even though sometimes it not update the displayed text to match the file content (when the text file is big enough like the Supertux2's .stsg game save? it updated the content of my one line test file immediately), it already loaded the modified file content. The warning it displayed to ask the user's opinion is just to ask for the sake of asking. When the user choose to Cancel reloading, it still has the modified file content (maybe loaded in memory?) even though not updating the displayed text. So when issuing Ctrl+S, there is nothing to save, as the content now (the modified content) is already matched to the file on the disk!
Workaround: Cudatext's Cancel button is not reliable. It's not enough to click Cancel and just issue Ctrl+S. You have to enter a character into the displayed text then delete it and issue Ctrl+S. The file will be saved as expected.
I got it. Cud has "Cancel" pressed, and it don't mark file as modified. so Save command is ignored! so Ctrl+S does nothing. to make Save, you need some modification (add char, delete char).>Workaround: Cudatext's Cancel button is not reliable. It's not enough to click Cancel and just issue Ctrl+S. You have to enter a character into the displayed text then delete it and issue Ctrl+S. The file will be saved as expected.
do you suggest to mark file as 'modified' on pressing Cancel in file-reload-panel?
I am not sure it's correct - file is not modified in Cud (it's modified by external app).
1.114 will show statusbar text "Save command is ignored" when ctrl+S is ignored.
Thank you. This Beta version works as expected. BTW, I hope the next official release would have the QB64 lexerAlexey wrote:Beta
https://github.com/Alexey-T/CudaText/issues/2877