home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.2.381 < prev    next >
Encoding:
Internet Message Format  |  2004-03-18  |  3.0 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.381
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.2.381
  11. Problem:    Setting 'fileencoding' to a comma separated list (confusing it
  12.         with 'fileencodings') does not result in an error message.
  13.         Setting 'fileencoding' in an empty file marks it as modified.
  14.         There is no "+" in the title after setting 'fileencoding'.
  15. Solution:   Check for a comma in 'fileencoding'.  Only consider a non-empty
  16.         file modified by changing 'fileencoding'.  Update the title after
  17.         changing 'fileencoding'.
  18. Files:        src/option.c
  19.  
  20.  
  21. *** ../vim-6.2.380/src/option.c    Thu Mar 18 15:24:30 2004
  22. --- src/option.c    Fri Mar 19 11:25:22 2004
  23. ***************
  24. *** 4799,4807 ****
  25.       /* 'encoding' and 'fileencoding' */
  26.       else if (varp == &p_enc || gvarp == &p_fenc || varp == &p_tenc)
  27.       {
  28. !     if (varp == &curbuf->b_p_fenc && !curbuf->b_p_ma)
  29. !         errmsg = e_modifiable;
  30. !     else
  31.       {
  32.           /* canonize the value, so that STRCMP() can be used on it */
  33.           p = enc_canonize(*varp);
  34. --- 4811,4831 ----
  35.       /* 'encoding' and 'fileencoding' */
  36.       else if (varp == &p_enc || gvarp == &p_fenc || varp == &p_tenc)
  37.       {
  38. !     if (gvarp == &p_fenc)
  39. !     {
  40. !         if (!curbuf->b_p_ma)
  41. !         errmsg = e_modifiable;
  42. !         else if (vim_strchr(*varp, ',') != NULL)
  43. !         /* No comma allowed in 'fileencoding'; catches confusing it
  44. !          * with 'fileencodings'. */
  45. !         errmsg = e_invarg;
  46. ! # ifdef FEAT_TITLE
  47. !         else
  48. !         /* May show a "+" in the title now. */
  49. !         need_maketitle = TRUE;
  50. ! # endif
  51. !     }
  52. !     if (errmsg == NULL)
  53.       {
  54.           /* canonize the value, so that STRCMP() can be used on it */
  55.           p = enc_canonize(*varp);
  56. ***************
  57. *** 9305,9315 ****
  58. --- 9329,9344 ----
  59.    * Return TRUE if 'fileformat' and/or 'fileencoding' has a different value
  60.    * from when editing started (save_file_ff() called).
  61.    * Also when 'endofline' was changed and 'binary' is set.
  62. +  * Don't consider a new, empty buffer to be changed.
  63.    */
  64.       int
  65.   file_ff_differs(buf)
  66.       buf_T    *buf;
  67.   {
  68. +     if ((buf->b_flags & BF_NEW)
  69. +         && buf->b_ml.ml_line_count == 1
  70. +         && *ml_get_buf(buf, (linenr_T)1, FALSE) == NUL)
  71. +     return FALSE;
  72.       if (buf->b_start_ffc != *buf->b_p_ff)
  73.       return TRUE;
  74.       if (buf->b_p_bin && buf->b_start_eol != buf->b_p_eol)
  75. *** ../vim-6.2.380/src/version.c    Thu Mar 18 17:11:30 2004
  76. --- src/version.c    Fri Mar 19 11:42:51 2004
  77. ***************
  78. *** 639,640 ****
  79. --- 639,642 ----
  80.   {   /* Add new patch number below this line */
  81. + /**/
  82. +     381,
  83.   /**/
  84.  
  85. -- 
  86. Q: How many legs does a giraffe have?
  87. A: Eight: two in front, two behind, two on the left and two on the right
  88.  
  89.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  90. ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  91. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  92.  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
  93.