Thursday, December 10, 2020

Re: Setting file encoding in a modeline

On Do, 10 Dez 2020, A. Wik wrote:

> It seems to me that a modeline would be a convenient place to set the
> encoding used for a file. However, while it does set 'fenc'
> accordingly, the file is not loaded and displayed according to this
> setting.
>
> Bram said reading is tried with each encoding in fencs until one
> succeeds. Why not reload the file with the correct encoding once a
> modeline with a fenc setting has been read?

The problem with this is, it is a catch 22. To be able to handle the
modeline, Vim must have already read correctly the buffer with the
correct encoding.

So if it was wrong, the modeline could not be read correctly and
therefore this doesn't help.

Best,
Christian
--
Im Knast, da schmor'n die Bösen, die Guten dürfen draußen dösen.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20201210134302.GN22416%40256bit.org.

No comments: