Home Download Buy Blog Forum Support

Live view/preview of Lua?

Live view/preview of Lua?

Postby mlepage on Thu Sep 12, 2013 6:03 pm

I know that ST can do a browser view/preview that updates live as you edit HTML or CSS.

I also know that ST can be configured with a build system which runs Lua and displays its output in a console.

Is there a way to configure ST such that I can have a split pane with Lua on one side, and a live view/preview of the output of running that Lua code on the other side? Just like the HTML/CSS view, where as I edit Lua source code, I see the Lua output change?
mlepage
 
Posts: 25
Joined: Tue Sep 03, 2013 2:30 pm

Re: Live view/preview of Lua?

Postby Astrophizz on Thu Sep 12, 2013 10:56 pm

Would SublimeREPL be what you're looking for? https://sublime.wbond.net/packages/SublimeREPL
Astrophizz
 
Posts: 4
Joined: Mon Aug 12, 2013 7:25 pm

Re: Live view/preview of Lua?

Postby mlepage on Sat Sep 14, 2013 9:23 pm

Sort of but not quite.

It seems that opens an REPL in another frame, and you can use keystrokes to copy/paste your code into it to run.

I want it to do that automatically every time I change a character in the code, so I can always see its output.
mlepage
 
Posts: 25
Joined: Tue Sep 03, 2013 2:30 pm

Re: Live view/preview of Lua?

Postby mlepage on Wed Sep 18, 2013 1:12 am

Does anyone know what is the mechanism by which the live HTML/CSS views work? Like which APIs they use to launch them? Starting points for if one were to try to make a similar live view that wasn't HTML/CSS?
mlepage
 
Posts: 25
Joined: Tue Sep 03, 2013 2:30 pm

Re: Live view/preview of Lua?

Postby edubkendo on Fri Sep 20, 2013 9:42 pm

Take a look at this: https://sublime.wbond.net/packages/SublimeOnSaveBuild

There are actually a ton of plugins that will get you 90% of what you want, in various ways. Just search around for generic solutions, then make it specific to lua.
edubkendo
 
Posts: 30
Joined: Fri May 18, 2012 2:43 pm
Location: Nashville

Re: Live view/preview of Lua?

Postby mlepage on Sun Sep 22, 2013 6:45 pm

That looks interesting, but I want to update the view whenever I type a character, not just when I save. This is what the web view does. I am wondering how I can replicate it, but with an output view that isn't web.
mlepage
 
Posts: 25
Joined: Tue Sep 03, 2013 2:30 pm

Re: Live view/preview of Lua?

Postby mlepage on Fri Sep 27, 2013 9:18 pm

At lunch I did some reading about the plug-in API and managed to get a command invoked for every modification of the document. That's a first step. Now I'm just working on making the command do what I want it to do, in another view. (Presumably that can be done.) So the docs are extremely sketchy but I am making progress on my dream.
mlepage
 
Posts: 25
Joined: Tue Sep 03, 2013 2:30 pm

Re: Live view/preview of Lua?

Postby mlepage on Sun Sep 29, 2013 2:24 am

OK yesterday and today I hacked up a simple plug-in to do what I want.

Announcement/discussion:
viewtopic.php?f=5&t=14235

Get it here:
https://github.com/mlepage/st3-live-view
mlepage
 
Posts: 25
Joined: Tue Sep 03, 2013 2:30 pm


Return to General Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests