Stefan wrote:
SW> look at: 
SW> http://www.mail-archive.com/[email protected]/msg01677.html

Thanks for advice
My small corrections (ability to use %TEMP% dir for backup files):

.properties:
> ----------------------------------------
backup.files=1
backup.files.tmp=1
> ----------------------------------------

SciTEStartup.lua:
> ----------------------------------------
function BakupFile(filename)
    local sbck = tonumber(props['backup.files'])
    if sbck == nil or sbck == 0 then
        return false
    end
    local sfilename = filename
    local stmp = tonumber(props['backup.files.tmp'])
    if stmp == 1 then
        filename = os.getenv("TEMP").."\\"..string.gsub(filename,'.*\\','')
    end
    local nbck = 1
    while (sbck > nbck ) do
        local fn1 = sbck-nbck 
        local fn2 = sbck-nbck+1 
        os.remove (filename.."."..fn2..".bak")
        if fn1 == 1 then
            os.rename (filename..".bak", filename.."."..fn2..".bak")
        else
            os.rename (filename.."."..fn1..".bak", filename.."."..fn2..".bak")
        end
        nbck = nbck + 1
    end
    os.remove (filename.."."..".bak")
    os.rename (sfilename, filename..".bak")
    return false
end

function OnBeforeSave(filename)
    BakupFile(filename)
end
> ----------------------------------------

-- 
mozers
<http://scite.ruteam.ru>

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

Reply via email to