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 / old / 5.6.059 < prev    next >
Encoding:
Internet Message Format  |  2000-04-04  |  5.1 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 5.6.059 (extra)
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.6.059 (extra)
  8. Problem:    When moving the cursor over italic text and the characters spill
  9.         over to the cell on the right, that spill-over is deleted.
  10.         Noticed in the Win32 GUI, can happen on other systems too.
  11. Solution:   Redraw italic text starting from a blank, like this is already
  12.         done for bold text. (Vince Negri)
  13. Files:        src/gui.c, src/gui.h, src/gui_w32.c
  14.  
  15.  
  16. *** ../vim-5.6.58/src/gui.c    Sat Mar 25 18:42:55 2000
  17. --- src/gui.c    Wed Apr  5 15:38:02 2000
  18. ***************
  19. *** 1453,1462 ****
  20. --- 1453,1465 ----
  21.       gui_mch_set_font(font);
  22.   #endif
  23.   
  24. +     draw_flags = 0;
  25.       /* Set the color */
  26.       bg_color = gui.back_pixel;
  27.       if ((flags & GUI_MON_IS_CURSOR) && gui.in_focus)
  28.       {
  29. +     draw_flags |= DRAW_CURSOR;
  30.       fg_color = fg;
  31.       bg_color = bg;
  32.       }
  33. ***************
  34. *** 1499,1511 ****
  35.       if (!(flags & GUI_MON_NOCLEAR))
  36.       clip_may_clear_selection(gui.row, gui.row);
  37.   
  38. -     draw_flags = 0;
  39.   
  40.       /* If there's no bold font, then fake it */
  41.       if ((highlight_mask & (HL_BOLD | HL_STANDOUT)) &&
  42.           (gui.bold_font == 0 || (aep != NULL && aep->ae_u.gui.font != 0)))
  43. -     {
  44.       draw_flags |= DRAW_BOLD;
  45.       s -= back;
  46.       len += back;
  47.       col -= back;
  48. --- 1502,1520 ----
  49.       if (!(flags & GUI_MON_NOCLEAR))
  50.       clip_may_clear_selection(gui.row, gui.row);
  51.   
  52.   
  53.       /* If there's no bold font, then fake it */
  54.       if ((highlight_mask & (HL_BOLD | HL_STANDOUT)) &&
  55.           (gui.bold_font == 0 || (aep != NULL && aep->ae_u.gui.font != 0)))
  56.       draw_flags |= DRAW_BOLD;
  57. +     /*
  58. +      * When drawing bold or italic characters the spill-over from the left
  59. +      * neighbor may be destroyed.  Backup to start redrawing just after a
  60. +      * blank.
  61. +      */
  62. +     if ((draw_flags & DRAW_BOLD) || (highlight_mask & HL_ITALIC))
  63. +     {
  64.       s -= back;
  65.       len += back;
  66.       col -= back;
  67. *** ../vim-5.6.58/src/gui.h    Tue Jul 20 11:17:36 1999
  68. --- src/gui.h    Wed Apr  5 15:31:53 2000
  69. ***************
  70. *** 139,144 ****
  71. --- 139,145 ----
  72.   #ifdef RISCOS
  73.   # define DRAW_ITALIC        0x08    /* draw italic text */
  74.   #endif
  75. + #define DRAW_CURSOR        0x10    /* drawing block cursor (win32) */
  76.   
  77.   /* For our own tearoff menu item */
  78.   #define TEAR_STRING        "-->Detach"
  79. *** ../vim-5.6.58/src/gui_w32.c    Wed Apr  5 10:05:34 2000
  80. --- src/gui_w32.c    Wed Apr  5 15:34:59 2000
  81. ***************
  82. *** 3394,3399 ****
  83. --- 3394,3401 ----
  84.   {
  85.       static int    *padding = NULL;
  86.       static int    pad_size = 0;
  87. +     const RECT    *pcliprect = NULL;
  88. +     UINT    foptions = 0;
  89.   #ifdef MULTI_BYTE
  90.       static WCHAR *unicodebuf = NULL;
  91.   #endif
  92. ***************
  93. *** 3448,3453 ****
  94. --- 3450,3465 ----
  95.       DeleteBrush(hbr);
  96.   
  97.       SetBkMode(s_hdc, TRANSPARENT);
  98. +     /*
  99. +      * When drawing block cursor, prevent inverted character spilling
  100. +      * over character cell (can happen with bold/italic)
  101. +      */
  102. +     if (flags & DRAW_CURSOR)
  103. +     {
  104. +         pcliprect = &rc;
  105. +         foptions = ETO_CLIPPED;
  106. +     }
  107.       }
  108.   #else
  109.       /*
  110. ***************
  111. *** 3484,3494 ****
  112.       /* draw an incomplete composition character (korean) */
  113.       if (OrgLen == 1 && blink_state == BLINK_ON
  114.           && (szComp = ImeGetTempComposition()) != NULL) // hangul
  115. !         HanExtTextOut(s_hdc, TEXT_X(col), TEXT_Y(row), 0, NULL, szComp,
  116. !             2, padding, TRUE);
  117.       else
  118. !         HanExtTextOut(s_hdc, TEXT_X(col), TEXT_Y(row), 0, NULL, (char *)s,
  119. !             len, padding, FALSE);
  120.       }
  121.       else
  122.   #endif
  123. --- 3496,3506 ----
  124.       /* draw an incomplete composition character (korean) */
  125.       if (OrgLen == 1 && blink_state == BLINK_ON
  126.           && (szComp = ImeGetTempComposition()) != NULL) // hangul
  127. !         HanExtTextOut(s_hdc, TEXT_X(col), TEXT_Y(row),
  128. !                    foptions, pcliprect, szComp, 2, padding, TRUE);
  129.       else
  130. !         HanExtTextOut(s_hdc, TEXT_X(col), TEXT_Y(row),
  131. !              foptions, pcliprect, (char *)s, len, padding, FALSE);
  132.       }
  133.       else
  134.   #endif
  135. ***************
  136. *** 3507,3520 ****
  137.                   MB_PRECOMPOSED,
  138.                   (char *)s, len,
  139.                   (LPWSTR)unicodebuf, UNIBUFSIZE)))
  140. !             ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row), 0, NULL,
  141. !                                unicodebuf, len, NULL);
  142.           }
  143.       }
  144.       else
  145.   #endif
  146. !         ExtTextOut(s_hdc, TEXT_X(col), TEXT_Y(row), 0, NULL,
  147. !                              (char *)s, len, padding);
  148.       }
  149.   
  150.       if (flags & DRAW_UNDERL)
  151. --- 3519,3532 ----
  152.                   MB_PRECOMPOSED,
  153.                   (char *)s, len,
  154.                   (LPWSTR)unicodebuf, UNIBUFSIZE)))
  155. !             ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
  156. !                   foptions, pcliprect, unicodebuf, len, NULL);
  157.           }
  158.       }
  159.       else
  160.   #endif
  161. !         ExtTextOut(s_hdc, TEXT_X(col), TEXT_Y(row),
  162. !                 foptions, pcliprect, (char *)s, len, padding);
  163.       }
  164.   
  165.       if (flags & DRAW_UNDERL)
  166. *** ../vim-5.6.58/src/version.c    Wed Apr  5 14:42:03 2000
  167. --- src/version.c    Wed Apr  5 16:25:37 2000
  168. ***************
  169. *** 420,421 ****
  170. --- 420,423 ----
  171.   {   /* Add new patch number below this line */
  172. + /**/
  173. +     59,
  174.   /**/
  175.  
  176. -- 
  177. Clothes make the man.  Naked people have little or no influence on society.
  178.  
  179. /-/-- Bram Moolenaar --- Bram@moolenaar.net --- http://www.moolenaar.net --\-\
  180. \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/
  181.