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.452 < prev    next >
Encoding:
Internet Message Format  |  2004-04-04  |  5.2 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.2.452
  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.452
  11. Problem:    In diff mode, when DiffAdd and DiffText highlight settings are
  12.         equal, an added line is highlighted with DiffChange. (Tom Schumm)
  13. Solution:   Remember the diff highlight type instead of the attributes.
  14. Files:        src/screen.c
  15.  
  16.  
  17. *** ../vim-6.2.451/src/screen.c    Mon Apr  5 20:28:39 2004
  18. --- src/screen.c    Mon Apr  5 21:17:58 2004
  19. ***************
  20. *** 2508,2514 ****
  21.   #ifdef FEAT_DIFF
  22.       int        filler_lines;        /* nr of filler lines to be drawn */
  23.       int        filler_todo;        /* nr of filler lines still to do + 1 */
  24. !     int        diff_attr = 0;        /* attributes for changed/added line */
  25.       int        change_start = MAXCOL;    /* first col of changed area */
  26.       int        change_end = -1;    /* last col of changed area */
  27.   #endif
  28. --- 2508,2514 ----
  29.   #ifdef FEAT_DIFF
  30.       int        filler_lines;        /* nr of filler lines to be drawn */
  31.       int        filler_todo;        /* nr of filler lines still to do + 1 */
  32. !     enum hlf_value diff_hlf = (enum hlf_value)0; /* type of diff highlighting */
  33.       int        change_start = MAXCOL;    /* first col of changed area */
  34.       int        change_end = -1;    /* last col of changed area */
  35.   #endif
  36. ***************
  37. *** 2718,2731 ****
  38.       if (filler_lines == -1)
  39.       {
  40.           if (diff_find_change(wp, lnum, &change_start, &change_end))
  41. !         diff_attr = hl_attr(HLF_ADD);    /* added line */
  42.           else if (change_start == 0)
  43. !         diff_attr = hl_attr(HLF_TXD);    /* changed text */
  44.           else
  45. !         diff_attr = hl_attr(HLF_CHD);    /* changed line */
  46.       }
  47.       else
  48. !         diff_attr = hl_attr(HLF_ADD);    /* added line */
  49.       filler_lines = 0;
  50.       area_highlighting = TRUE;
  51.       }
  52. --- 2718,2731 ----
  53.       if (filler_lines == -1)
  54.       {
  55.           if (diff_find_change(wp, lnum, &change_start, &change_end))
  56. !         diff_hlf = HLF_ADD;    /* added line */
  57.           else if (change_start == 0)
  58. !         diff_hlf = HLF_TXD;    /* changed text */
  59.           else
  60. !         diff_hlf = HLF_CHD;    /* changed line */
  61.       }
  62.       else
  63. !         diff_hlf = HLF_ADD;        /* added line */
  64.       filler_lines = 0;
  65.       area_highlighting = TRUE;
  66.       }
  67. ***************
  68. *** 3230,3249 ****
  69.           char_attr = search_attr;
  70.   
  71.   #ifdef FEAT_DIFF
  72. !         if (diff_attr != 0 && n_extra == 0)
  73.           {
  74. !         if (diff_attr == hl_attr(HLF_CHD) && ptr - line >= change_start)
  75. !             diff_attr = hl_attr(HLF_TXD);    /* changed text */
  76. !         if (diff_attr == hl_attr(HLF_TXD) && ptr - line > change_end)
  77. !             diff_attr = hl_attr(HLF_CHD);    /* changed line */
  78.           if (attr == 0 || area_attr != attr)
  79. !             area_attr = diff_attr;
  80.           if (attr == 0 || char_attr != attr)
  81.           {
  82.               if (search_attr != 0)
  83.               char_attr = search_attr;
  84.               else
  85. !             char_attr = diff_attr;
  86.           }
  87.           }
  88.   #endif
  89. --- 3230,3249 ----
  90.           char_attr = search_attr;
  91.   
  92.   #ifdef FEAT_DIFF
  93. !         if (diff_hlf != (enum hlf_value)0 && n_extra == 0)
  94.           {
  95. !         if (diff_hlf == HLF_CHD && ptr - line >= change_start)
  96. !             diff_hlf = HLF_TXD;        /* changed text */
  97. !         if (diff_hlf == HLF_TXD && ptr - line > change_end)
  98. !             diff_hlf = HLF_CHD;        /* changed line */
  99.           if (attr == 0 || area_attr != attr)
  100. !             area_attr = hl_attr(diff_hlf);
  101.           if (attr == 0 || char_attr != attr)
  102.           {
  103.               if (search_attr != 0)
  104.               char_attr = search_attr;
  105.               else
  106. !             char_attr = hl_attr(diff_hlf);
  107.           }
  108.           }
  109.   #endif
  110. ***************
  111. *** 3627,3633 ****
  112.                * "$". */
  113.               if (
  114.   # ifdef FEAT_DIFF
  115. !                 diff_attr == 0
  116.   #  ifdef LINE_ATTR
  117.                   &&
  118.   #  endif
  119. --- 3627,3633 ----
  120.                * "$". */
  121.               if (
  122.   # ifdef FEAT_DIFF
  123. !                 diff_hlf == (enum hlf_value)0
  124.   #  ifdef LINE_ATTR
  125.                   &&
  126.   #  endif
  127. ***************
  128. *** 3711,3717 ****
  129.   #if defined(FEAT_DIFF) || defined(LINE_ATTR)
  130.           else if ((
  131.   # ifdef FEAT_DIFF
  132. !                 diff_attr != 0
  133.   #  ifdef LINE_ATTR
  134.                   ||
  135.   #  endif
  136. --- 3711,3717 ----
  137.   #if defined(FEAT_DIFF) || defined(LINE_ATTR)
  138.           else if ((
  139.   # ifdef FEAT_DIFF
  140. !                 diff_hlf != (enum hlf_value)0
  141.   #  ifdef LINE_ATTR
  142.                   ||
  143.   #  endif
  144. ***************
  145. *** 3725,3735 ****
  146.               c = ' ';
  147.               --ptr;        /* put it back at the NUL */
  148.   # ifdef FEAT_DIFF
  149. !             if (diff_attr == hl_attr(HLF_TXD))
  150.               {
  151. !             diff_attr = hl_attr(HLF_CHD);
  152.               if (attr == 0 || char_attr != attr)
  153. !                 char_attr = diff_attr;
  154.               }
  155.   # endif
  156.           }
  157. --- 3725,3735 ----
  158.               c = ' ';
  159.               --ptr;        /* put it back at the NUL */
  160.   # ifdef FEAT_DIFF
  161. !             if (diff_hlf == HLF_TXD)
  162.               {
  163. !             diff_hlf = HLF_CHD;
  164.               if (attr == 0 || char_attr != attr)
  165. !                 char_attr = hl_attr(diff_hlf);
  166.               }
  167.   # endif
  168.           }
  169. *** ../vim-6.2.451/src/version.c    Mon Apr  5 20:28:39 2004
  170. --- src/version.c    Mon Apr  5 21:05:14 2004
  171. ***************
  172. *** 639,640 ****
  173. --- 639,642 ----
  174.   {   /* Add new patch number below this line */
  175. + /**/
  176. +     452,
  177.   /**/
  178.  
  179. -- 
  180. Life would be so much easier if we could just look at the source code.
  181.  
  182.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  183. ///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  184. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  185.  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
  186.