I have written a very basic Lua scripting plugin for Geany.
So far, it is only able to do a few simple things:
1) Create a Tools menu showing a list of scripts from the user's config folder, e.g. ~/.geany/lua/.
2) Retrieve and/or modify the current document's text and/or selection.
In order to achieve this, I needed to expose a few more functions to the plugin API:
document_get_current() sci_get_text() sci_get_length() sci_replace_sel() sci_get_selected_text() sci_get_selected_text_length() utils_get_file_list()
So before I go any further, some questions:
Will it be OK to expose this stuff? Any ideas for other "must have" script functions?
The attached patch adds the functions mentioned above, I hope post the code for the plugin soon, but I still have a bit of clean up to do and maybe write some simple docs for using it. Also note that since the patch is only preliminary/tenative, it doesn't bump the API/ABI version numbers like it should.
- Jeff
On 07/23/2007 06:46:28 PM, Jeff Pohlmeyer wrote:
I have written a very basic Lua scripting plugin for Geany.
So far, it is only able to do a few simple things:
- Create a Tools menu showing a list of scripts
from the user's config folder, e.g. ~/.geany/lua/.
- Retrieve and/or modify the current document's text
and/or selection.
Sounds great!
In order to achieve this, I needed to expose a few more functions to the plugin API:
document_get_current() sci_get_text() sci_get_length() sci_replace_sel() sci_get_selected_text() sci_get_selected_text_length() utils_get_file_list()
So before I go any further, some questions:
Will it be OK to expose this stuff?
Yes, thanks for the patch. Committed in SVN.
Any ideas for other "must have" script functions?
I'm not sure, I haven't really used scripting in other editors. With the plugin API I'm just adding common functions as needed or as requested.
The attached patch adds the functions mentioned above, I hope post the code for the plugin soon, but I still have a bit of clean up to do and maybe write some simple docs for using it.
If you have any questions/requests for improving the plugin system, just ask.
Also note that since the patch is only preliminary/tenative, it doesn't bump the API/ABI version numbers like it should.
API version is now 6.
Regards, Nick