patch 9.0.1690: popup_create() not aborting on errors
Problem: popup_create() not aborting on errors
Solution: check for errors in arguments given and abort if an error
occurred
closes: #12711
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/dumps/Test_popupwin_with_error_1.dump b/src/testdir/dumps/Test_popupwin_with_error_1.dump
new file mode 100644
index 0000000..be9be32
--- /dev/null
+++ b/src/testdir/dumps/Test_popupwin_with_error_1.dump
@@ -0,0 +1,20 @@
+> +0&#ffffff0@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|E+0#ffffff16#e000002|7|1|4|:| |L|i|s|t| |r|e|q|u|i|r|e|d| +0#0000000#ffffff0@37|0|,|0|-|1| @8|A|l@1|
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 7e1a0fc..c0842f4 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -4179,5 +4179,22 @@
call StopVimInTerminal(buf)
endfunc
+func Test_popupwin_with_error()
+ CheckScreendump
+
+ let lines =<< trim END
+ let options = {'border': 'ERROR', 'line': 1, 'col': 1, 'minwidth': &columns, 'title': 'TITLE'}
+
+ END
+ "call popup_create('Hello world!', options)
+ call writefile(lines, 'XtestPopupError', 'D')
+ let buf = RunVimInTerminal('-S XtestPopupError', {})
+ call term_sendkeys(buf, ":call popup_create('Hello world!', options)\<CR>")
+ call VerifyScreenDump(buf, 'Test_popupwin_with_error_1', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2