From 5a4f049c38ef41a49991162df73a10b9ac50b50d Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 21 Nov 2020 12:02:05 -0500 Subject: 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 --- src/nvim/normal.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') 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; -- cgit