unixwork / xnedit

A fast and classic X11 text editor, based on NEdit, with full unicode support and antialiased text rendering.
Other
82 stars 12 forks source link

'file locked to prevent accidental changes' is a dead-end with no documented escape #123

Closed UnixRonin closed 1 year ago

UnixRonin commented 1 year ago

If xnedit encounters a character in a source file that it cannot 'convert', it locks the file 'to prevent accidental changes'. I cannot see any way to UNDO this lock, so once xnedit has locked the file, even if you have identified the problem and you are certain you know what you are doing, you cannot fix the problem causing the file to be locked. (At least, not without using a DIFFERENT editor to do it.) This is a problem. At this very moment, I have a source file I need to edit to fix a bug, and I can't, because xnedit doesn't like two characters (currency symbols) in regular expressions in the file and won't let me edit it.

unixwork commented 1 year ago

Looks like a bug. In theory unselecting Preferences -> Read Only should unlock the file, but it doesn't work.

You can disable this behavior completely by changing the setting Preferences -> Default Settings -> Lock File On Encoding Error. After that, files are not locked, when an encoding error occurs.

unixwork commented 1 year ago

Ok, the bug is now fixed, Preferences -> Read Only can also disable the lock.

Btw, you need to fix the encoding errors, otherwise you can lose these characters in the file, because xnedit uses utf8 internally.

UnixRonin commented 1 year ago

Thanks for the fast fix! Yeah, I'm aware I need to replace the characters, but without the ability to unlock the file, I couldn't.

Just checking -- If that preference is disabled it will still ALERT to encoding errors...?

unixwork commented 1 year ago

Yes, you will still get the encoding error message.

UnixRonin commented 1 year ago

Hmmmm — actually doesn't look like I do .....

unixwork commented 1 year ago

Really? I tried it and it seems to work. Also, the encoding error is completely independent of this setting.