Mercurial > vim
diff src/ops.c @ 15987:29de75f53b1a v8.1.0999
patch 8.1.0999: use register one too often and not properly tested
commit https://github.com/vim/vim/commit/9d7fdd403a3a9ee0d008b6dcbcd2ecc9ec0f57b7
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Mar 8 09:50:52 2019 +0100
patch 8.1.0999: use register one too often and not properly tested
Problem: Use register one too often and not properly tested.
Solution: Do not always use register one when specifying a register.
(closes #4085) Add more tests.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 08 Mar 2019 10:00:07 +0100 |
parents | ddd82b1c9e9d |
children | a14d8b4ef2b0 |
line wrap: on
line diff
--- a/src/ops.c +++ b/src/ops.c @@ -1747,7 +1747,6 @@ op_delete(oparg_T *oap) struct block_def bd; linenr_T old_lcount = curbuf->b_ml.ml_line_count; int did_yank = FALSE; - int orig_regname = oap->regname; if (curbuf->b_ml.ml_flags & ML_EMPTY) /* nothing to do */ return OK; @@ -1833,12 +1832,13 @@ op_delete(oparg_T *oap) /* * Put deleted text into register 1 and shift number registers if the - * delete contains a line break, or when a regname has been specified. + * delete contains a line break, or when using a specific operator (Vi + * compatible) * Use the register name from before adjust_clip_reg() may have * changed it. */ - if (orig_regname != 0 || oap->motion_type == MLINE - || oap->line_count > 1 || oap->use_reg_one) + if (oap->motion_type == MLINE || oap->line_count > 1 + || oap->use_reg_one) { shift_delete_registers(); if (op_yank(oap, TRUE, FALSE) == OK)