Hi, Bram,

I'm getting back into doing some Vim coding, and mailing list
interaction and so on, and have come across this old patch (attached;
originally on vim_use).

The changes to ex_cmds.c are obsoleted by patch 7.2.082, but the change
to option.c is still relevant.

The problem is that when 'ff' is changed, the screen is not redrawn, so
any ^J or ^M in the buffer are incorrectly displayed until you scroll or
redraw.

Ben.



--
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
diff -r 11ae7ca1e672 src/ex_cmds.c
--- a/src/ex_cmds.c	Sat Dec 06 10:45:15 2008 +1100
+++ b/src/ex_cmds.c	Sun Dec 28 19:13:21 2008 +1100
@@ -49,6 +49,7 @@
     exarg_T	*eap;
 {
     int		c;
+    char_u      *transc;
     char	buf1[20];
     char	buf2[20];
     char_u	buf3[7];
@@ -92,9 +93,12 @@
 	else
 #endif
 	    buf2[0] = NUL;
+	transc = transchar(c);
+	if (c == CAR && get_fileformat(curbuf) == EOL_MAC)
+	    c = NL;		/* we use CR in place of  NL in this case */
 	vim_snprintf((char *)IObuff, IOSIZE,
 		_("<%s>%s%s  %d,  Hex %02x,  Octal %03o"),
-					   transchar(c), buf1, buf2, c, c, c);
+					   transc, buf1, buf2, c, c, c);
 #ifdef FEAT_MBYTE
 	if (enc_utf8)
 	    c = cc[ci++];
diff -r 11ae7ca1e672 src/option.c
--- a/src/option.c	Sat Dec 06 10:45:15 2008 +1100
+++ b/src/option.c	Sun Dec 28 19:13:21 2008 +1100
@@ -1056,7 +1056,7 @@
 			    {(char_u *)0L, (char_u *)0L}
 #endif
 			    },
-    {"fileformat",  "ff",   P_STRING|P_ALLOCED|P_VI_DEF|P_RSTAT|P_NO_MKRC,
+    {"fileformat",  "ff",   P_STRING|P_ALLOCED|P_VI_DEF|P_RSTAT|P_RBUF|P_NO_MKRC,
 			    (char_u *)&p_ff, PV_FF,
 			    {(char_u *)DFLT_FF, (char_u *)0L}},
     {"fileformats", "ffs",  P_STRING|P_VIM|P_COMMA|P_NODUP,

Raspunde prin e-mail lui