Jump to content




CC Syntax Highlighting/Code Completions v1.2 - Sublime Text 2

utility lua

  • You cannot reply to this topic
133 replies to this topic

#61 FuuuAInfiniteLoop(F.A.I.L)

  • Banned
  • 435 posts
  • LocationThe left part of this post

Posted 25 March 2013 - 02:34 AM

bug: if you try to put end it will be remplaced with term.setTextColor

#62 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 25 March 2013 - 02:35 AM

View Posturielsalis, on 25 March 2013 - 02:34 AM, said:

bug: if you try to put end it will be remplaced with term.setTextColor

That's not my fault, that's just the huge list of completions that could be filled with end. I could try and stop code completions for Lua keywords... I'll see what I can do...

#63 diegodan1893

  • Members
  • 164 posts
  • LocationSpain

Posted 25 March 2013 - 04:28 AM

I just tried this and it's awesome. Thanks Grav!

View PostTheOriginalBIT, on 24 March 2013 - 07:39 PM, said:

can you fix the bad indenting with
if <some-condition> then <do something> end
  <next-instruction-is-indented>

EDIT: Really the problem is just, anything that has an end on the same line its declared indents the next line.
This is working well for me

#64 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 25 March 2013 - 04:34 AM

View Postdiegodan1893, on 25 March 2013 - 04:28 AM, said:

I just tried this and it's awesome. Thanks Grav!

View PostTheOriginalBIT, on 24 March 2013 - 07:39 PM, said:

can you fix the bad indenting with
if <some-condition> then <do something> end
  <next-instruction-is-indented>

EDIT: Really the problem is just, anything that has an end on the same line its declared indents the next line.
This is working well for me
Hmmm ok so ifs, are working for me again, but when typing the functions and not using the auto complete the end doesn't move back.

#65 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 25 March 2013 - 09:39 AM

Could you make a github repo so we can use Package Control to download/update? That would be so helpfull :D

#66 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 25 March 2013 - 09:45 AM

View PostMysticT, on 25 March 2013 - 09:39 AM, said:

Could you make a github repo so we can use Package Control to download/update? That would be so helpfull :D
I would love this too. Manually having to download updates is a pain. Just having some bot do it for me is easy :P

#67 Shnupbups

  • Members
  • 596 posts
  • LocationThat place over there. Y'know. The one where I am.

Posted 25 March 2013 - 09:50 AM

When I type 'do' for loops, it auto-changes to turtle.digDown()... -_-

#68 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 25 March 2013 - 08:51 PM

Ok, added GitHub repo! :D Gosh this is gonna be so much easier for me now... Thanks for the idea! (why did I not think of it :P)

Found here: https://github.com/G...erCraft-Package

I've also submitted a request to have it included under the listings for the ST2 Package Control Plugin, so hopefully that will come through soon!

#69 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 26 March 2013 - 04:05 AM

Hey Grav,

Can you please make this change to the main computercraft.xml

<key>fileTypes</key>
<array>
  <string></string>
  <string>lua</string>
</array>

this way when we create new files it doesn't put the .lua on the end and we have to save and then rename to remove the extension and it means it will still be able to detect lua files as computercraft syntax. small change, but one I have to do everytime I download a new version :P ... the reason for not having the extension is because os.loadAPI does not like . or - or anything of that nature in the file names, as when it loads it into _G we have no way off accessing it without doing _G['some-file.lua'].func() as the . and - and + etc are all seen as operators not the string when doing some-file.lua.func()

#70 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 26 March 2013 - 04:17 AM

Just a FYI to noobies out there. Once you have package control installed you need to add the repo then install the package. The package won't install after you add the repo.

#71 MudkipTheEpic

  • Members
  • 639 posts
  • LocationWhere you'd least expect it.

Posted 26 March 2013 - 04:18 AM

View PostShnupbups100, on 25 March 2013 - 09:50 AM, said:

When I type 'do' for loops, it auto-changes to turtle.digDown()... -_-

End is rednet.send... XD

#72 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 26 March 2013 - 04:41 AM

View PostTheOriginalBIT, on 26 March 2013 - 04:05 AM, said:

Hey Grav,

Can you please make this change to the main computercraft.xml

<key>fileTypes</key>
<array>
  <string></string>
  <string>lua</string>
</array>

this way when we create new files it doesn't put the .lua on the end and we have to save and then rename to remove the extension and it means it will still be able to detect lua files as computercraft syntax. small change, but one I have to do everytime I download a new version :P ... the reason for not having the extension is because os.loadAPI does not like . or - or anything of that nature in the file names, as when it loads it into _G we have no way off accessing it without doing _G['some-file.lua'].func() as the . and - and + etc are all seen as operators not the string when doing some-file.lua.func()

Good Idea! I'll update the GitHub repo. Not sure how this sort of updating system works through Package Control. Do I have to re-install the package?

#73 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 26 March 2013 - 04:43 AM

View PostGravityScore, on 26 March 2013 - 04:41 AM, said:

View PostTheOriginalBIT, on 26 March 2013 - 04:05 AM, said:

Hey Grav,

Can you please make this change to the main computercraft.xml

<key>fileTypes</key>
<array>
  <string></string>
  <string>lua</string>
</array>

this way when we create new files it doesn't put the .lua on the end and we have to save and then rename to remove the extension and it means it will still be able to detect lua files as computercraft syntax. small change, but one I have to do everytime I download a new version :P ... the reason for not having the extension is because os.loadAPI does not like . or - or anything of that nature in the file names, as when it loads it into _G we have no way off accessing it without doing _G['some-file.lua'].func() as the . and - and + etc are all seen as operators not the string when doing some-file.lua.func()

Good Idea! I'll update the GitHub repo. Not sure how this sort of updating system works through Package Control. Do I have to re-install the package?
It should update by itself. But you can run "Package Control: Upgrade Package" if it doesn't. It is a pretty cool plugin.

#74 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 26 March 2013 - 04:44 AM

View PostMudkipTheEpic, on 26 March 2013 - 04:18 AM, said:

View PostShnupbups100, on 25 March 2013 - 09:50 AM, said:

When I type 'do' for loops, it auto-changes to turtle.digDown()... -_-
End is rednet.send... XD
true is turtle.refuel :P

#75 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 26 March 2013 - 04:56 AM

View PostTheOriginalBIT, on 26 March 2013 - 04:44 AM, said:

View PostMudkipTheEpic, on 26 March 2013 - 04:18 AM, said:

View PostShnupbups100, on 25 March 2013 - 09:50 AM, said:

When I type 'do' for loops, it auto-changes to turtle.digDown()... -_-
End is rednet.send... XD
true is turtle.refuel :P

Fixed it! Basically just added completions for all the keywords in Lua :P

Updated GitHub...

#76 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 26 March 2013 - 04:59 AM

add this to the repo, making the appropriate changes... its details for package control

File >>>> package-metadata.json
{
"version": "1.6.3",
"url": "http://wbond.net/sublime_packages/package_control",
"description": "A full-featured package manager"
}


#77 diegodan1893

  • Members
  • 164 posts
  • LocationSpain

Posted 26 March 2013 - 06:56 AM

There is a bug with indenting with elseif
Posted Image

#78 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 26 March 2013 - 11:59 AM

View Postdiegodan1893, on 26 March 2013 - 06:56 AM, said:

There is a bug with indenting with elseif
Posted Image

It only detects else ifs with the proper syntax, so elseif blah then. It won't detect just plain elseif on a line.

#79 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 26 March 2013 - 02:22 PM

Grav thanks for the plugin!
Only one thing that annoys me that end and then enter is term.setBackgroundcolor(colors)

I dont know if this is fixable otherwise I should get used to hitting space after end! :P

#80 diegodan1893

  • Members
  • 164 posts
  • LocationSpain

Posted 27 March 2013 - 01:50 AM

View PostEngineer, on 26 March 2013 - 02:22 PM, said:

Grav thanks for the plugin!
Only one thing that annoys me that end and then enter is term.setBackgroundcolor(colors)

I dont know if this is fixable otherwise I should get used to hitting space after end! :P

That was fixed in the last update





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users