To: vim-dev@vim.org Subject: Patch 6.3.058 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.3.058 Problem: When 'foldcolumn' is equal to the window width and 'wrap' is on Vim may crash. Disabling the vertical split feature breaks compiling. (Peter Winters) Solution: Check for zero room for wrapped text. Make compiling without vertical splits possible. Files: src/move.c, src/quickfix.c, src/screen.c, src/netbeans.c *** ../vim-6.3.057/src/move.c Mon Dec 6 11:51:12 2004 --- src/move.c Thu Jan 13 19:16:32 2005 *************** *** 871,880 **** /* long line wrapping, adjust curwin->w_wrow */ if (curwin->w_p_wrap && col >= (colnr_T)W_WIDTH(curwin) ! #ifdef FEAT_VERTSPLIT ! && curwin->w_width != 0 ! #endif ! ) { col -= W_WIDTH(curwin); col = col % (W_WIDTH(curwin) - off + curwin_col_off2()); --- 871,877 ---- /* long line wrapping, adjust curwin->w_wrow */ if (curwin->w_p_wrap && col >= (colnr_T)W_WIDTH(curwin) ! && W_WIDTH(curwin) - off + curwin_col_off2() > 0) { col -= W_WIDTH(curwin); col = col % (W_WIDTH(curwin) - off + curwin_col_off2()); *** ../vim-6.3.057/src/quickfix.c Wed Jun 9 14:56:26 2004 --- src/quickfix.c Thu Jan 13 19:19:21 2005 *************** *** 1680,1687 **** --- 1680,1689 ---- else if (buf != curbuf) set_curbuf(buf, DOBUF_GOTO); + #ifdef FEAT_VERTSPLIT /* Only set the height when there is no window to the side. */ if (curwin->w_width == Columns) + #endif win_setheight(height); curwin->w_p_wfh = TRUE; /* set 'winfixheight' */ if (win_valid(win)) *** ../vim-6.3.057/src/screen.c Thu Dec 16 12:48:12 2004 --- src/screen.c Thu Jan 13 19:21:40 2005 *************** *** 1906,1913 **** if (n > 0) { /* draw the fold column at the right */ ! if (n > wp->w_width) ! n = wp->w_width; screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow, W_ENDCOL(wp) - n, (int)W_ENDCOL(wp), ' ', ' ', hl_attr(HLF_FC)); --- 1906,1913 ---- if (n > 0) { /* draw the fold column at the right */ ! if (n > W_WIDTH(wp)) ! n = W_WIDTH(wp); screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow, W_ENDCOL(wp) - n, (int)W_ENDCOL(wp), ' ', ' ', hl_attr(HLF_FC)); *************** *** 1919,1926 **** int nn = n + 2; /* draw the sign column left of the fold column */ ! if (nn > wp->w_width) ! nn = wp->w_width; screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow, W_ENDCOL(wp) - nn, (int)W_ENDCOL(wp) - n, ' ', ' ', hl_attr(HLF_SC)); --- 1919,1926 ---- int nn = n + 2; /* draw the sign column left of the fold column */ ! if (nn > W_WIDTH(wp)) ! nn = W_WIDTH(wp); screen_fill(W_WINROW(wp) + row, W_WINROW(wp) + endrow, W_ENDCOL(wp) - nn, (int)W_ENDCOL(wp) - n, ' ', ' ', hl_attr(HLF_SC)); *** ../vim-6.3.057/src/netbeans.c Wed Jun 9 14:56:26 2004 --- src/netbeans.c Thu Jan 13 19:22:30 2005 *************** *** 2693,2699 **** if (bufno >= 0 && curwin != NULL && curwin->w_buffer == curbuf) { ! int col = mouse_col - curwin->w_wincol - (curwin->w_p_nu ? 9 : 1); long off = pos2off(curbuf, &curwin->w_cursor); /* sync the cursor position */ --- 2693,2699 ---- if (bufno >= 0 && curwin != NULL && curwin->w_buffer == curbuf) { ! int col = mouse_col - W_WINCOL(curwin) - (curwin->w_p_nu ? 9 : 1); long off = pos2off(curbuf, &curwin->w_cursor); /* sync the cursor position */ *** ../vim-6.3.057/src/version.c Thu Jan 13 17:38:30 2005 --- src/version.c Tue Jan 18 10:49:55 2005 *************** *** 643,644 **** --- 643,646 ---- { /* Add new patch number below this line */ + /**/ + 58, /**/ -- TALL KNIGHT: Firstly. You must get us another shrubbery! OTHER KNIGHTS: More shrubberies! More shrubberies for the ex-Knights of Ni! ARTHUR: Not another shrubbery - "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///