diff options
author | Marius <mariausol@gmail.com> | 2013-08-30 15:00:28 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-08-30 15:00:28 +0300 |
commit | c0a1ceef697a9c71b66dcdf1bbf1ba3bc27af15f (patch) | |
tree | d103092b3ee789c07cb6ef350310ce6bc4e7fb79 /context/data/scite/scite-ctx.lua | |
parent | c527fe668029f6e8a71751cca9b88d756c3bc77f (diff) | |
download | context-c0a1ceef697a9c71b66dcdf1bbf1ba3bc27af15f.tar.gz |
beta 2013.08.30 13:54
Diffstat (limited to 'context/data/scite/scite-ctx.lua')
-rw-r--r-- | context/data/scite/scite-ctx.lua | 162 |
1 files changed, 138 insertions, 24 deletions
diff --git a/context/data/scite/scite-ctx.lua b/context/data/scite/scite-ctx.lua index 7d0cea69e..421e9cd89 100644 --- a/context/data/scite/scite-ctx.lua +++ b/context/data/scite/scite-ctx.lua @@ -882,7 +882,7 @@ if not lpeg then end -local lists = { -- taken from sort-lan.lua +local textlists = { -- taken from sort-lan.lua en = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", @@ -1221,51 +1221,165 @@ local lists = { -- taken from sort-lan.lua -- }, } -local enabled = false -local language = "en" -local selector = { } +local textselector = { } +for k, v in next, textlists do + textselector[#textselector+1] = k +end +table.sort(textselector) + +local mathsets = { + { "tf", { + "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", + "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" + }, }, + { "bf", { + "đ", "đ", "đ", "đ", "đ", "đ ", "đĄ", "đą", "đŁ", "đ€", "đ„", "đŠ", "đ§", "đš", "đ©", "đȘ", "đ«", "đŹ", "đ", "đź", "đŻ", "đ°", "đ±", "đČ", "đł", + "đ", "đ", "đ", "đ", "đ", "đ
", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", + "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ" + }, }, + { "it", { + "đ", "đ", "đ", "đ", "đ", "đ", "đ", "â", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ ", "đĄ", "đą", "đŁ", "đ€", "đ„", "đŠ", "đ§", + "đŽ", "đ”", "đ¶", "đ·", "đž", "đč", "đș", "đ»", "đŒ", "đœ", "đŸ", "đż", "đ", "đ", "đ", "đ", "đ", "đ
", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", + }, }, + { "bi", { + "đ", "đ", "đ", "đ
", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", + "đš", "đ©", "đȘ", "đ«", "đŹ", "đ", "đź", "đŻ", "đ°", "đ±", "đČ", "đł", "đŽ", "đ”", "đ¶", "đ·", "đž", "đč", "đș", "đ»", "đŒ", "đœ", "đŸ", "đż", "đ", "đ", + }, }, + { "sc", { + "đ”", "đ¶", "đ·", "đž", "đč", "âŻ", "đ»", "â", "đœ", "đŸ", "đż", "đ", "đ", "đ", "đ", "âŽ", "đ
", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", + "đ", "âŹ", "đ", "đ", "â°", "â±", "đą", "â", "â", "đ„", "đŠ", "â", "âł", "đ©", "đȘ", "đ«", "đŹ", "â", "đź", "đŻ", "đ°", "đ±", "đČ", "đł", "đŽ", + }, }, + { "sc bf", { + "đȘ", "đ«", "đŹ", "đ", "đź", "đŻ", "đ°", "đ±", "đČ", "đł", "đŽ", "đ”", "đ¶", "đ·", "đž", "đč", "đș", "đ»", "đŒ", "đœ", "đŸ", "đż", "đ", "đ", "đ", "đ", + "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ ", "đĄ", "đą", "đŁ", "đ€", "đ„", "đŠ", "đ§", "đš", "đ©", + }, }, + { "fr", { + "đ", "đ", "đ ", "đĄ", "đą", "đŁ", "đ€", "đ„", "đŠ", "đ§", "đš", "đ©", "đȘ", "đ«", "đŹ", "đ", "đź", "đŻ", "đ°", "đ±", "đČ", "đł", "đŽ", "đ”", "đ¶", "đ·", + "đ", "đ
", "â", "đ", "đ", "đ", "đ", "â", "â", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "â", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "âš", + }, }, + { "ds", { + "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ ", "đĄ", "đą", "đŁ", "đ€", "đ„", "đŠ", "đ§", "đš", "đ©", "đȘ", "đ«", + "đž", "đč", "â", "đ»", "đŒ", "đœ", "đŸ", "â", "đ", "đ", "đ", "đ", "đ", "â", "đ", "â", "â", "â", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "â€", "đ", + "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ ", "đĄ" + }, }, + { "fr bf", { + "đŹ", "đ", "đź", "đŻ", "đ°", "đ±", "đČ", "đł", "đŽ", "đ”", "đ¶", "đ·", "đž", "đč", "đș", "đ»", "đŒ", "đœ", "đŸ", "đż", "đ", "đ", "đ", "đ", + "đ", "đ
", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ" + }, }, + { "ss tf", { + "đș", "đ»", "đŒ", "đœ", "đŸ", "đż", "đ", "đ", "đ", "đ", "đ", "đ
", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", + "đ ", "đĄ", "đą", "đŁ", "đ€", "đ„", "đŠ", "đ§", "đš", "đ©", "đȘ", "đ«", "đŹ", "đ", "đź", "đŻ", "đ°", "đ±", "đČ", "đł", "đŽ", "đ”", "đ¶", "đ·", "đž", "đč", + "đą", "đŁ", "đ€", "đ„", "đŠ", "đ§", "đš", "đ©", "đȘ", "đ«" + }, }, + { "ss bf", { + "đź", "đŻ", "đ°", "đ±", "đČ", "đł", "đŽ", "đ”", "đ¶", "đ·", "đž", "đč", "đș", "đ»", "đŒ", "đœ", "đŸ", "đż", "đ", "đ", "đ", "đ", "đ", "đ
", "đ", "đ", + "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ ", "đĄ", "đą", "đŁ", "đ€", "đ„", "đŠ", "đ§", "đš", "đ©", "đȘ", "đ«", "đŹ", "đ", + "đŹ", "đ", "đź", "đŻ", "đ°", "đ±", "đČ", "đł", "đŽ", "đ”", + }, }, + { "ss it", { + "đą", "đŁ", "đ€", "đ„", "đŠ", "đ§", "đš", "đ©", "đȘ", "đ«", "đŹ", "đ", "đź", "đŻ", "đ°", "đ±", "đČ", "đł", "đŽ", "đ”", "đ¶", "đ·", "đž", "đč", "đș", "đ»", + "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ ", "đĄ", + }, }, + { "ss bi", { + "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ ", "đĄ", "đą", "đŁ", "đ€", "đ„", "đŠ", "đ§", "đš", "đ©", "đȘ", "đ«", "đŹ", "đ", "đź", "đŻ", + "đŒ", "đœ", "đŸ", "đż", "đ", "đ", "đ", "đ", "đ", "đ
", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", + }, }, + { "tt", { + "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ ", "đĄ", "đą", "đŁ", + "đ°", "đ±", "đČ", "đł", "đŽ", "đ”", "đ¶", "đ·", "đž", "đč", "đș", "đ»", "đŒ", "đœ", "đŸ", "đż", "đ", "đ", "đ", "đ", "đ", "đ
", "đ", "đ", "đ", "đ", + "đ¶", "đ·", "đž", "đč", "đș", "đ»", "đŒ", "đœ", "đŸ", "đż" + }, }, + { "gr tf", { + "α", "ÎČ", "Îł", "ÎŽ", "Δ", "ζ", "η", "Ξ", "Îč", "Îș", "λ", "ÎŒ", "Îœ", "Ο", "Îż", "Ï", "Ï", "Ï", "Ï", "Ï", "Ï
", "Ï", "Ï", "Ï", "Ï", + "Î", "Î", "Î", "Î", "Î", "Î", "Î", "Î", "Î", "Î", "Î", "Î", "Î", "Î", "Î", "Î ", "ÎĄ", "Îą", "ÎŁ", "΀", "΄", "Ί", "Χ", "Κ", "Ω", + }, }, + { "gr bf", { + "đ", "đ", "đ", "đ
", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", + "đš", "đ©", "đȘ", "đ«", "đŹ", "đ", "đź", "đŻ", "đ°", "đ±", "đČ", "đł", "đŽ", "đ”", "đ¶", "đ·", "đž", "đč", "đș", "đ»", "đŒ", "đœ", "đŸ", "đż", "đ", + }, }, + { "gr it", { + "đŒ", "đœ", "đŸ", "đż", "đ", "đ", "đ", "đ", "đ", "đ
", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", + "đą", "đŁ", "đ€", "đ„", "đŠ", "đ§", "đš", "đ©", "đȘ", "đ«", "đŹ", "đ", "đź", "đŻ", "đ°", "đ±", "đČ", "đł", "đŽ", "đ”", "đ¶", "đ·", "đž", "đč", "đș", + }, }, + { "gr bi", { + "đ¶", "đ·", "đž", "đč", "đș", "đ»", "đŒ", "đœ", "đŸ", "đż", "đ", "đ", "đ", "đ", "đ", "đ
", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", + "đ", "đ", "đ", "đ", "đ ", "đĄ", "đą", "đŁ", "đ€", "đ„", "đŠ", "đ§", "đš", "đ©", "đȘ", "đ«", "đŹ", "đ", "đź", "đŻ", "đ°", "đ±", "đČ", "đł", "đŽ", + }, }, + { "gr ss bf", { + "đ°", "đ±", "đČ", "đł", "đŽ", "đ”", "đ¶", "đ·", "đž", "đč", "đș", "đ»", "đŒ", "đœ", "đŸ", "đż", "đ", "đ", "đ", "đ", "đ", "đ
", "đ", "đ", "đ", + "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ ", "đĄ", "đą", "đŁ", "đ€", "đ„", "đŠ", "đ§", "đš", "đ©", "đȘ", "đ«", "đŹ", "đ", "đź", + }, }, + { "gr ss bi", { + "đȘ", "đ«", "đŹ", "đ", "đź", "đŻ", "đ°", "đ±", "đČ", "đł", "đŽ", "đ”", "đ¶", "đ·", "đž", "đč", "đș", "đ»", "đŒ", "đœ", "đŸ", "đż", "đ", "đ", "đ", + "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ", "đ ", "đĄ", "đą", "đŁ", "đ€", "đ„", "đŠ", "đ§", "đš", + }, }, + { "op", { + }, }, + { "sy a", { + }, }, + { "sy b", { + }, }, + { "sy c", { + }, }, +} + +local mathlists = { } +local mathselector = { } -for k, v in next, lists do - selector[#selector+1] = k +for i=1,#mathsets do + local mathset = mathsets[i] + mathselector[#mathselector+1] = mathset[1] + mathlists[mathset[1]] = mathset[2] end -table.sort(selector) +local enabled = 0 +local usedlists = { + { name = "text", current = "en", lists = textlists, selector = textselector }, + { name = "math", current = "tf", lists = mathlists, selector = mathselector }, +} local function make_strip() - local alphabet = lists[language] or lists.en - local selector = "(hide)(" .. table.concat(selector,")(") .. ")" - local alphabet = "(" .. language .. ":)(" .. table.concat(alphabet,")(") .. ")" + local used = usedlists[enabled] + local lists = used.lists + local alphabet = lists[used.current] + local selector = "(hide)(" .. concat(used.selector,")(") .. ")" + local alphabet = "(" .. used.current .. ":)(" .. concat(alphabet,")(") .. ")" scite.StripShow(selector .. "\n" .. alphabet) - enabled = true end local function hide_strip() scite.StripShow("") - enabled = false end local function process_strip(control) local value = scite.StripValue(control) if value == "hide" then hide_strip() - elseif lists[value] then - language = value + return + elseif find(value,".+:") then + return + end + local used = usedlists[enabled] + if used.lists[value] then + used.current = value make_strip() - elseif value == language .. ":" then - -- ignore else - local char = value - trace("inserted character: " .. char .. "\n") - editor:insert(editor.CurrentPos,char) + editor:insert(editor.CurrentPos,value) end end -function toggle_strip() - if enabled then - hide_strip() - OnStrip = function() end - else +local function ignore_strip() +end + +function toggle_strip(name) + enabled = enabled + 1 + if usedlists[enabled] then make_strip() OnStrip = process_strip + else + enabled = 0 + hide_strip() + OnStrip = ignore_strip end end |