From 134f9a857e1b56252820a9d3d7f44d41b7d026ea Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sat, 6 Dec 2008 13:01:31 -0500 Subject: Tweaked scripts/gen_iface.lua. Ignores SciTE IDM_* constants automatically and changes SC_MASK_FOLDERS from 0xFE000000 to -33554432 due to lua_checklong() issues. (0xFE000000 has a value of 4261412864, but lua_checklong() gives it as -2147483648 due to overflow I suspect. Either way -2147483648 & (1 << SC_MARKNUM_FOLDEROPEN) behaves as expected, but -2147483648 & (1 << SC_MARKNUM_FOLDER) does not. --- scripts/gen_iface.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/gen_iface.lua b/scripts/gen_iface.lua index 9c42c097..b81f52c5 100755 --- a/scripts/gen_iface.lua +++ b/scripts/gen_iface.lua @@ -1,7 +1,7 @@ #!/usr/bin/lua -- Copyright 2007-2008 Mitchell mitchellcaladbolg.net. See LICENSE. -local f = io.open('/usr/share/scite-st/src/scite/src/IFaceTable.cxx') +local f = io.open('../../scite-tools/branches/scite-st/src/scite/src/IFaceTable.cxx') local contents = f:read('*all') f:close() @@ -21,8 +21,11 @@ out = out..'textadept.constants = {\n' -- {"constant", value} for item in constants:sub(2, -2):gmatch('%b{}') do local name, value = item:match('^{"(.-)",(.-)}') - local line = (" %s = %s,\n"):format(name, value) - out = out..line + if not name:match('^IDM_') then + if name == 'SC_MASK_FOLDERS' then value = '-33554432' end + local line = (" %s = %s,\n"):format(name, value) + out = out..line + end end out = out..[[ SCN_STYLENEEDED = 2000, @@ -80,6 +83,6 @@ for item in properties:sub(2, -2):gmatch('%b{}') do end out = out..'}\n' -f = io.open('/usr/share/textadept/core/iface.lua', 'w') +f = io.open('../core/iface.lua', 'w') f:write(out) f:close() -- cgit v1.2.3