Menu

#646 Problems with handling of read-only files in TCoolEdit

8
open
CoolPrj (48)
1
4 days ago
5 days ago
No

TCoolEdit can open read-only text files and by default does not allow editing and saving them.

But the read-only flag can be turned off by the method EnableReadOnlyMode(false), which is available in the Edit->Modes->Read-Only Mode.

If after that the user tries to save the document, the application crashes.

This case should be handled gracefully, by either showing an error message to the user or by clearing the read-only flag of the file and then saving the changes. I think the first option is preferable, as the file may be opened from a read-only location.

Another use case is when the user opens a read-only file and then uses Save As to save it under a different name - the document stays read-only and the user has to manually turn off the read-only flag before editing and saving the changes. The read-only flag should be automatically cleared in this case.

Lastly, it would be nice to have some visual indication when the file that is opened is read-only. For example Notepad++ grays the save icon to the left of the file name, which Visual Studio shows a small lock icon to the right of the file name. Even a simple text "(read-only)" in the title bar may be good to have.

Related

Feature Requests: #282

Discussion

  • Vidar Hasfjord

    Vidar Hasfjord - 4 days ago

    Good ticket!

    See also "TCoolEdit: Display ReadOnly in the document title" [feature-requests:#195].

     
    👍
    1

    Related

    Feature Requests: #195

  • Ognyan Chernokozhev

    Possible fixes for the first two issues pushed in [r8820].

     
    👍
    1

    Related

    Commit: [r8820]


Log in to post a comment.