To: vim-dev@vim.org Subject: Patch 6.1.241 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.241 Problem: Something goes wrong when drawing or undrawing the cursor. Solution: Remember when the cursor invalid in a better way. Files: src/gui.c *** ../vim61.240/src/gui.c Sun Oct 27 20:38:46 2002 --- src/gui.c Sun Oct 27 20:36:17 2002 *************** *** 807,813 **** #endif gui.cursor_row = gui.row; gui.cursor_col = gui.col; - gui.cursor_is_valid = TRUE; /* Only write to the screen after ScreenLines[] has been initialized */ if (!screen_cleared || ScreenLines == NULL) --- 807,812 ---- *************** *** 821,826 **** --- 820,827 ---- if (gui.row >= screen_Rows || gui.col >= screen_Columns) return; + gui.cursor_is_valid = TRUE; + /* * How the cursor is drawn depends on the current mode. */ *************** *** 927,935 **** old_hl_mask = gui.highlight_mask; if (shape_table[idx].shape == SHAPE_BLOCK #ifdef FEAT_HANGULIN ! || composing_hangul #endif ! ) { /* * Draw the text character with the cursor colors. Use the --- 928,936 ---- old_hl_mask = gui.highlight_mask; if (shape_table[idx].shape == SHAPE_BLOCK #ifdef FEAT_HANGULIN ! || composing_hangul #endif ! ) { /* * Draw the text character with the cursor colors. Use the *************** *** 1723,1728 **** --- 1724,1731 ---- * actually draw (an inverted) cursor. * GUI_MON_TRS_CURSOR is used to draw the cursor text with a transparant * background. + * GUI_MON_NOCLEAR is used to avoid clearing the selection when drawing over + * it. * Returns OK, unless "back" is non-zero and using the bold trick, then return * FAIL (the caller should start drawing "back" chars back). */ *************** *** 2079,2084 **** --- 2082,2090 ---- gui.cursor_row, gui.cursor_col + 1, GUI_MON_NOCLEAR); } #endif + /* Cursor_is_valid is reset when the cursor is undrawn, also reset it + * here in case it wasn't needed to undraw it. */ + gui.cursor_is_valid = FALSE; } } *** ../vim61.240/src/version.c Sun Oct 27 20:49:12 2002 --- src/version.c Sun Oct 27 20:51:11 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 241, /**/ -- Vim is like Emacs without all the typing. (John "Johann" Spetz) /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///