From 25175f46d76b8fd082b41803f4d723b68054845a Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Aug 21 2013 15:42:43 +0000 Subject: patchlevel 5 when closing a window fails ":bwipe" may hang "vaB" while 'virtualedit' is set selects the wrong area --- diff --git a/7.4.004 b/7.4.004 new file mode 100644 index 0000000..f629d67 --- /dev/null +++ b/7.4.004 @@ -0,0 +1,232 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.004 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.004 +Problem: When closing a window fails ":bwipe" may hang. +Solution: Let win_close() return FAIL and break out of the loop. +Files: src/window.c, src/proto/window.pro, src/buffer.c + + +*** ../vim-7.4.003/src/window.c 2013-07-24 17:38:29.000000000 +0200 +--- src/window.c 2013-08-14 16:52:44.000000000 +0200 +*************** +*** 2172,2179 **** + * If "free_buf" is TRUE related buffer may be unloaded. + * + * Called by :quit, :close, :xit, :wq and findtag(). + */ +! void + win_close(win, free_buf) + win_T *win; + int free_buf; +--- 2172,2180 ---- + * If "free_buf" is TRUE related buffer may be unloaded. + * + * Called by :quit, :close, :xit, :wq and findtag(). ++ * Returns FAIL when the window was not closed. + */ +! int + win_close(win, free_buf) + win_T *win; + int free_buf; +*************** +*** 2190,2210 **** + if (last_window()) + { + EMSG(_("E444: Cannot close last window")); +! return; + } + + #ifdef FEAT_AUTOCMD + if (win->w_closing || (win->w_buffer != NULL && win->w_buffer->b_closing)) +! return; /* window is already being closed */ + if (win == aucmd_win) + { + EMSG(_("E813: Cannot close autocmd window")); +! return; + } + if ((firstwin == aucmd_win || lastwin == aucmd_win) && one_window()) + { + EMSG(_("E814: Cannot close window, only autocmd window would remain")); +! return; + } + #endif + +--- 2191,2211 ---- + if (last_window()) + { + EMSG(_("E444: Cannot close last window")); +! return FAIL; + } + + #ifdef FEAT_AUTOCMD + if (win->w_closing || (win->w_buffer != NULL && win->w_buffer->b_closing)) +! return FAIL; /* window is already being closed */ + if (win == aucmd_win) + { + EMSG(_("E813: Cannot close autocmd window")); +! return FAIL; + } + if ((firstwin == aucmd_win || lastwin == aucmd_win) && one_window()) + { + EMSG(_("E814: Cannot close window, only autocmd window would remain")); +! return FAIL; + } + #endif + +*************** +*** 2212,2218 **** + * and then close the window and the tab page to avoid that curwin and + * curtab are invalid while we are freeing memory. */ + if (close_last_window_tabpage(win, free_buf, prev_curtab)) +! return; + + /* When closing the help window, try restoring a snapshot after closing + * the window. Otherwise clear the snapshot, it's now invalid. */ +--- 2213,2219 ---- + * and then close the window and the tab page to avoid that curwin and + * curtab are invalid while we are freeing memory. */ + if (close_last_window_tabpage(win, free_buf, prev_curtab)) +! return FAIL; + + /* When closing the help window, try restoring a snapshot after closing + * the window. Otherwise clear the snapshot, it's now invalid. */ +*************** +*** 2240,2261 **** + win->w_closing = TRUE; + apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf); + if (!win_valid(win)) +! return; + win->w_closing = FALSE; + if (last_window()) +! return; + } + win->w_closing = TRUE; + apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf); + if (!win_valid(win)) +! return; + win->w_closing = FALSE; + if (last_window()) +! return; + # ifdef FEAT_EVAL + /* autocmds may abort script processing */ + if (aborting()) +! return; + # endif + } + #endif +--- 2241,2262 ---- + win->w_closing = TRUE; + apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf); + if (!win_valid(win)) +! return FAIL; + win->w_closing = FALSE; + if (last_window()) +! return FAIL; + } + win->w_closing = TRUE; + apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf); + if (!win_valid(win)) +! return FAIL; + win->w_closing = FALSE; + if (last_window()) +! return FAIL; + # ifdef FEAT_EVAL + /* autocmds may abort script processing */ + if (aborting()) +! return FAIL; + # endif + } + #endif +*************** +*** 2303,2309 **** + * other window or moved to another tab page. */ + else if (!win_valid(win) || last_window() || curtab != prev_curtab + || close_last_window_tabpage(win, free_buf, prev_curtab)) +! return; + + /* Free the memory used for the window and get the window that received + * the screen space. */ +--- 2304,2310 ---- + * other window or moved to another tab page. */ + else if (!win_valid(win) || last_window() || curtab != prev_curtab + || close_last_window_tabpage(win, free_buf, prev_curtab)) +! return FAIL; + + /* Free the memory used for the window and get the window that received + * the screen space. */ +*************** +*** 2383,2388 **** +--- 2384,2390 ---- + #endif + + redraw_all_later(NOT_VALID); ++ return OK; + } + + /* +*** ../vim-7.4.003/src/proto/window.pro 2013-08-10 13:37:30.000000000 +0200 +--- src/proto/window.pro 2013-08-14 16:52:50.000000000 +0200 +*************** +*** 9,15 **** + void win_equal __ARGS((win_T *next_curwin, int current, int dir)); + void close_windows __ARGS((buf_T *buf, int keep_curwin)); + int one_window __ARGS((void)); +! void win_close __ARGS((win_T *win, int free_buf)); + void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp)); + void win_free_all __ARGS((void)); + win_T *winframe_remove __ARGS((win_T *win, int *dirp, tabpage_T *tp)); +--- 9,15 ---- + void win_equal __ARGS((win_T *next_curwin, int current, int dir)); + void close_windows __ARGS((buf_T *buf, int keep_curwin)); + int one_window __ARGS((void)); +! int win_close __ARGS((win_T *win, int free_buf)); + void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp)); + void win_free_all __ARGS((void)); + win_T *winframe_remove __ARGS((win_T *win, int *dirp, tabpage_T *tp)); +*** ../vim-7.4.003/src/buffer.c 2013-07-17 16:39:00.000000000 +0200 +--- src/buffer.c 2013-08-14 16:54:34.000000000 +0200 +*************** +*** 1186,1192 **** + && !(curwin->w_closing || curwin->w_buffer->b_closing) + # endif + && (firstwin != lastwin || first_tabpage->tp_next != NULL)) +! win_close(curwin, FALSE); + #endif + + /* +--- 1186,1195 ---- + && !(curwin->w_closing || curwin->w_buffer->b_closing) + # endif + && (firstwin != lastwin || first_tabpage->tp_next != NULL)) +! { +! if (win_close(curwin, FALSE) == FAIL) +! break; +! } + #endif + + /* +*** ../vim-7.4.003/src/version.c 2013-08-14 14:18:37.000000000 +0200 +--- src/version.c 2013-08-14 17:10:23.000000000 +0200 +*************** +*** 729,730 **** +--- 729,732 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 4, + /**/ + +-- +From "know your smileys": + *<|:-) Santa Claus (Ho Ho Ho) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.005 b/7.4.005 new file mode 100644 index 0000000..f85d1f0 --- /dev/null +++ b/7.4.005 @@ -0,0 +1,48 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.005 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.005 +Problem: Using "vaB" while 'virtualedit' is set selects the wrong area. + (Dimitar Dimitrov) +Solution: Reset coladd when finding a match. +Files: src/search.c + + +*** ../vim-7.4.004/src/search.c 2013-07-17 19:20:47.000000000 +0200 +--- src/search.c 2013-08-14 17:32:38.000000000 +0200 +*************** +*** 1760,1765 **** +--- 1760,1768 ---- + #endif + + pos = curwin->w_cursor; ++ #ifdef FEAT_VIRTUALEDIT ++ pos.coladd = 0; ++ #endif + linep = ml_get(pos.lnum); + + cpo_match = (vim_strchr(p_cpo, CPO_MATCH) != NULL); +*** ../vim-7.4.004/src/version.c 2013-08-14 17:11:14.000000000 +0200 +--- src/version.c 2013-08-14 17:38:05.000000000 +0200 +*************** +*** 729,730 **** +--- 729,732 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 5, + /**/ + +-- +You can't have everything. Where would you put it? + -- Steven Wright + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/README.patches b/README.patches index 65b6301..0c7d5ee 100644 --- a/README.patches +++ b/README.patches @@ -27,3 +27,5 @@ Individual patches for Vim 7.4: 13179 7.4.001 'ic' doesn't work for patterns such as [a-z] 2522 7.4.002 pattern with two alternative look-behind matches doesn't match 2680 7.4.003 memory access error in Ruby syntax highlighting + 7145 7.4.004 when closing a window fails ":bwipe" may hang + 1391 7.4.005 "vaB" while 'virtualedit' is set selects the wrong area diff --git a/vim.spec b/vim.spec index 60dc8a8..0a32944 100644 --- a/vim.spec +++ b/vim.spec @@ -1,4 +1,4 @@ -%define patchlevel 3 +%define patchlevel 5 %if %{?WITH_SELINUX:0}%{!?WITH_SELINUX:1} %define WITH_SELINUX 1 %endif @@ -50,6 +50,8 @@ BuildRequires: hunspell-devel Patch0001: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.001 Patch0002: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.002 Patch0003: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.003 +Patch0004: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.004 +Patch0005: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.005 Patch3000: vim-7.4-syntax.patch Patch3002: vim-7.1-nowarnings.patch @@ -198,6 +200,8 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk %patch001 -p0 %patch002 -p0 %patch003 -p0 +%patch004 -p0 +%patch005 -p0 # install spell files %if %{withvimspell} @@ -697,6 +701,11 @@ rm -rf %{buildroot} %{_datadir}/icons/hicolor/*/apps/* %changelog +* Wed Aug 21 2013 Karsten Hopp 7.4.5-1 +- patchlevel 5 +- when closing a window fails ":bwipe" may hang +- "vaB" while 'virtualedit' is set selects the wrong area + * Wed Aug 21 2013 Karsten Hopp 7.4.3-1 - patchlevel 3, memory access error in Ruby syntax highlighting