Karsten Hopp 240837
To: vim_dev@googlegroups.com
Karsten Hopp 240837
Subject: Patch 7.3.472
Karsten Hopp 240837
Fcc: outbox
Karsten Hopp 240837
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 240837
Mime-Version: 1.0
Karsten Hopp 240837
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 240837
Content-Transfer-Encoding: 8bit
Karsten Hopp 240837
------------
Karsten Hopp 240837
Karsten Hopp 240837
Patch 7.3.472
Karsten Hopp 240837
Problem:    Crash when using ":redraw" in a BufEnter autocommand and
Karsten Hopp 240837
            switching to another tab. (驼峰)
Karsten Hopp 240837
Solution:   Move triggering the the autocommands to after correcting the
Karsten Hopp 240837
            option values. Also check the row value to be out of bounds.
Karsten Hopp 240837
            (Christian Brabandt, Sergey Khorev)
Karsten Hopp 240837
Files:      src/screen.c, src/window.c
Karsten Hopp 240837
Karsten Hopp 240837
Karsten Hopp 240837
*** ../vim-7.3.471/src/screen.c	2012-02-04 23:34:57.000000000 +0100
Karsten Hopp 240837
--- src/screen.c	2012-03-16 18:59:20.000000000 +0100
Karsten Hopp 240837
***************
Karsten Hopp 240837
*** 5371,5376 ****
Karsten Hopp 240837
--- 5371,5382 ----
Karsten Hopp 240837
  # define CHAR_CELLS 1
Karsten Hopp 240837
  #endif
Karsten Hopp 240837
  
Karsten Hopp 240837
+     /* Check for illegal row and col, just in case. */
Karsten Hopp 240837
+     if (row >= Rows)
Karsten Hopp 240837
+ 	row = Rows - 1;
Karsten Hopp 240837
+     if (endcol > Columns)
Karsten Hopp 240837
+ 	endcol = Columns;
Karsten Hopp 240837
+ 
Karsten Hopp 240837
  # ifdef FEAT_CLIPBOARD
Karsten Hopp 240837
      clip_may_clear_selection(row, row);
Karsten Hopp 240837
  # endif
Karsten Hopp 240837
*** ../vim-7.3.471/src/window.c	2012-02-22 14:58:24.000000000 +0100
Karsten Hopp 240837
--- src/window.c	2012-03-16 18:43:01.000000000 +0100
Karsten Hopp 240837
***************
Karsten Hopp 240837
*** 3676,3688 ****
Karsten Hopp 240837
      win_enter_ext(tp->tp_curwin, FALSE, TRUE);
Karsten Hopp 240837
      prevwin = next_prevwin;
Karsten Hopp 240837
  
Karsten Hopp 240837
- #ifdef FEAT_AUTOCMD
Karsten Hopp 240837
-     apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf);
Karsten Hopp 240837
- 
Karsten Hopp 240837
-     if (old_curbuf != curbuf)
Karsten Hopp 240837
- 	apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
Karsten Hopp 240837
- #endif
Karsten Hopp 240837
- 
Karsten Hopp 240837
      last_status(FALSE);		/* status line may appear or disappear */
Karsten Hopp 240837
      (void)win_comp_pos();	/* recompute w_winrow for all windows */
Karsten Hopp 240837
      must_redraw = CLEAR;	/* need to redraw everything */
Karsten Hopp 240837
--- 3676,3681 ----
Karsten Hopp 240837
***************
Karsten Hopp 240837
*** 3712,3717 ****
Karsten Hopp 240837
--- 3705,3718 ----
Karsten Hopp 240837
      gui_may_update_scrollbars();
Karsten Hopp 240837
  #endif
Karsten Hopp 240837
  
Karsten Hopp 240837
+ #ifdef FEAT_AUTOCMD
Karsten Hopp 240837
+     /* Apply autocommands after updating the display, when 'rows' and
Karsten Hopp 240837
+      * 'columns' have been set correctly. */
Karsten Hopp 240837
+     apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf);
Karsten Hopp 240837
+     if (old_curbuf != curbuf)
Karsten Hopp 240837
+ 	apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
Karsten Hopp 240837
+ #endif
Karsten Hopp 240837
+ 
Karsten Hopp 240837
      redraw_all_later(CLEAR);
Karsten Hopp 240837
  }
Karsten Hopp 240837
  
Karsten Hopp 240837
*** ../vim-7.3.471/src/version.c	2012-03-16 14:32:10.000000000 +0100
Karsten Hopp 240837
--- src/version.c	2012-03-16 19:02:53.000000000 +0100
Karsten Hopp 240837
***************
Karsten Hopp 240837
*** 716,717 ****
Karsten Hopp 240837
--- 716,719 ----
Karsten Hopp 240837
  {   /* Add new patch number below this line */
Karsten Hopp 240837
+ /**/
Karsten Hopp 240837
+     472,
Karsten Hopp 240837
  /**/
Karsten Hopp 240837
Karsten Hopp 240837
-- 
Karsten Hopp 240837
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 240837
200. You really believe in the concept of a "paperless" office.
Karsten Hopp 240837
Karsten Hopp 240837
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 240837
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 240837
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 240837
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///