0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.4594: need to write script to a file to be able to source them

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)
This commit is contained in:
Yegappan Lakshmanan
2022-03-19 12:56:51 +00:00
committed by Bram Moolenaar
parent 95d2e7634c
commit 36a5b6867b
11 changed files with 530 additions and 19 deletions

View File

@@ -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;