LuaScript icon indicating copy to clipboard operation
LuaScript copied to clipboard

How to use LuaScript examples

Open b-morgan opened this issue 1 year ago • 3 comments

I have installed LuaScript 0.12 on NotePad++ 8.6.9 and I’ve found the documentation with a list of examples.

What I’m missing is how to use the examples. In particular, luaautoindent.lua.

I am a World of Warcraft addon developer and a recent Blizzard “enhancement” is to remove all the indentation from their saved variables files which are Lua tables. While getting rid of all that white space may be good for speeding up loading of addons, it sucks when debugging an addon.

I want to load the file into NPP and then do “something” to reformat it. Very rarely I’ll change something and save it but mostly I just want a better visualization of the multiple tables in the file.

b-morgan avatar Aug 16 '24 19:08 b-morgan

To be honest I haven't used this plugin in a while but I'm assuming it still works with the latest Notepad++ still.

In the plugin menu you can edit the Lua start up script and paste the example code in that file, save, and restart N++.

dail8859 avatar Aug 16 '24 20:08 dail8859

Unless I totally misunderstand you, I'm not interested in running code every time I start Notepad++. I want to load this saved variables file into a NPP tab and then "do something" to execute a LuaScript function which will reformat the contents of that tab. I don't want to mess with any of the other tabs which might contain .lua files from my addon which are already formatted (by me) and don't need to be messed with.

b-morgan avatar Aug 16 '24 20:08 b-morgan

The startup script runs every time at start up of the application, but the intention is that it just defines all the shortcuts and defines callbacks to be used during runtime.

dail8859 avatar Aug 16 '24 20:08 dail8859