boltex / leojs

Leo Literate Editor with Outline in Typescript
https://boltex.github.io/leojs/
MIT License
28 stars 1 forks source link

Script Buttons Should Not Be Added If Their Code Cannot Compile #84

Open tbpassin opened 9 months ago

tbpassin commented 9 months ago

I noticed that when I open an outline, I see buttons that I've defined in myLeoSettings.leo. But they don't work since they contain Python code that works with Leo. Also, the right-click goto Script does not work with them.

These buttons should not be shown.

boltex commented 9 months ago

Thanks for this. I'll look into it.

The 'goto script' that does not lead to the nodes is weird... Does it also do that for newly created buttons? (with the '+ script-button' button?) Or just with buttons created upon loading the file?

tbpassin commented 9 months ago

I don't know about buttons created by the "script-button" button. I know that the goto script capability works for buttons created by @button nodes.

boltex commented 9 months ago

@tbpassin

I'm not sure I understand this issue. I'm not aware of many of Leo's possible usage, so this might be one of those instance where someone uses Leo in a way that I'm totally unaware of... and so, I don't see what is happening from such a short issue description.

Can you restate what the issue is in a much more verbose way, and provide more context, screenshots and sample file, or sample code?

boltex commented 9 months ago

@tbpassin Oh! I see what you mean: buttons in myLeoSettings file can also be child of an at buttons (plural) to be seen in all opened files. and the goto-script should open it and focus on the button. image

Thanks again for this issue! :)

tbpassin commented 9 months ago

Yes, just so.

boltex commented 8 months ago

@tbpassin ~The part about goto-script for script originating in @buttons (plural) in myLeosettings is now fixed in the latest beta version 0.2.10~

~Also, the part about not running if the code is python is being fixed in #74 (branch 'boltex/issue/74 )~

~I'll close this issue when #74 is released in the next version (likely 0.2.11)~

boltex commented 8 months ago

@tbpassin I'll leave this opened, as you requested to try to 'compile', instead of just detecting the @language in effect. (which I added in latest 'dev' commits of #74)