patch 8.2.3475: expression register set by not executed put command
Problem: Expression register set by not executed put command.
Solution: Do not set the register if the command is skipped. (closes #8909)
diff --git a/src/testdir/test_excmd.vim b/src/testdir/test_excmd.vim
index b080575..c3a911f 100644
--- a/src/testdir/test_excmd.vim
+++ b/src/testdir/test_excmd.vim
@@ -647,4 +647,12 @@
endif
endfunc
+func Test_not_break_expression_register()
+ call setreg('=', '1+1')
+ if 0
+ put =1
+ endif
+ call assert_equal('1+1', getreg('=', 1))
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab