To: vim_dev@googlegroups.com Subject: Patch 8.1.2059 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2059 Problem: Fix for "x" deleting a fold has side effects. Solution: Fix it where the fold is included. Files: src/normal.c *** ../vim-8.1.2058/src/normal.c 2019-09-17 22:42:51.997139914 +0200 --- src/normal.c 2019-09-20 13:14:14.039364017 +0200 *************** *** 1535,1541 **** { if (hasFolding(oap->start.lnum, &oap->start.lnum, NULL)) oap->start.col = 0; ! if (hasFolding(curwin->w_cursor.lnum, NULL, &curwin->w_cursor.lnum)) curwin->w_cursor.col = (colnr_T)STRLEN(ml_get_curline()); } --- 1535,1542 ---- { if (hasFolding(oap->start.lnum, &oap->start.lnum, NULL)) oap->start.col = 0; ! if ((curwin->w_cursor.col > 0 || oap->inclusive) ! && hasFolding(curwin->w_cursor.lnum, NULL, &curwin->w_cursor.lnum)) curwin->w_cursor.col = (colnr_T)STRLEN(ml_get_curline()); } *************** *** 6001,6008 **** else { if (has_mbyte) ! curwin->w_cursor.col += ! (*mb_ptr2len)(ml_get_cursor()); else ++curwin->w_cursor.col; } --- 6002,6008 ---- else { if (has_mbyte) ! curwin->w_cursor.col += (*mb_ptr2len)(ml_get_cursor()); else ++curwin->w_cursor.col; } *************** *** 7400,7412 **** { if (cap->count0) stuffnumReadbuff(cap->count0); ! // If on an empty line and using 'x' and "l" is included in the ! // whichwrap option, do not delete the next line. ! if (cap->cmdchar == 'x' && vim_strchr(p_ww, 'l') != NULL ! && gchar_cursor() == NUL) ! stuffReadbuff((char_u *)"dd"); ! else ! stuffReadbuff(ar[(int)(vim_strchr(str, cap->cmdchar) - str)]); } } cap->opcount = 0; --- 7400,7406 ---- { if (cap->count0) stuffnumReadbuff(cap->count0); ! stuffReadbuff(ar[(int)(vim_strchr(str, cap->cmdchar) - str)]); } } cap->opcount = 0; *** ../vim-8.1.2058/src/version.c 2019-09-19 23:21:48.233926270 +0200 --- src/version.c 2019-09-20 13:39:55.792984862 +0200 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 2059, /**/ -- ### Hiroshima 45, Chernobyl 86, Windows 95 ### /// 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 ///