Page 1 of 2

I built this so for sublime text 3 in windows

Posted: Wed Aug 30, 2017 8:58 pm
by SomeT

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

Posted: Thu Aug 31, 2017 8:38 am
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!

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

Posted: Thu Aug 31, 2017 11:52 am
by SomeT
If you need any further help let me know.

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

Posted: Thu Aug 31, 2017 1:59 pm
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.

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

Posted: Thu Aug 31, 2017 2:25 pm
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.

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

Posted: Thu Aug 31, 2017 2:29 pm
by grump
Oh, and add this to make it work in Linux:

Code: Select all

"linux": {
    "shell_cmd": "love ${project_path}",
},

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

Posted: Thu Aug 31, 2017 3:00 pm
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.

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

Posted: Thu Aug 31, 2017 3:18 pm
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.

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

Posted: Thu Aug 31, 2017 3:35 pm
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+):() ([^:]*)$"
}

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

Posted: Thu Aug 31, 2017 3:48 pm
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.