Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This snippet starts a code that eats up the text #25

Closed
danielo515 opened this issue Mar 31, 2015 · 11 comments
Closed

This snippet starts a code that eats up the text #25

danielo515 opened this issue Mar 31, 2015 · 11 comments
Assignees
Labels

Comments

@danielo515
Copy link

I don't know why this is happening, but it is at least curious.

Here is the simplified snippet:

[[selected=Wrap|this is some example text=[[counter=test_counter]], more text= [[counter=test_counter|0]] where somevariable=|;]]

The intention is to wrap a list of values with the text I put there using a counter.
This produces an endless loop that eats the text. Just try it out, but you have to kill lintalist after it.

@lintalist
Copy link
Owner

You're really testing Lintalist to the limit and beyond :-) I was aware of that bug as currently you can't nest plugins, the only plugin you can use within another plugin (nest) is the [[var=]] plugin as these are preprocessed before the actual plugins are handled. As I didn't expect people to nest plugins I didn't mention it in the docs.

Currently I'm using a quick & dirty hack to obtain the plugin string from the snippet, that currently fails if they are nested, I've already started working on a better parser for this but it will mean I have to rewrite various sections to incorporate it but I'm confident I can fix it so nesting will be allowed.

@lintalist lintalist self-assigned this Mar 31, 2015
@danielo515
Copy link
Author

Hello @lintalist

You're really testing Lintalist to the limit and beyond :-)

Yes, I used to do that with the software I love. Lintalist is saving me lot of time on the work and it deserves the investment. Well, to be fair I don't know if it is saving me time or it is just making me have fun because I spend a lot of time fine-tuning it and exploring int.

As I didn't expect people to nest plugins I didn't mention it in the docs.

That is part of the past 😸

Glad you are aware of it and are keen to fix it.

@danielo515
Copy link
Author

Hello again @lintalist ,

Thinking about this and maybe what I suggested on #26 would partially solve this issue. I'm talking about letting the plugins to set variables. Currently to use the value provided by a plugin several times you just write the same plugin invocation where you need it. This can cause people to nest plugins. Setting variables will allow snippet writers to request information once and use it on several places. You have pointed it out a bit at #23 and the [[sp=1]] syntax.
What do you think about it?

@lintalist
Copy link
Owner

Managed to fix this specific usage case - beta release 2 https://github.com/lintalist/lintalist/archive/dev.zip

@lintalist lintalist reopened this Apr 3, 2015
@danielo515
Copy link
Author

Do you mean that is possible to nest plugins or that this snippet is now working ?

@lintalist
Copy link
Owner

This snippet should be working now, nesting in general isn't yet.

@danielo515
Copy link
Author

I can confirm this is working now. Will it continue working if I change it in any way? I mean, if I change the counter by another widget, will it work? And if I use another plugin instead of wrap but I keep the counters... will it work?

@lintalist
Copy link
Owner

All I can say it depends and you'll have to try it out - here I fixed an error in the selected plugin + to make it work with the counter I made sure the counter plugins is processed before the selected one. Calc and C are processed last so I'm pretty sure it will fail if you use those. Input should be fine for example.

Working on the parsing, making some progress but slow going as it takes some rewriting.

@danielo515
Copy link
Author

Working on the parsing, making some progress but slow going as it takes some rewriting.

No stress, I just wanted to know what is expected to work and what not.
I was gonig to open an issue to ask for "conditional" parts to execute. This can be partially achieved with the choice plugin and the ability to nest plugins. Good to know that this is going on.

@danielo515
Copy link
Author

I think you can close this ticket.

@lintalist
Copy link
Owner

Fixed in v1.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants