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 / 5.7.006 < prev    next >
Encoding:
Internet Message Format  |  2000-08-04  |  4.8 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 5.7.006
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.7.006
  8. Problem:    GUI: redrawing the non-Visual selection is wrong when the window
  9.             is unobscured. (Jean-Pierre Etienne)
  10. Solution:   Redraw the selection properly and don't clear it.  Added "len"
  11.             argument to clip_may_redraw_selection().
  12. Files:      src/gui.c, src/ui.c, src/proto/ui.pro
  13.  
  14.  
  15. *** ../vim-5.7.5/src/gui.c    Sun Jun 18 13:56:27 2000
  16. --- src/gui.c    Sat Aug  5 15:45:18 2000
  17. ***************
  18. *** 1542,1550 ****
  19.       /* Draw the text */
  20.       gui_mch_draw_string(gui.row, col, s, len, draw_flags);
  21.   
  22. !     /* May need to invert it when it's part of the selection (assumes len==1) */
  23.       if (flags & GUI_MON_NOCLEAR)
  24. !     clip_may_redraw_selection(gui.row, col);
  25.   
  26.       if (!(flags & (GUI_MON_IS_CURSOR | GUI_MON_TRS_CURSOR)))
  27.       {
  28. --- 1542,1550 ----
  29.       /* Draw the text */
  30.       gui_mch_draw_string(gui.row, col, s, len, draw_flags);
  31.   
  32. !     /* May need to invert it when it's part of the selection. */
  33.       if (flags & GUI_MON_NOCLEAR)
  34. !     clip_may_redraw_selection(gui.row, col, len);
  35.   
  36.       if (!(flags & (GUI_MON_IS_CURSOR | GUI_MON_TRS_CURSOR)))
  37.       {
  38. ***************
  39. *** 1609,1615 ****
  40.       row2 = Y_2_ROW(y + h - 1);
  41.       col2 = X_2_COL(x + w - 1);
  42.   
  43. !     (void)gui_redraw_block(row1, col1, row2, col2, 0);
  44.   
  45.       /*
  46.        * We may need to redraw the cursor, but don't take it upon us to change
  47. --- 1609,1615 ----
  48.       row2 = Y_2_ROW(y + h - 1);
  49.       col2 = X_2_COL(x + w - 1);
  50.   
  51. !     (void)gui_redraw_block(row1, col1, row2, col2, GUI_MON_NOCLEAR);
  52.   
  53.       /*
  54.        * We may need to redraw the cursor, but don't take it upon us to change
  55. ***************
  56. *** 1620,1628 ****
  57.        */
  58.       if (gui.row == gui.cursor_row)
  59.       gui_update_cursor(FALSE, TRUE);
  60. -     if (clipboard.state != SELECT_CLEARED)
  61. -     clip_redraw_selection(x, y, w, h);
  62.   }
  63.   
  64.   /*
  65. --- 1620,1625 ----
  66. *** ../vim-5.7.5/src/ui.c    Sat Aug  5 15:43:46 2000
  67. --- src/ui.c    Sat Aug  5 15:33:18 2000
  68. ***************
  69. *** 742,761 ****
  70.   }
  71.   
  72.   /*
  73. !  * Redraw the selection if character at "row,col" is inside of it.
  74.    */
  75.       void
  76. ! clip_may_redraw_selection(row, col)
  77. !     int    row, col;
  78.   {
  79.       if (clipboard.state != SELECT_CLEARED
  80. !         && ((row == clipboard.start.lnum
  81. !             && col >= (int)clipboard.start.col)
  82. !         || row > clipboard.start.lnum)
  83. !         && ((row == clipboard.end.lnum
  84. !             && col < (int)clipboard.end.col)
  85. !         || row < clipboard.end.lnum))
  86. !     clip_invert_area(row, col, row, col + 1);
  87.   }
  88.   
  89.   /*
  90. --- 742,768 ----
  91.   }
  92.   
  93.   /*
  94. !  * Redraw part of the selection if character at "row,col" is inside of it.
  95.    */
  96.       void
  97. ! clip_may_redraw_selection(row, col, len)
  98. !     int        row, col;
  99. !     int        len;
  100.   {
  101. +     int        start = col;
  102. +     int        end = col + len;
  103.       if (clipboard.state != SELECT_CLEARED
  104. !         && row >= clipboard.start.lnum
  105. !         && row <= clipboard.end.lnum)
  106. !     {
  107. !     if (row == clipboard.start.lnum && start < (int)clipboard.start.col)
  108. !         start = clipboard.start.col;
  109. !     if (row == clipboard.end.lnum && end > (int)clipboard.end.col)
  110. !         end = clipboard.end.col;
  111. !     if (end > start)
  112. !         clip_invert_area(row, start, row, end);
  113. !     }
  114.   }
  115.   
  116.   /*
  117. *** ../vim-5.7.5/src/proto/ui.pro    Sat Jun 24 11:19:16 2000
  118. --- src/proto/ui.pro    Sat Aug  5 15:33:41 2000
  119. ***************
  120. *** 19,25 ****
  121.   void clip_start_selection __ARGS((int button, int x, int y, int repeated_click, int_u modifiers));
  122.   void clip_process_selection __ARGS((int button, int x, int y, int repeated_click, int_u modifiers));
  123.   void clip_redraw_selection __ARGS((int x, int y, int w, int h));
  124. ! void clip_may_redraw_selection __ARGS((int row, int col));
  125.   void clip_clear_selection __ARGS((void));
  126.   void clip_may_clear_selection __ARGS((int row1, int row2));
  127.   void clip_scroll_selection __ARGS((int rows));
  128. --- 19,25 ----
  129.   void clip_start_selection __ARGS((int button, int x, int y, int repeated_click, int_u modifiers));
  130.   void clip_process_selection __ARGS((int button, int x, int y, int repeated_click, int_u modifiers));
  131.   void clip_redraw_selection __ARGS((int x, int y, int w, int h));
  132. ! void clip_may_redraw_selection __ARGS((int row, int col, int len));
  133.   void clip_clear_selection __ARGS((void));
  134.   void clip_may_clear_selection __ARGS((int row1, int row2));
  135.   void clip_scroll_selection __ARGS((int rows));
  136. *** ../vim-5.7.5/src/version.c    Sat Aug  5 15:43:46 2000
  137. --- src/version.c    Sat Aug  5 15:42:30 2000
  138. ***************
  139. *** 439,440 ****
  140. --- 439,442 ----
  141.   {   /* Add new patch number below this line */
  142. + /**/
  143. +     6,
  144.   /**/
  145.  
  146. -- 
  147. hundred-and-one symptoms of being an internet addict:
  148. 126. You brag to all of your friends about your date Saturday night...but
  149.      you don't tell them it was only in a chat room.
  150.  
  151. ///  Bram Moolenaar     Bram@moolenaar.net     http://www.moolenaar.net  \\\
  152. \\\  Vim: http://www.vim.org      ICCF Holland: http://iccf-holland.org  ///
  153.