On 4/20/07, Nicolas Grilly <[EMAIL PROTECTED]> wrote:


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

Can you help me to understand the issue?


Try to use next solution:
write next lua script:

local IDM_WRAP = 414 -- defined in SciTE.h

function SetWrap(filename)
   if props['FileExt']=='txt' then
       if props['wrap'] ~= '1' then
           props['wrap'] = '1'
           scite.MenuCommand(IDM_WRAP)
       end
   else
       if props['wrap'] == '1' then
           props['wrap'] = '0'
           scite.MenuCommand(IDM_WRAP)
       end
   end
end

function OnOpen(filename)
   trace('open ' .. filename)
   SetWrap(filename)
end

function OnSwitchFile(filename)
   trace('switch to ' .. filename .. '\n')
   SetWrap(filename)
end

and set it as lua startup script in SciTEUser.properties like this:

ext.lua.startup.script=scite_utils.lua


--
With best regards,
Vladislav V. Vorob'ev
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to