Am Sonntag, 4. März 2007 11:36:53 schrieb mitchell:
> Hi,
>
> > is it possible to list all keys defined in the pseudo-table props?
>
> http://scintilla.sf.net/SciTEDoc.html
> has all the properties that could be used
>
> I believe the props table has no set fields, but rather when an index is
> requested, Lua asks SciTE to get the property and returns that.
Ok, if i understand you right, we could not get all property keys through lua.
So, i currently use a not really nice approach to find defined commands
and their shortcuts. If someone is interrested here is my current
implementation as an extman for one language only at the moment:
--------------------------------------8<-------------------------------------
scite_Command 'Display Shortcuts|display_shortcuts|$(file.patterns.rb)|Ctrl+j'
function display_shortcuts()
-- By default, commands 0 to 9 have keyboard shortcuts
-- Ctrl+0 to Ctrl+9 respectively, but this can be overridden.
-- The command number can be in the range of 0 to 99.
file_patterns = {'$(file.patterns.rb)', '*.rb', '*'}
for i, file_pattern in file_patterns do
for index = 0, 99 do
command_name_key =
'command.name.'..index..'.'..file_pattern
command_shortcut_key =
'command.shortcut.'..index..'.'..file_pattern
if props[command_name_key] ~= '' then
command_name = props[command_name_key]
shortcut = props[command_shortcut_key]
if shortcut == '' and index <= 9 then
shortcut = 'Ctrl+'..index
end
info =
command_name..'('..shortcut..')'..' -
index: '..
index..' - pattern: '..file_pattern
print(info)
end
end
end
end
-------------------------------------->8-------------------------------------
regards, Holger
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest