From 290d3fec717baf7973fce3e43fb03ac4f126880c Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 10 Jun 2020 17:12:28 -0400 Subject: Renamed some buffer/view fields to use American English instead of Australian. This requires theme updates, primarily due to colour -> color. --- scripts/gen_iface.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/gen_iface.lua b/scripts/gen_iface.lua index 7d03cd5a..c06ece05 100755 --- a/scripts/gen_iface.lua +++ b/scripts/gen_iface.lua @@ -22,9 +22,13 @@ local increments = { -- constants to increment by one '^MARKER_MAX', '^MARKNUM_', '^MAX_MARGIN', '^STYLE_', '^INDICATOR_' } local changed_setter = {} -- holds properties changed to setter functions +local function to_en_us(name) + return name:gsub('([iIlL][oO])[uU]([rR])', '%1%2'): + gsub('ise$', 'ize'):gsub('([cC][eE][nN][tT])([rR])([eE])', '%1%3%2') +end local function to_lua_name(camel_case) - return camel_case:gsub('([a-z])([A-Z])', '%1_%2'): - gsub('([A-Z])([A-Z][a-z])', '%1_%2'):lower() + return to_en_us(camel_case:gsub('([a-z])([A-Z])', '%1_%2'): + gsub('([A-Z])([A-Z][a-z])', '%1_%2'):lower()) end local function is_length(ptype, param) return ptype == 'position' and param:find('^length') @@ -38,7 +42,7 @@ for line in io.lines('../src/scintilla/include/Scintilla.iface') do if line:find('^val ') then local name, value = line:match(const_patt) for i = 1, #ignores do if name:find(ignores[i]) then goto continue end end - name = name:gsub('^SC_', ''):gsub('^SC([^N]%u+)', '%1') + name = to_en_us(name:gsub('^SC_', ''):gsub('^SC([^N]%u+)', '%1')) if name == 'FIND_REGEXP' then value = tostring(tonumber(value) + 2^23) -- add SCFIND_CXX11REGEX value = value:gsub('%.0$', '') -- Lua 5.3+ may append this -- cgit v1.2.3