This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
nitrogenfingers's profile picture

CC/Lua plugin for Notepad++

Started by nitrogenfingers, 16 June 2015 - 09:31 AM
nitrogenfingers #1
Posted 16 June 2015 - 11:31 AM
http://pastebin.com/Ect9zNQe

Free to use, if you find this sort of thing useful. Let me know if you notice any issues.

-NF
Bomb Bloke #2
Posted 16 June 2015 - 12:45 PM
I don't use Notepad++, but glancing at the paste, I notice you're miss-referencing a couple of the colours API keys, and ignoring the colors API completely. There's no "colours.gray"; instead, there's a "colours.grey" and there's a "colors.gray". Much the same goes for "colours.lightGray". The functions in term which reference the word "colour" are also available in American.

Another real vs American spelling thing is with textutils.serialise(), which is also available as textutils.serialize() (and in fact the usual spelling was only added recently-ish, so with that particular case I tend to code the American way for the sake of backwards compatibility). Same again for the JSON version.

keys.getName() appears to be missing. I'm not sure if you intended to skip them, but I'm also not seeing much in the way of "vanilla" Lua APIs; with the one exception being the coroutine API…?

Otherwise looking pretty exhaustive. Good work! :)/>
nitrogenfingers #3
Posted 16 June 2015 - 02:13 PM
Thanks for the feedback BombBloke :)/>. The data was mostly ripped from the wiki and for some ridiculous reason NPP needs it's files alphabetically ordered so a few things seem to have gone missing when I reordered them (totally missed the bit api as well somehow). I just went over it again, so hopefully caught most of the issues.

As the wiki doesn't have any vanilla listings apart from coroutine, I found another autocomplete library for vanilla lua from here: http://www.retroaffect.com/blog/190/A_Lua_Language_File_for_Notepad__/ and added what I believe to be the appropriately missing API functions. A license wasn't given so I assume it's fine to use but please let me know otherwise and a big thanks to the author for saving me a bit of work.
Creator #4
Posted 16 June 2015 - 02:52 PM
real vs American
This is awesome!
Bomb Bloke #5
Posted 16 June 2015 - 03:51 PM
As the wiki doesn't have any vanilla listings apart from coroutine

Erm, there may be a few more "vanilla" APIs in there than you think…

I might've forgotten to mention "textutils.unserialize".

A bit of fore-warning; CC 1.74 includes a Lua 5.2 compatibility layer. This adds, for eg, bit32, along with a few other functions here and there as well. Since that's supposed to drop as a stable release very shortly (any day I guess, thought hopefully Dan does at least one more pr first), you might consider checking the beta out now.

Speaking of which, I'm not sure I'm looking forward to a complete change over. Can't figure out what the replacement for table.maxn is supposed to be.
nitrogenfingers #6
Posted 16 June 2015 - 05:02 PM
As the wiki doesn't have any vanilla listings apart from coroutine
Erm, there may be a few more "vanilla" APIs in there than you think…

Perfectly aware, thank you, but I didn't feel the need, or have much motivation, to be that exhaustive. As I mentioned these were ripped straight off the wiki. Nevertheless, I've added the remainder of the plugin from above with a few omissions I feel just clutter up the hint system, and will update this when the next version of CC is released.

Thanks for catching unserialize, I had missed that one.
Edited on 16 June 2015 - 03:10 PM
Grim Reaper #7
Posted 27 June 2015 - 07:35 PM
real vs American
Freedom Spelling

FTFY
SpencerBeige #8
Posted 27 June 2015 - 08:05 PM
its not american, we came from great britain, so really it's a very very slimmed down and lazy version of english.
nitrogenfingers #9
Posted 02 July 2015 - 07:56 AM
Totally irrelevant to the post, for anyone who's interested (probably no one), American spelling is specifically American, and it's relationship with British English can be considered comparable to say, Traditional and Simplified Chinese: https://en.wikipedia.org/?title=American_English

But a lot of American spelling is now standard in British English, like spelling 'music' rather than 'musick'. And conversely some words in American English and not in British were not changed, but people think they're from that language group because that's the only place they still survive modern usage.
</worldsboringestfunfact>
PokeAcer #10
Posted 02 July 2015 - 08:56 PM
How does one add this to NP++?
nitrogenfingers #11
Posted 03 July 2015 - 06:32 AM
Just drop it into your notepad++/plugins/API folder
Konlab #12
Posted 18 October 2015 - 02:20 PM
Just drop it into your notepad++/plugins/API folder
tried, I have no API folder in plugins, and it's not working :(/>
Edited on 18 October 2015 - 12:20 PM