comparison src/register.c @ 18771:50fde4e20790 v8.1.2375

patch 8.1.2375: no suffucient testing for registers Commit: https://github.com/vim/vim/commit/6f1f0ca3edf395102ff3109c998d81300c8be3c9 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Dec 1 18:16:18 2019 +0100 patch 8.1.2375: no suffucient testing for registers Problem: No suffucient testing for registers. Solution: Add more test cases. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5296) Fix that "p" on last virtual column of tab inserts spaces.
author Bram Moolenaar <Bram@vim.org>
date Sun, 01 Dec 2019 18:30:03 +0100
parents 788d76db02ac
children 8dabdfc7c799
comparison
equal deleted inserted replaced
18770:796651a5d437 18771:50fde4e20790
1666 1666
1667 if (ve_flags == VE_ALL && y_type == MCHAR) 1667 if (ve_flags == VE_ALL && y_type == MCHAR)
1668 { 1668 {
1669 if (gchar_cursor() == TAB) 1669 if (gchar_cursor() == TAB)
1670 { 1670 {
1671 int viscol = getviscol();
1672 int ts = curbuf->b_p_ts;
1673
1671 // Don't need to insert spaces when "p" on the last position of a 1674 // Don't need to insert spaces when "p" on the last position of a
1672 // tab or "P" on the first position. 1675 // tab or "P" on the first position.
1676 if (dir == FORWARD ?
1673 #ifdef FEAT_VARTABS 1677 #ifdef FEAT_VARTABS
1674 int viscol = getviscol(); 1678 tabstop_padding(viscol, ts, curbuf->b_p_vts_array) != 1
1675 if (dir == FORWARD 1679 #else
1676 ? tabstop_padding(viscol, curbuf->b_p_ts, 1680 ts - (viscol % ts) != 1
1677 curbuf->b_p_vts_array) != 1 1681 #endif
1678 : curwin->w_cursor.coladd > 0) 1682 : curwin->w_cursor.coladd > 0)
1679 coladvance_force(viscol); 1683 coladvance_force(viscol);
1680 #else
1681 if (dir == FORWARD
1682 ? (int)curwin->w_cursor.coladd < curbuf->b_p_ts - 1
1683 : curwin->w_cursor.coladd > 0)
1684 coladvance_force(getviscol());
1685 #endif
1686 else 1684 else
1687 curwin->w_cursor.coladd = 0; 1685 curwin->w_cursor.coladd = 0;
1688 } 1686 }
1689 else if (curwin->w_cursor.coladd > 0 || gchar_cursor() == NUL) 1687 else if (curwin->w_cursor.coladd > 0 || gchar_cursor() == NUL)
1690 coladvance_force(getviscol() + (dir == FORWARD)); 1688 coladvance_force(getviscol() + (dir == FORWARD));