Download
(9 Kb)
Download
Updated: 02-22-07 01:13 AM
Pictures
File Info
Updated:02-22-07 01:13 AM
Created:unknown
Downloads:3,308
Favorites:56
MD5:
For All Indents And Purposes
Version: 17
by: krka [More]
What is this?
This is an addon that hooks into existing editboxes and adds Lua syntax highlighting and indentation to them. The screenshots should be all the clarification you need. This is useful for all you Lua developers that like to test Lua code ingame. For the rest of you... you probably won't need this.

This is both a standalone addon and an embedded library.
The standalone addon is simply the embedded part + a set of default hookings.

Description for users
Unzip the addon into your AddOns directory and it'll Just Work(tm).

Description for developers
It's easy to add embed this into your own addon and hook it into your own editboxes. This won't add any dependencies to your addon (Yay!). See inside indent.lua for more details.

Default hookings
This addon automatically hooks the following addons to get syntax highlighting:
* LuaPad
* TinyPad
* LuaSlinger
* Phoenix
* Inspector
* FuncBook

It's extremely easy to add more addons to this list. Just take a look inside defaulthooks.lua and add the addon to the table using the same format as the others. Let me know if you want me to add builtin support for some other editor.

Changelog
Revision 13 - Fixed bug that occured when setting text to nil.
Revision 14 - Fixed bug that made it impossible to write ~=
Revision 15 - Added myDebug support
Revision 16 - Now indents and highlights for Lua 5.1 syntax. Lua 5.0 syntax is NOT supported. This mostly affects nested comments. Also updated to work with WoW 2.0

Revision 17 - major release:
* internal parser / highlighter / indenter system unchanged
* major rewrite of wow interfacing code, including disabling / enabling
* fixed broken caching mechanism
* fixed problem with MaxLetters and MaxBytes causing text disappearing
* fixed bug with lots of newlines appended when typing an unfinished lua string
* stopped recoloring upon text change - instead, it gets done in an OnUpdate-loop, if the text has been recently changed.
This should significantly improve performance when pasting text. Now the editbox only gets recolored after 0.2 seconds of inactivity

* deprecated, but still working:
- lib.addSmartCode -- replaced by lib.enable

* new functions:
- lib.enable(editbox [, colorTable [, tabWidth]])
- lib.disable(editbox)

* Useful properties to set. Note that after a change, you need to manually call lib.indentEditbox or lib.colorCodeEditbox
for changes to take effect:
- editbox.faiap_colorTable
- editbox.faiap_tabWidth
Optional Files (0)


Post A Reply Comment Options
Unread 07-22-11, 08:23 PM  
spiralofhope
A Deviate Faerie Dragon
 
spiralofhope's Avatar

Forum posts: 11
File comments: 207
Uploads: 0
This was embedded in _DevPad and is working perfectly.

However, the one in _DevPad has been updated and is newer than what's found here .. maybe. Perhaps it's just embedded with some changes to variables.
__________________
spiralofhope.com
Last edited by spiralofhope : 07-25-11 at 01:06 PM.
spiralofhope is offline Report comment to moderator  
Reply With Quote
Unread 05-17-09, 07:08 PM  
nrpieper
A Defias Bandit
 
nrpieper's Avatar
AddOn Author - Click to view AddOns

Forum posts: 2
File comments: 26
Uploads: 4
Some of the best Lua add-on code I've seen.

I should have thought to use your method to track the cursor position while removing and inserting color tags. Nicely done.
__________________
-Nate
(Bowtonate on Whisperwind)
------------------------------------------------
Author of Misspelled, the Wow chat spell-checker
Last edited by nrpieper : 05-17-09 at 07:09 PM.
nrpieper is offline Report comment to moderator  
Reply With Quote
Unread 07-30-08, 03:52 PM  
Nexuapex
A Fallenroot Satyr
AddOn Author - Click to view AddOns

Forum posts: 25
File comments: 9
Uploads: 2
A++. Would optionally depend upon again.
Nexuapex is offline Report comment to moderator  
Reply With Quote
Unread 02-22-07, 05:22 PM  
Fin
An Aku'mai Servant
 
Fin's Avatar
AddOn Author - Click to view AddOns

Forum posts: 34
File comments: 74
Uploads: 4
Hooray!

krka rides again! We don't deserve you krka, really!
Fin is offline Report comment to moderator  
Reply With Quote
Unread 02-22-07, 12:30 PM  
break19
A Flamescale Wyrmkin
AddOn Author - Click to view AddOns

Forum posts: 116
File comments: 99
Uploads: 3
Originally posted by krka
Revision 17 is currently pending, and it should fix your bug (and a few others).
Sorry it took so long to fix!

(In my defense i dont play WoW any more :-))
HERETIC!!
Quick! Call the Spanish Inquisition! *NOOOOOBody expects the spanish inquisition*
break19 is offline Report comment to moderator  
Reply With Quote
Unread 02-22-07, 01:48 AM  
krka
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 12
File comments: 7
Uploads: 5
Originally posted by dracula
Nice idea, but it's entirely impossible to paste multi-line code into a LuaSlinger editbox with this addon active. Probably because it keeps changing and highlighting the code while it is still being added, and that heavily truncates the pasted code.
Revision 17 is currently pending, and it should fix your bug (and a few others).
Sorry it took so long to fix!

(In my defense i dont play WoW any more :-))
krka is offline Report comment to moderator  
Reply With Quote
Unread 12-30-06, 10:52 PM  
dracula
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 7
File comments: 70
Uploads: 1
Nice idea, but it's entirely impossible to paste multi-line code into a LuaSlinger editbox with this addon active. Probably because it keeps changing and highlighting the code while it is still being added, and that heavily truncates the pasted code.
dracula is offline Report comment to moderator  
Reply With Quote
Unread 06-25-06, 08:43 AM  
qweqq
A Defias Bandit

Forum posts: 3
File comments: 1
Uploads: 0
this addon is awesome ! so cool and simple ! great work !
qweqq is offline Report comment to moderator  
Reply With Quote
Unread 04-26-06, 01:07 PM  
krka
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 12
File comments: 7
Uploads: 5
Thanks

Thanks for all the friendly feedback!

Undo-button is a good idea, but i think that's something should be handled by the editor (i.e. provide the proper undo button to click and stuff).

FuncBook has been added, as you can see.
krka is offline Report comment to moderator  
Reply With Quote
Unread 04-25-06, 10:42 PM  
Kaelten
Jack's raging bile duct
 
Kaelten's Avatar
Featured Addon Author

Forum posts: 771
File comments: 47
Uploads: 22
addons["FuncBook"] = {
"FuncBookFrameEditorScrollBoxEditBox"}
__________________
WowAce.com & CurseForge.com Adminstrator
Developer of Ace3, OneBag3, and many other addons and libraries
Project lead and Mac developer for the Curse Client

Anyone that needs what they want
And doesn't want what they need
I want nothing to do with
Kaelten is offline Report comment to moderator  
Reply With Quote
Unread 04-25-06, 02:47 PM  
Mazzlefizz
A Pyroguard Emberseer
 
Mazzlefizz's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3521
File comments: 60
Uploads: 2
Awesome! Just awesome.

You should get an undo function in there, though that might be a bit cumbersome. That's the one other thing that stops me from ever editing code in WoW. I'll accidentally flick my trackpad or select the whole thing when I enter the frame, and then type something and, bam, one or all lines are gone forever.
__________________
MazzleUI Home Page: Mazzlefizz.WoWInterface.com
Info, FAQs, Forums, Download can be found at that link.
Last edited by Mazzlefizz : 04-25-06 at 04:58 PM.
Mazzlefizz is offline Report comment to moderator  
Reply With Quote
Unread 04-25-06, 02:16 PM  
willgk
An Aku'mai Servant
AddOn Author - Click to view AddOns

Forum posts: 37
File comments: 153
Uploads: 3
Thumbs up WOW!

This is the absolute coolest mod yet. Thanks krka!!!!
willgk is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: