RFC: Add session option#27
Conversation
|
This is an RFC for adding session support to vim-medieval. It's currently quite It currently has some checks in there for python (because that's what I use in This should probably be integrated into |
|
The main problem this is trying to address is where something is either costly Using require here would make the print block always take 5 seconds, whereas |
Adds a session option to codeblocks so previous results can be used. To check that a command is done running, we wait for an eof_token to appear. This allows us to not cut off commands with output early, but also doesn't rely on using sleep. **This commit does not support neovim**
Splits up retrieving the data from s:session_read_cb into separate helper functions for vim and nvim.
The use case makes sense to me. Though I think you should already be able to solve this today with no changes. For example, something like this: <!-- target: a -->
```python
import random
import time
time.sleep(5)
x = 42
print(f"x={x}")
```
<!-- name: a
```python
```
-->
<!-- require: a -->
```python
import random
print(random.randint(1, x))
```I understand this is a contrived example, but the basic idea is: in the first (expensive) block, write code to a temporary block ( Note that the |
|
That would probably solve a lot of cases. But I feel like it might run into Something like the following wouldn't work: It also seems rather cumbersome to have to add all the print statements one |
Adds a session option to codeblocks so previous results can be used.
To check that a command is done running, we wait for an eof_token to appear. This allows us to not cut off commands with output early, but also doesn't rely on using sleep.