I built this so for sublime text 3 in windows

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Bunnybacon
Prole
Posts: 20
Joined: Fri Mar 25, 2016 8:42 am

Re: I built this so for sublime text 3 in windows

Post by Bunnybacon »

Very cool! I have been struggling to get my console to work when launching through sublime. Will check it out when I get home!
SomeT
Prole
Posts: 9
Joined: Wed Aug 30, 2017 8:56 pm

Re: I built this so for sublime text 3 in windows

Post by SomeT »

If you need any further help let me know.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: I built this so for sublime text 3 in windows

Post by grump »

put require = conf.lua at the top of your main.lua file as well
That is not valid Lua syntax. You probably mean require("conf.lua"). I don't think it is helpful to do this though, since love already did it before main.lua is even loaded.
Does not seem to run properly if the game directory has spaces in it
Try this:

Code: Select all

"shell_cmd": "start cmd /c love \"${project_path}\" & pause",
(untested since I don't have Sublime on Windows, but it should do the trick)

If you change file_regex to this:

Code: Select all

"file_regex": "^(?:Error: |\\t)([^: ]+?):(\\d+):() ([^:]*)$"
, then it captures the stack traceback as well and enables to step through it with F4, or click on a line in the output and jump to the location. I have removed the first non-capturing group from your regex, because I think it's not needed. Not sure though.
SomeT
Prole
Posts: 9
Joined: Wed Aug 30, 2017 8:56 pm

Re: I built this so for sublime text 3 in windows

Post by SomeT »

Thanks will give it a try and update it if it works, some of the stuff I added in more as fail safes than anything thus why I commented them out.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: I built this so for sublime text 3 in windows

Post by grump »

Oh, and add this to make it work in Linux:

Code: Select all

"linux": {
    "shell_cmd": "love ${project_path}",
},
SomeT
Prole
Posts: 9
Joined: Wed Aug 30, 2017 8:56 pm

Re: I built this so for sublime text 3 in windows

Post by SomeT »

That seems to work on Windows, not sure how to add variants to a build system to be honest, having trouble interpreting this page http://docs.sublimetext.info/en/latest/ ... ic-options and getting it working additionally I don't have a linux system to test it on right now, going to upload to github in an hour or so with changes so far.

For this:

Code: Select all

"file_regex": "^(?:Error: |\\t)([^: ]+?):(\\d+):() ([^:]*)$"
Not sure what you mean at all about the F4 thing, I don't know regex at all I copied this from another build system lol.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: I built this so for sublime text 3 in windows

Post by grump »

When I run the love build system in Sublime in Linux, it captures and displays the console output, and uses the file_regex to determine error messages and line numbers. You can click on the error message or press F4, and Sublime jumps to the error location.

It should look like this:

Image

And after pressing F4 a few times to follow the call stack (with my modified regex):

Image

It should work like this in Windows too. If it doesn't, the build system is somewhat broken, since this is what the regex is meant for.
SomeT
Prole
Posts: 9
Joined: Wed Aug 30, 2017 8:56 pm

Re: I built this so for sublime text 3 in windows

Post by SomeT »

Ok I mean I am going to leave the linux part out for now as I have no idea how to make the build system cross compatible. Is it broken or just works differently in windows? I mean I get no output what so ever in sublime text, the debugging info always comes out in the actual love2d window for me in windows even using this build system as it is now:

Code: Select all

{
    "selector": "source.lua",
    "shell_cmd": "start cmd /c love \"${project_path}\"",
    "shell": false,
    "file_regex": "^(?:Error: |\\t)([^: ]+?):(\\d+):() ([^:]*)$"
}
Last edited by SomeT on Thu Aug 31, 2017 3:50 pm, edited 1 time in total.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: I built this so for sublime text 3 in windows

Post by grump »

I think the "start cmd /c" breaks it. Can you try this:

Code: Select all

"shell_cmd": "love --console \"${project_path}\"",
Edit: remove the shell_cmd line and add this instead:

Code: Select all

"cmd": ["love.exe", "\"${project_path}\""],
That should make it work.
Last edited by grump on Thu Aug 31, 2017 4:23 pm, edited 2 times in total.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 54 guests