You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...but that's taking the encoding of the new buffer, not the one that was just closed!
Possible fixes:
Evaluate filename() only when the buffer is opened, then save this filename to an internal hash table that maps the buffer number/id to the filename. Also, update it if the user switches languages or encoding.
Just tell the user to always use "utf-8" since that's the most common encoding anyways.
Pass in an encoding argument into filename(). But the encoding should be determined before the file is closed.
The
filename()
function is called once after the buffer is opened, and once after buffer is closed. This is problematic since the docs suggest:...but that's taking the encoding of the new buffer, not the one that was just closed!
Possible fixes:
filename()
only when the buffer is opened, then save this filename to an internal hash table that maps the buffer number/id to the filename. Also, update it if the user switches languages or encoding.encoding
argument intofilename()
. But the encoding should be determined before the file is closed.Quick n' dirty patch:
The text was updated successfully, but these errors were encountered: