To: vim_dev@googlegroups.com Subject: Patch 8.0.1765 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1765 Problem: CTRL-G j in Insert mode is incorrect when 'virtualedit' is set. Solution: Take coladd into account. (Christian Brabandt, closes #2743) Files: src/charset.c, src/testdir/test_virtualedit.vim *** ../vim-8.0.1764/src/charset.c 2018-03-29 16:03:46.616035925 +0200 --- src/charset.c 2018-04-25 21:59:10.012821767 +0200 *************** *** 1417,1423 **** colnr_T vcol; curwin->w_p_list = FALSE; ! getvcol(curwin, posp, NULL, &vcol, NULL); curwin->w_p_list = list_save; return vcol; } --- 1417,1428 ---- colnr_T vcol; curwin->w_p_list = FALSE; ! #ifdef FEAT_VIRTUALEDIT ! if (posp->coladd) ! getvvcol(curwin, posp, NULL, &vcol, NULL); ! else ! #endif ! getvcol(curwin, posp, NULL, &vcol, NULL); curwin->w_p_list = list_save; return vcol; } *** ../vim-8.0.1764/src/testdir/test_virtualedit.vim 2017-08-30 17:01:31.746483683 +0200 --- src/testdir/test_virtualedit.vim 2018-04-25 21:58:46.724941892 +0200 *************** *** 41,43 **** --- 41,61 ---- bwipe! set virtualedit= endfunc + + func Test_edit_CTRL_G() + new + set virtualedit=insert + call setline(1, ['123', '1', '12']) + exe "normal! ggA\jx\jx" + call assert_equal(['123', '1 x', '12 x'], getline(1,'$')) + + set virtualedit=all + %d_ + call setline(1, ['1', '12']) + exe "normal! ggllix\jx" + call assert_equal(['1 x', '12x'], getline(1,'$')) + + + bwipe! + set virtualedit= + endfunc *** ../vim-8.0.1764/src/version.c 2018-04-25 21:36:27.426594043 +0200 --- src/version.c 2018-04-25 22:01:12.336154813 +0200 *************** *** 763,764 **** --- 763,766 ---- { /* Add new patch number below this line */ + /**/ + 1765, /**/ -- A KNIGHT rides into shot and hacks him to the ground. He rides off. We stay for a moment on the glade. A MIDDLE-AGED LADY in a C. & A. twin-set emerges from the trees and looks in horror at the body of her HUSBAND. MRS HISTORIAN: FRANK! "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/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///