This problem occurs in vim with +multi_byte.
:edit ++encoding=xyz always causes error E474, while ++enc=xyz succeeds.
"encoding" is the only ++option where the short form of the option is a
substring of the long form. The check for these options does not account
for this.
Here is one way to fix this (same as attached patch).
--- vim/src/ex_docmd.c 2011-10-22 21:32:57.000000000 -0400
+++ vim2/src/ex_docmd.c 2011-11-06 20:46:26.000000000 -0500
@@ -4838,14 +4838,14 @@
pp = &eap->force_ff;
}
#ifdef FEAT_MBYTE
- else if (STRNCMP(arg, "enc", 3) == 0)
+ else if (STRNCMP(arg, "encoding", 8) == 0)
{
- arg += 3;
+ arg += 8;
pp = &eap->force_enc;
}
- else if (STRNCMP(arg, "encoding", 8) == 0)
+ else if (STRNCMP(arg, "enc", 3) == 0)
{
- arg += 8;
+ arg += 3;
pp = &eap->force_enc;
}
else if (STRNCMP(arg, "bad", 3) == 0)
--
You received this message from the "vim_dev" 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
--- vim/src/ex_docmd.c 2011-10-22 21:32:57.000000000 -0400
+++ vim2/src/ex_docmd.c 2011-11-06 20:46:26.000000000 -0500
@@ -4838,14 +4838,14 @@
pp = &eap->force_ff;
}
#ifdef FEAT_MBYTE
- else if (STRNCMP(arg, "enc", 3) == 0)
+ else if (STRNCMP(arg, "encoding", 8) == 0)
{
- arg += 3;
+ arg += 8;
pp = &eap->force_enc;
}
- else if (STRNCMP(arg, "encoding", 8) == 0)
+ else if (STRNCMP(arg, "enc", 3) == 0)
{
- arg += 8;
+ arg += 3;
pp = &eap->force_enc;
}
else if (STRNCMP(arg, "bad", 3) == 0)