mimir,
mozers Цитата: Да я в форуме говорю. Когда посты со скриптами делаешь. Увидел у тебя подсветку и тоже захотел.
написал луашный скрипт в скайте [more]
Код: local STYLES = {
[1] = {color="008000"},
[2] = {color="008000"},
[4] = {color="AC00A9"},
[5] = {color="0000DF"},
[6] = {color="9999CC"},
[7] = {color="9999CC"},
[10] = {color="FF0000"},
[13] = {color="0080C0"},
[14] = {color="8000FF"},
[15] = {color="0080C0"},
[16] = {color="660000"},
[17] = {color="B35900"},
[18] = {color="408080"},
[19] = {color="AAAA00"},
}
local new = ""
local text = editor:GetSelText()
local start = editor.SelectionStart - 1
local len = string.len(text)
local bold,color = false,nil
for i = 1, len do
local sid = scite.SendEditor(SCI_GETSTYLEAT,start+i)
local style = STYLES[sid]
if style == nil then
if color ~= nil then
new = new.."[/color]"
color = nil
end
if bold then
new = new.."[/b]"
bold = false
end
else
if color ~= style.color and color ~= nil then
new = new.."[/color]"
end
if bold and not style.bold then
new = new.."[/b]"
bold = false
end
if not bold and style.bold then
new = new.."[b]"
bold = true
end
if color ~= style.color then
new = new.."[color="..style.color.."]"
color = style.color
end
end
new = new..string.sub(text,i,i)
end
-- update
local ss = editor.SelectionStart
editor:ReplaceSel(new)
editor:SetSel(ss, ss+string.len(new))