Hello,

Changing a file's 'fileencoding' or 'fileformat' (or 'eol' when 'binary' is set) sets the 'modified' flag, but setting or clearing 'bomb' doesn't, even for Unicode files (e.g. &enc == "utf-8", &fenc == "" or &fenc == "utf-8"). Now with, for example, 'bomb' set, if the disk file is Unicode [i.e. ((&fenc == "" ? &enc : &fenc) =~? '^ucs\|^utf') ] and doesn't start with a BOM we cannot say that "the data on disk is the same as in memory". IMHO, if the user intentionally toggles 'bomb', then forgets to save the file, Vim should refuse to |abandon| it: if the user |:quit|s the file (or tries to |:edit| another file in the same window, etc.), then if 'autowriteall' is set Vim should write the file, if 'hidden' is set it should (IIUC) hide it, otherwise it should give the error "E37: No write since last change (add ! to override)".


Best regards,
Tony.

Reply via email to