From a3a9f86d4a11029542a94b00044b5a181a68c9cd Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 28 Feb 2025 13:40:26 +0800 Subject: 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) https://github.com/vim/vim/commit/36a5b6867bb6c0bd69c8da7d788000ab8a0b0ab0 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 --- src/nvim/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 2b6fefbf82..ee5dd25e93 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -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; } -- cgit