To: vim-dev@vim.org Subject: Patch 6.2.087 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.087 Problem: CTRL-^ doesn't use the 'confirm' option. Same problem with ":bnext". (Yakov Lerner) Solution: Put up a dialog for a changed file when 'confirm' is set in more situations. Files: src/buffer.c, src/ex_cmds.c *** ../vim-6.2.086/src/buffer.c Thu Sep 11 21:08:22 2003 --- src/buffer.c Sun Sep 7 23:17:03 2003 *************** *** 963,971 **** if (!forceit && bufIsChanged(buf)) { ! EMSGN(_("E89: No write since last change for buffer %ld (add ! to override)"), ! buf->b_fnum); ! return FAIL; } /* --- 963,986 ---- if (!forceit && bufIsChanged(buf)) { ! #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) ! if ((p_confirm || cmdmod.confirm) && p_write) ! { ! dialog_changed(buf, FALSE); ! # ifdef FEAT_AUTOCMD ! if (!buf_valid(buf)) ! /* Autocommand deleted buffer, oops! It's not changed ! * now. */ ! return FAIL; ! # endif ! } ! if (bufIsChanged(buf)) ! #endif ! { ! EMSGN(_("E89: No write since last change for buffer %ld (add ! to override)"), ! buf->b_fnum); ! return FAIL; ! } } /* *************** *** 1162,1169 **** */ if (action == DOBUF_GOTO && !can_abandon(curbuf, forceit)) { ! EMSG(_(e_nowrtmsg)); ! return FAIL; } /* Go to the other buffer. */ --- 1177,1198 ---- */ if (action == DOBUF_GOTO && !can_abandon(curbuf, forceit)) { ! #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) ! if ((p_confirm || cmdmod.confirm) && p_write) ! { ! dialog_changed(curbuf, FALSE); ! # ifdef FEAT_AUTOCMD ! if (!buf_valid(buf)) ! /* Autocommand deleted buffer, oops! */ ! return FAIL; ! # endif ! } ! if (bufIsChanged(curbuf)) ! #endif ! { ! EMSG(_(e_nowrtmsg)); ! return FAIL; ! } } /* Go to the other buffer. */ *** ../vim-6.2.086/src/ex_cmds.c Tue Sep 9 22:48:37 2003 --- src/ex_cmds.c Tue Sep 9 22:03:12 2003 *************** *** 2464,2474 **** if (other && !forceit && curbuf->b_nwindows == 1 && !P_HID(curbuf) && curbufIsChanged() && autowrite(curbuf, forceit) == FAIL) { ! if (other) ! --no_wait_return; ! EMSG(_(e_nowrtmsg)); ! retval = 2; /* file has been changed */ ! goto theend; } if (other) --no_wait_return; --- 2464,2481 ---- if (other && !forceit && curbuf->b_nwindows == 1 && !P_HID(curbuf) && curbufIsChanged() && autowrite(curbuf, forceit) == FAIL) { ! #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) ! if (p_confirm && p_write) ! dialog_changed(curbuf, FALSE); ! if (curbufIsChanged()) ! #endif ! { ! if (other) ! --no_wait_return; ! EMSG(_(e_nowrtmsg)); ! retval = 2; /* file has been changed */ ! goto theend; ! } } if (other) --no_wait_return; *** ../vim-6.2.086/src/version.c Thu Sep 11 21:31:02 2003 --- src/version.c Thu Sep 11 21:32:40 2003 *************** *** 632,633 **** --- 632,635 ---- { /* Add new patch number below this line */ + /**/ + 87, /**/ -- Yesterday, all my deadlines seemed so far away now it looks as though it's freeze in four days oh I believe in cvs.. [ CVS log "Beatles style" for FreeBSD ports/INDEX, Satoshi Asami ] /// 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 /// \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///