aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-11-21 12:02:05 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-11-21 15:35:04 -0500
commit5a4f049c38ef41a49991162df73a10b9ac50b50d (patch)
tree9a9ea9f6e3a1726aea3c4bcc41590b6fd4c7e82b
parent5ea38abd533735e0173d35684c03285745048054 (diff)
downloadrneovim-5a4f049c38ef41a49991162df73a10b9ac50b50d.tar.gz
rneovim-5a4f049c38ef41a49991162df73a10b9ac50b50d.tar.bz2
rneovim-5a4f049c38ef41a49991162df73a10b9ac50b50d.zip
vim-patch:8.2.2029: Coverity warns for not checking return value
Problem: Coverity warns for not checking return value. Solution: Check that u_save_cursor() returns OK. https://github.com/vim/vim/commit/5546688fb6798d37a770f366c13dedfa7e4cb417
-rw-r--r--src/nvim/normal.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index aeada66964..0293bb4a73 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -1847,13 +1847,12 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank)
CancelRedo();
} else {
(void)op_delete(oap);
- if (oap->motion_type == kMTLineWise && has_format_option(FO_AUTO)) {
- // cursor line wasn't saved yet
- if (u_save_cursor() == FAIL) {
- break;
- }
+ // save cursor line for undo if it wasn't saved yet
+ if (oap->motion_type == kMTLineWise
+ && has_format_option(FO_AUTO)
+ && u_save_cursor() == OK) {
+ auto_format(false, true);
}
- auto_format(false, true);
}
break;