Indentation issue

Hey!

Well, console shows normal output as if it’s executing:

Corona Editor: Init Package Control: Skipping automatic upgrade, last run at 2015-07-26 14:54:01, next run at 2015-07-26 15:54:01 or after Corona Editor: Running: ['C:\\Program Files (x86)\\Corona Labs\\Corona SDK\\Corona Simulator.exe', '/singleton', '/no-console', 'C:\\Users\\mroberti\\Desktop\\SWN\\main.lua']

Then, it just sits there. I check TaskManager and I don’t see an instance of Corona fired up. 

I grabbed the edited pacakges I changed according to your directions above, copy them somewhere, uninstall Sublime and reinstall it, then re-copy my pacakages back in and still get the same results. 

Corona Editor: Running: [‘C:\Program Files (x86)\Corona Labs\Corona SDK\Corona Simulator.exe’

Is that path accurate? On OSX, the daily build path differs from the standard Corona path. Also, what file is active in Sublime when you try to run it? You may run into some issues if the active .lua file is in a subdirectory relative to main.lua. 

I’m sad that the Corona plugin hasn’t been touched at all this year. It appears to have a number of problems. I’ve considered going in and fixing some of these issues myself, but if it’s dead I don’t want to bother. 

Yeah the path is correct. What’s damned peculiar is all the changes we’re applying don’t mess with any paths…maybe shortcut issues? But yeah I’m with ya. I’m sad about the editor. I’ve said it before and I’ll say it again, back to LUA Glider…

-Mario

I love Lua Glider, except for how slow it is (Netbeans being Java based). And sadly, its development has been dead for at least a year.

And yeah, the changes above shouldn’t have any effect on running your projects… Are you able to run your projects without the changes?

Yeah without changes on a fresh reinstall of Sublime it runs fine.

re: LUA Glider, Ditto. The slowness has really started to bum me out lately. But, it indents without issue. Sublime really IS spunky and responsive…but yeah. Dang. 

-Mario

If you delete the Default folder in your Sublime user packages directory, and the cache folder and restart Sublime, are you able to run projects? The are probably in something like “C:\Users{user}\AppData\Roaming\Sublime Text 3” on Windows.

I don’t see anything named “default” or “cache folder” or whatever to delete in that directory to delete. 

In Sublime, go to Preferences->Browse Packages. You should see a Default folder here, and the Cache folder one level above it. 

Strange, I uninstalled and reinstalled Sublime yet again, and now it runs using the default commands, before doing any of your previous posts stuff and it works now…nice. For now…:slight_smile: I’ll give it a stab. I have to do the same to my PC at home so I’ll see if the above post fixes it and report back.

-Mario

Well no joy on my pc at home. I copied the packages I fiddled with from my work PC to my home PC. Build still doesn’t do anything, nor does the indentation.

Also, I can’t find a “default” or “cached” folder when I got to the directory you mention, only 3 folders; “bz2”, “Corona Editor”, and “User”.

I even tried blowing EVERYTHING away after uninstalling, reinstalling sublime and the package installation stuff; man I think I’m over it. Blergh.

Did you follow my latest instructions that involve using PackageResourceViewer to make the changes? 

Yep, still no joy. But, I’m wondering if I screwed up something from copying my work setup to home…can I get a review on which items to edit finally? There’s a lot of strikethroughs and additions you were kind enough to make on the previous pages. What are the (As it stands now) the files and changes that need to be made? I’ll uninstall sublime again, blow away all accompanying files, and try it again on my home box and see if we can’t make it right.

Presently, it still chokes on comments on my box now.

-Mario

These are the only instructions you need to follow:

Edit:

After uninstalling and reinstalling and THEN…

OK I found it:

C:\Users\mroberti\AppData\Local\Sublime Text 3\Cache

THAT directory. BLAST it!!! I deleted it and NOW it works!!!

@Corona: Perry, you getting this? Maybe a quick refresh of corona editor is in order with the latest above provided improvements?! :slight_smile:

Love,

Mario

Anyone know a fix for this for ST 3? A guy here seems to have solved it for ST 2: http://blog.lotech.org/2013/04/fixing-lua-indenting-in-sublime-text.html

Found a better approach. See my later comment

I figured out a fix for both the elseif and function(args) indention issues (for ST 3 on OSX).

This worked for me:

  1. Navigate to Applications/Sublime Text.app (show package contents)/Contents/MacOS/Packages/

  2. Rename Lua.sublime-package to Lua.zip and unzip

  3. Replace code in Indent.tmPreferences with code below

  4. Compress back to .zip and rename back to Lua.sublime-package

  5. Restart Sublime

    <?xml version=“1.0” encoding=“UTF-8”?> <!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”> <plist version=“1.0”> <dict> <key>name</key> <string>Indent</string> <key>scope</key> <string>source.lua</string> <key>settings</key> <dict> <key>decreaseIndentPattern</key> <string>^\s*(else|end|})\s*$|^\s*elseif\b((?!end).)*$</string> <key>increaseIndentPattern</key> <string>^\s*(else|elseif|for|(local\s+)?function|if|repeat|until|while)\b((?!end).)*$|.*=\s*function\s*([^)]*)\s*$|.*{\s*$</string> </dict> <key>uuid</key> <string>411468A8-E0AC-415A-9E71-E2BD091EB571</string> </dict> </plist>

As I think about this, these settings will probably get overwritten the next time Sublime issues an update. You can also try creating a Lua folder in your Browse Packages directory, and copying the modified Indent.tmPreferences into it. You may also need the Lua.tmLanguage file. I tried testing this approach, but Sublime appears to be doing some package caching that I don’t quite understand. Let me know if this works for you.

Hey this almost works for Windows Sublime too!! Still get issues with indentation after a line of commented code. But your other changes work great. Still unusable for me, since…y’know I comment code. :wink:

Before reindent:

[lua]function Cleanup()

– First, delete previous trail

print("Before cleanup size of table "…#scrollers)

if(#scrollers>0)then

for i = #scrollers,1,-1 do

local child = scrollers[i]

if(child~=nil)then

display.remove( child )

child = nil

end

end

scrollers = nil

scrollers = {}

end

print("Size of table after cleanup "…#scrollers)

end[/lua]

And after going to EDIT->LINE->REINDENT

[lua]function Cleanup()

– First, delete previous trail

print("Before cleanup size of table "…#scrollers)

if(#scrollers>0)then

    for i = #scrollers,1,-1 do

        local child = scrollers[i]

        if(child~=nil)then

            display.remove( child )

            child = nil

        end

    end

    scrollers = nil

    scrollers = {}

end

print("Size of table after cleanup "…#scrollers)

end[/lua]

Damn, SOOOOOOO close. This glitch is the ONLY thing keeping me from going full Sublime. 

Appreciate your efforts to kill this bug!!! 

-Mario

Found a better approach. See my later comment

mroberti-

I was able to fix that as well. Do the following (close Sublime first for this one):

  1. Navigate to Applications/Sublime Text.app (show package contents)/Contents/MacOS/Packages/

  2. Rename Default.sublime-package to Default.zip and unzip

  3. Replace code in Indentation Rules - Comments.tmPreferences with code below

  4. Compress back to zip and rename back to Default.sublime-package

  5. Reopen Sublime

    <?xml version=“1.0” encoding=“UTF-8”?> <!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”> <plist version=“1.0”> <dict> <key>scope</key> <string>comment</string> <key>settings</key> <dict> <key>preserveIndent</key> <false/> </dict> </dict> </plist>

YESSSSSSSSSS!!! It worked!! I’m on Windows, BTW but I found the packages under:

C:\Program Files\Sublime Text 3\Packages

In case any other Windows folks want to fix this.

THANK YOU THANK YOU THANK YOU!!!

-Mario