To: vim_dev@googlegroups.com Subject: Patch 8.0.0523 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0523 Problem: dv} deletes part of a multi-byte character. (Urtica Dioica) Solution: Include the whole character. Files: src/search.c, src/testdir/test_normal.vim *** ../vim-8.0.0522/src/search.c 2017-03-16 17:23:26.835815782 +0100 --- src/search.c 2017-03-29 19:39:23.666307037 +0200 *************** *** 2851,2859 **** curwin->w_cursor.lnum = curr; if (curr == curbuf->b_ml.ml_line_count && what != '}') { ! if ((curwin->w_cursor.col = (colnr_T)STRLEN(ml_get(curr))) != 0) { --curwin->w_cursor.col; *pincl = TRUE; } } --- 2851,2867 ---- curwin->w_cursor.lnum = curr; if (curr == curbuf->b_ml.ml_line_count && what != '}') { ! char_u *line = ml_get(curr); ! ! /* Put the cursor on the last character in the last line and make the ! * motion inclusive. */ ! if ((curwin->w_cursor.col = (colnr_T)STRLEN(line)) != 0) { --curwin->w_cursor.col; + #ifdef FEAT_MBYTE + curwin->w_cursor.col -= + (*mb_head_off)(line, line + curwin->w_cursor.col); + #endif *pincl = TRUE; } } *** ../vim-8.0.0522/src/testdir/test_normal.vim 2017-03-29 13:08:31.011872289 +0200 --- src/testdir/test_normal.vim 2017-03-29 19:42:18.841272925 +0200 *************** *** 2290,2292 **** --- 2290,2304 ---- normal 6666666666dL bwipe! endfunc + + func Test_delete_until_paragraph() + if !has('multi_byte') + return + endif + new + normal grádv} + call assert_equal('á', getline(1)) + normal grád} + call assert_equal('', getline(1)) + bwipe! + endfunc *** ../vim-8.0.0522/src/version.c 2017-03-29 19:20:25.389015062 +0200 --- src/version.c 2017-03-29 19:31:00.925272375 +0200 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 523, /**/ -- hundred-and-one symptoms of being an internet addict: 234. You started college as a chemistry major, and walk out four years later as an Internet provider. /// 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 ///