Giter Site home page Giter Site logo

Comments (8)

gpanders avatar gpanders commented on May 24, 2024 1

I like this idea, and I don't think it would be too difficult to implement. Though I'd likely change run-before to require, so it would look like this:

<!-- name: library -->
```python
import numpy as np
```

<!-- target: array, require: library -->
```python
print(np.array([1,2,3]))
```

<!-- name: array -->
```
result
```

I'll take a look at implementing this when I have some time.

from vim-medieval.

gpanders avatar gpanders commented on May 24, 2024

Please give the require branch (#5) a try and let me know if you run into any issues. Also let me know if all looks well, and I'll merge it into master.

from vim-medieval.

dalbandea avatar dalbandea commented on May 24, 2024

Sorry, I found your plugin yesterday and I didn't have it installed. I'm testing some stuff now but there are some things not working for me (for example, :EvalBlock alone is not working, I'll see if I see why and if not I'll open another issue)

This is my configuration:

Plug 'gpanders/vim-medieval', { 'branch': 'require' }
let g:medieval_langs = ['python', 'sh', 'console=bash']

So far I can tell you that:

  • Your examples of require in the docs work if runned with :EvalBlock! or :EvalBlock output (with output being the name of the output block).
  • If you misspell the require code block, the block runs anyway but without the required code block, of course. This is nice I think, this way I can have a snippet with <!-- target: blabla, require: --> leave the require field blank if not necessary.
  • This is not working for me:
<!-- name: library -->
```sh
x=5
```
<!-- target: output, require: library -->
```sh
echo $x
```

But this works:

<!-- target: output, require: library -->
```sh
x=5
echo $x
```

As I said, I could only test with :EvalBlock! and :EvalBlock output.

And sorry again, since I don't know much bout vimscripting and cannot be of much help looking at the code.

from vim-medieval.

gpanders avatar gpanders commented on May 24, 2024

Your example wasn't working for me either, and I figured out why. It's a problem that only happens when the very first line is a block label (as in your example). I just pushed a fix for that, so please try again.

from vim-medieval.

dalbandea avatar dalbandea commented on May 24, 2024

It works now for me with :EvalBlock output and :EvalBlock!.

from vim-medieval.

dalbandea avatar dalbandea commented on May 24, 2024

It works correctly for me with :EvalBlock as well if I don't have

set clipboard=unnamed

in my vimrc.

from vim-medieval.

gpanders avatar gpanders commented on May 24, 2024

See my comment in #6.

from vim-medieval.

gpanders avatar gpanders commented on May 24, 2024

Merged in #5.

from vim-medieval.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.