vim-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 vim/vim#9967)

36a5b6867b

Most code and test changes are reverted or modified again in patch
8.2.4603, so only port parts that are untouched in patch 8.2.4603.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
zeertzjq
2025-02-28 13:40:26 +08:00
parent 9b25c68db2
commit a3a9f86d4a
6 changed files with 48 additions and 16 deletions

View File

@@ -759,7 +759,7 @@ void fill_evalarg_from_eap(evalarg_T *evalarg, exarg_T *eap, bool skip)
return;
}
if (getline_equal(eap->ea_getline, eap->cookie, getsourceline)) {
if (sourcing_a_script(eap)) {
evalarg->eval_getline = eap->ea_getline;
evalarg->eval_cookie = eap->cookie;
}