aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-10 23:28:09 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-10-10 23:54:51 +0800
commit62a0c9f8c24b9115155cd4551976353ace3e2c5e (patch)
tree9ae12e34472a4aa6dae4cfb381a0648705b1351d
parent2cc64dca9242ffd887ae61dd89e59d9a0ce17b98 (diff)
downloadrneovim-62a0c9f8c24b9115155cd4551976353ace3e2c5e.tar.gz
rneovim-62a0c9f8c24b9115155cd4551976353ace3e2c5e.tar.bz2
rneovim-62a0c9f8c24b9115155cd4551976353ace3e2c5e.zip
vim-patch:partial:9.0.0715: wrong argument for append() gives two error messages
Problem: Wrong argument for append() gives two error messages. Solution: When getting an error for a number argument don't try using it as a string. (closes vim/vim#11335) https://github.com/vim/vim/commit/801cd35e7e3b21e519e12a1610ee1d721e40893e Skip test as it depends on too many previous patches.
-rw-r--r--src/nvim/eval/typval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c
index ead86757b3..a0b06aaaf4 100644
--- a/src/nvim/eval/typval.c
+++ b/src/nvim/eval/typval.c
@@ -3750,8 +3750,9 @@ varnumber_T tv_get_number_chk(const typval_T *const tv, bool *const ret_error)
linenr_T tv_get_lnum(const typval_T *const tv)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
{
+ const int did_emsg_before = did_emsg;
linenr_T lnum = (linenr_T)tv_get_number_chk(tv, NULL);
- if (lnum <= 0 && tv->v_type != VAR_NUMBER) {
+ if (lnum <= 0 && did_emsg_before == did_emsg && tv->v_type != VAR_NUMBER) {
int fnum;
// No valid number, try using same function as line() does.
pos_T *const fp = var2fpos(tv, true, &fnum, false);