diff options
author | 2011-06-20 23:33:43 -0400 | |
---|---|---|
committer | 2011-06-20 23:33:43 -0400 | |
commit | b251d96fc420cf8c07ce138271d3981347229b35 (patch) | |
tree | 5a682e7319b59827f3b68ff7638450c7a36ea349 /scripts/gen_iface.lua | |
parent | 3d56741b1ef1ea2790607a5575f771d43aae4308 (diff) | |
download | textadept-b251d96fc420cf8c07ce138271d3981347229b35.tar.gz textadept-b251d96fc420cf8c07ce138271d3981347229b35.zip |
Add unique ID generating functions to scripts/gen_iface.lua.
Diffstat (limited to 'scripts/gen_iface.lua')
-rwxr-xr-x | scripts/gen_iface.lua | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/gen_iface.lua b/scripts/gen_iface.lua index 74a1f8b4..8cb5a2f8 100755 --- a/scripts/gen_iface.lua +++ b/scripts/gen_iface.lua @@ -112,6 +112,43 @@ for item in properties:sub(2, -2):gmatch('%b{}') do end out = out..' }\n' +out = out..[[ + +local marker_number, indic_number, list_type = -1, 7, 0 + +--- +-- Returns a unique marker number. +-- Use this function for custom markers in order to prevent clashes with +-- identifiers of other custom markers. +-- @usage local marknum = _SCINTILLA.next_marker_number() +-- @see buffer.marker_define +function next_marker_number() + marker_number = marker_number + 1 + return marker_number +end + +--- +-- Returns a unique indicator number. +-- Use this function for custom indicators in order to prevent clashes with +-- identifiers of other custom indicators. +-- @usage local indic_num = _SCINTILLA.next_indic_number() +function next_indic_number() + indic_number = indic_number + 1 + return indic_number +end + +--- +-- Returns a unique user list type. +-- Use this function for custom user lists in order to prevent clashes with +-- type identifiers of other custom user lists. +-- @usage local list_type = _SCINTILLA.next_user_list_type() +-- @see buffer.user_list_show +function next_user_list_type() + list_type = list_type + 1 + return list_type +end +]] + f = io.open('../core/iface.lua', 'w') f:write(out) f:close() |