---------------------------------------------------------- -- Show Current Colour ---------------------------------------------------------- local function SetColour(color) if color:match('%x%x%x%x%x%x') then memo_path:set_memo_colour("", "#"..color) else local def_bg = editor.StyleBack[32] local b = math.floor(def_bg / 65536) local g = math.floor((def_bg - b*65536) / 256) local r = def_bg - b*65536 - g*256 local rgb_hex = string.format('#%2X%2X%2X', r, g, b) memo_path:set_memo_colour("", rgb_hex) end end AddEventHandler("OnDwellStart", function(pos, cur_word) if pos ~= 0 then SetColour(cur_word) end end) props["dwell.period"] = 50 local cur_word_old = "" AddEventHandler("OnKey", function(key, shift, ctrl, alt, char) if editor.Focus then local cur_word = GetCurrentWord() -- слово, на котором стояла каретка ДО ТОГО КАК ЕЁ ПЕРЕМЕСТИЛИ if cur_word ~= cur_word_old then SetColour(cur_word) cur_word_old = cur_word end end end) |