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)
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index ce88a10..a775af0 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -197,6 +197,12 @@
:so[urce] {file} Read Ex commands from {file}. These are commands that
start with a ":".
Triggers the |SourcePre| autocommand.
+
+:[range]so[urce] Read Ex commands from the [range] of lines in the
+ current buffer. When sourcing commands from the
+ current buffer, the same script-ID |<SID>| is used
+ even if the buffer is sourced multiple times.
+
*:source!*
:so[urce]! {file} Read Vim commands from {file}. These are commands
that are executed from Normal mode, like you type
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 5a97051..57a84e5 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -4333,12 +4333,6 @@
restore option values. Especially useful for new options. Problem: how
to avoid a performance penalty (esp. for string options)?
- range for ":exec", pass it on to the executed command. (Webb)
-8 ":{range}source": source the lines from the current file.
- You can already yank lines and use :@" to execute them.
- Most of do_source() would not be used, need a new function.
- It's easy when not doing breakpoints or profiling.
- Requires copying the lines into a list and then creating a function to
- execute lines from the list. Similar to getnextac().
7 ":include" command: just like ":source" but doesn't start a new scriptID?
Will be tricky for the list of script names.
8 Have a look at VSEL. Would it be useful to include? (Bigham)