unixwork/xnedit

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

Closed this issue · 6 comments

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.

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.

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.

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...?

Yes, you will still get the encoding error message.

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

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