Hello,

I want to automatically set the property wrap=1 when editing .txt
files and wrap=0 when editing other files.

I tried to build a little Lua extension to do this:

   function OnOpen(filename)
       trace('open ' .. filename)
       props['wrap'] = '1'
   end

   function OnSwitchFile(filename)
       trace('switch to ' .. filename .. '\n')
       props['wrap'] = '1'
   end

And I declared it in my SciTEUser.properties like this:

   extension.*.txt=c:\projects\garden-lib\scite_utils.lua
   ext.lua.auto.reload=1
   ext.lua.reset=1

But it doesn't work for at least two reasons:

* The trace displays correctly, but it seems props['wrap'] does nothing.
* I don't know how to add a OnClear event handler to reset property
with props['wrap'] = nil.

Can you help me to understand the issue?

Thanks,

-- Nicolas Grilly
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to