To: vim-dev@vim.org Subject: Patch 6.1.250 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.250 Problem: When changing the value of 'lines' inside the expression set with 'diffexpr' Vim might crash. (Dave Fishburn) Solution: Don't allow changing the screen size while updating the screen. Files: src/globals.h, src/option.c, src/screen.c *** ../vim61.249/src/globals.h Sun Oct 27 20:32:20 2002 --- src/globals.h Sun Nov 10 13:16:38 2002 *************** *** 307,312 **** --- 307,316 ---- EXTERN int sys_menu INIT(= FALSE); #endif + /* While redrawing the screen this flag is set. It means the screen size + * ('lines' and 'rows') must not be changed. */ + EXTERN int updating_screen INIT(= FALSE); + #ifdef FEAT_GUI /* Menu item just selected, set by check_termcode() */ EXTERN vimmenu_T *current_menu; *************** *** 333,342 **** EXTERN int hold_gui_events INIT(= 0); /* ! * While the screen is being redrawn, must not handle resizing the shell. ! * Remember the new size, and call gui_resize_shell() later. */ - EXTERN int updating_screen INIT(= FALSE); EXTERN int new_pixel_width INIT(= 0); EXTERN int new_pixel_height INIT(= 0); --- 337,345 ---- EXTERN int hold_gui_events INIT(= 0); /* ! * When resizing the shell is postponed, remember the new size, and call ! * gui_resize_shell() later. */ EXTERN int new_pixel_width INIT(= 0); EXTERN int new_pixel_height INIT(= 0); *** ../vim61.249/src/option.c Sun Oct 13 20:08:14 2002 --- src/option.c Sun Nov 10 13:30:55 2002 *************** *** 6232,6238 **** */ if (old_Rows != Rows || old_Columns != Columns) { ! if (full_screen #ifdef FEAT_GUI && !gui.starting #endif --- 6234,6243 ---- */ if (old_Rows != Rows || old_Columns != Columns) { ! /* Changing the screen size is not allowed while updating the screen. */ ! if (updating_screen) ! *pp = old_value; ! else if (full_screen #ifdef FEAT_GUI && !gui.starting #endif *** ../vim61.249/src/screen.c Mon Sep 23 21:32:08 2002 --- src/screen.c Sun Nov 10 13:21:14 2002 *************** *** 345,353 **** return; } - #ifdef FEAT_GUI updating_screen = TRUE; - #endif #ifdef FEAT_SYN_HL ++display_tick; /* let syntax code know we're in a next round of * display updating */ --- 345,351 ---- *************** *** 523,530 **** curbuf->b_mod_set = FALSE; #endif - #ifdef FEAT_GUI updating_screen = FALSE; gui_may_resize_shell(); #endif --- 521,528 ---- curbuf->b_mod_set = FALSE; #endif updating_screen = FALSE; + #ifdef FEAT_GUI gui_may_resize_shell(); #endif *************** *** 567,572 **** --- 565,571 ---- #ifdef FEAT_FOLDING win_foldinfo.fi_level = 0; #endif + updating_screen = TRUE; #ifdef FEAT_GUI /* Remove the cursor before starting to do anything, because scrolling may *************** *** 617,622 **** --- 616,626 ---- gui_update_scrollbars(FALSE); } #endif + + updating_screen = FALSE; + #ifdef FEAT_GUI + gui_may_resize_shell(); + #endif } #endif *** ../vim61.249/src/version.c Thu Nov 7 21:20:19 2002 --- src/version.c Sun Nov 10 13:31:31 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 250, /**/ -- Engineers are widely recognized as superior marriage material: intelligent, dependable, employed, honest, and handy around the house. (Scott Adams - The Dilbert principle) /// 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 ///