Scite 清理空白行

lua-users home
wiki

上面的函数基于 SciteCleanDocWhitespace 函数。享受!
function stripWhiteLines(reportNoMatch)
    local count = 0
    local fs,fe = editor:findtext("^$", SCFIND_REGEXP)
    if fe then
        repeat
            count = count + 1
            editor:remove(fs,fe)
            fs,fe = editor:findtext("^$", SCFIND_REGEXP, fs)
        until not fe
        print("Removed " .. count .. " line(s).")
    elseif reportNoMatch then
        print("Document was clean already; nothing to do.")
    end
    return count
end

WalterCruz


最近更改 · 偏好设置
编辑 · 历史记录
最后编辑于 2006 年 8 月 31 日下午 7:46 GMT (差异)