aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-01-13 18:26:36 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-01-14 07:31:21 +0800
commite1b557d9130c94f72c2d836bf814a884c470809f (patch)
tree2cf2f5bb7ba1e498f91f1eeb13c3ada821d97776 /src/nvim/ops.c
parent9b04336445c85b5bc4920d18072066e8ad01d6af (diff)
downloadrneovim-e1b557d9130c94f72c2d836bf814a884c470809f.tar.gz
rneovim-e1b557d9130c94f72c2d836bf814a884c470809f.tar.bz2
rneovim-e1b557d9130c94f72c2d836bf814a884c470809f.zip
vim-patch:8.1.2375: no suffucient testing for registers
Problem: No suffucient testing for registers. Solution: Add more test cases. (Yegappan Lakshmanan, closes vim/vim#5296) Fix that "p" on last virtual column of tab inserts spaces. https://github.com/vim/vim/commit/6f1f0ca3edf395102ff3109c998d81300c8be3c9 This patch doesn't actually change any behavior in Nvim, because Nvim always has vartabs feature. I modified a line in the test because of #6137.
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 013a78bdac..1a12cb636a 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -3154,11 +3154,12 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags)
if (ve_flags == VE_ALL && y_type == kMTCharWise) {
if (gchar_cursor() == TAB) {
- /* Don't need to insert spaces when "p" on the last position of a
- * tab or "P" on the first position. */
int viscol = getviscol();
+ long ts = curbuf->b_p_ts;
+ // Don't need to insert spaces when "p" on the last position of a
+ // tab or "P" on the first position.
if (dir == FORWARD
- ? tabstop_padding(viscol, curbuf->b_p_ts, curbuf->b_p_vts_array) != 1
+ ? tabstop_padding(viscol, ts, curbuf->b_p_vts_array) != 1
: curwin->w_cursor.coladd > 0) {
coladvance_force(viscol);
} else {