Neil Hodgson wrote:
Dan Anderson:
Does anyone know if there any way within a LUA script to
access each open buffer and the text it contains? Read
only access is sufficient. I would like to iterate through each
buffer, retrieve the text, and perform some additional
processing with the text.
This is not well supported. There is some code for switching buffers at
http://lua-users.org/wiki/SciteBufferSwitch
Neil
Thanks. I did come across that, but it doesn't really satisfy my needs. As far as I can tell, the script keeps track of all files opened since Scite was started regardless of whether or not they have been subsequently closed.
I do have an idea. Basically, I was thinking that I could use
scite.SendEditor() to send IDM_NEXTFILE to switch through all the buffers. I
would have to keep track of the original buffer somehow so that I know when it
is complete. Maybe the buffer file path. Not sure if it will work but the
idea seams sound. The biggest issue I see with this approach is that it will
be pretty ugly with the screen flashing through all of the buffers.
It would be nice if an array of open buffers was exposed to the LUA scripting
interface. Each buffer object in the array could have the basic properties &
functions of the editor object.
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest