[Geany-Users] Need advice to create LUA open-hook for linewrapping

Joerg Desch jd.vvd at xxxxx
Tue Jun 11 07:21:06 UTC 2013


Hi,

a longer time ago I asked for a LUA on-load hook to enable linw wrapping for specific file types. Now I have found some time to give LUA a try. But I stuck in the geany API. May someone can help...

I have found out that geany.fileinfo() returns me the file type as string. To switch the wrapping mode, I could use geany.scintilla(). The documentation of the LUA plugin sounds like this would be not the "first choose". So I looked again into the documentation and the geany source and found the following stuff.

geany.signal() allows me to call a GTK signal. The menu which handles the line wrapping toggle seems to be "menu_line_wrapping1". So it should be possible to call the signal

    geany.signal("menu_line_wrapping1","toggled")

to toggle the setting. For now it doesn't toggle anything. It just inverts the visibility of the horizontal scrollbar. ;-)

What I'm looking for is not a toggle. Is there a signal to *enable* the line wrapping? And Geany should be aware of these changes!

Or is it OK/save to call geany.scintilla(SCI_SETWRAPMODE,SC_WRAP_WORD)?

Regards.
-- 
Email: Joerg Desch <jd DOT vvd AT web DOT de>


More information about the Users mailing list