summaryrefslogtreecommitdiff
path: root/src/vim9script.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-03-19 12:56:51 +0000
committerBram Moolenaar <Bram@vim.org>2022-03-19 12:56:51 +0000
commit36a5b6867bb6c0bd69c8da7d788000ab8a0b0ab0 (patch)
treefbf0b74c593ab218dc3c66856d13edb2695128b1 /src/vim9script.c
parent95d2e7634ccd8e0da78086002509a856999e180c (diff)
downloadvim-git-36a5b6867bb6c0bd69c8da7d788000ab8a0b0ab0.tar.gz
patch 8.2.4594: need to write script to a file to be able to source themv8.2.4594
Problem: Need to write script to a file to be able to source them. Solution: Make ":source" use lines from the current buffer. (Yegappan Lakshmanan et al., closes #9967)
Diffstat (limited to 'src/vim9script.c')
-rw-r--r--src/vim9script.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vim9script.c b/src/vim9script.c
index 6dce5722a..870056fcc 100644
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -71,7 +71,7 @@ ex_vim9script(exarg_T *eap UNUSED)
int found_noclear = FALSE;
char_u *p;
- if (!getline_equal(eap->getline, eap->cookie, getsourceline))
+ if (!sourcing_a_script(eap))
{
emsg(_(e_vim9script_can_only_be_used_in_script));
return;
@@ -633,7 +633,7 @@ ex_import(exarg_T *eap)
char_u *cmd_end;
evalarg_T evalarg;
- if (!getline_equal(eap->getline, eap->cookie, getsourceline))
+ if (!sourcing_a_script(eap))
{
emsg(_(e_import_can_only_be_used_in_script));
return;