To: vim-dev@vim.org Subject: Patch 6.3a.002 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.3a.002 Problem: NetBeans: An insert command from NetBeans beyond the end of a buffer crashes Vim. (Xavier de Gaye) Solution: Use a local pos_T structure for the position. Files: src/netbeans.c *** ../vim-6.3a.001/src/netbeans.c Fri May 7 10:59:38 2004 --- src/netbeans.c Fri May 7 17:02:11 2004 *************** *** 1442,1447 **** --- 1442,1448 ---- else if (streq((char *)cmd, "insert")) { pos_T *pos; + pos_T mypos; char_u *to_free; char_u *nl; int lnum; *************** *** 1509,1518 **** else { /* if the given position is not found, assume we want ! * the end of the file. See setLocAndSize HACK. ! */ pos->lnum = buf->bufp->b_ml.ml_line_count; ! nbdebug((" POSITION: line = %d (EOF)\n",pos->lnum)); } lnum = pos->lnum; old_w_cursor = curwin->w_cursor; --- 1510,1523 ---- else { /* if the given position is not found, assume we want ! * the end of the file. See setLocAndSize HACK. */ ! pos = &mypos; ! pos->col = 0; ! #ifdef FEAT_VIRTUALEDIT ! pos->coladd = 0; ! #endif pos->lnum = buf->bufp->b_ml.ml_line_count; ! nbdebug((" POSITION: line = %d (EOF)\n", pos->lnum)); } lnum = pos->lnum; old_w_cursor = curwin->w_cursor; *** ../vim-6.3a.001/src/version.c Fri May 7 12:23:33 2004 --- src/version.c Fri May 7 17:04:48 2004 *************** *** 643,644 **** --- 643,646 ---- { /* Add new patch number below this line */ + /**/ + 2, /**/ -- "Hit any key to continue" it said, but nothing happened after F sharp. /// 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 at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///