A question to shell.setCompletionFunction
#1
Posted 07 April 2016 - 07:20 PM
I tried to set the completion function:
shell.setCompletionFunction(customEditPath, shell.getCompletionInfo()['rom/programs/edit'])
What did I wrong?
And by the way, how works the set completion function?
#2
Posted 07 April 2016 - 07:33 PM
function shell.setCompletionFunction( sProgram, fnComplete )
tCompletionInfo[ sProgram ] = {
fnComplete = fnComplete
}
end
Edited by everyOS, 07 April 2016 - 09:44 PM.
#3
Posted 07 April 2016 - 10:44 PM
everyOS, on 07 April 2016 - 07:33 PM, said:
function shell.setCompletionFunction( sProgram, fnComplete )
tCompletionInfo[ sProgram ] = {
fnComplete = fnComplete
}
end
Why my completion doesn't work?
shell.setCompletionFunction(customEditPath, shell.getCompletionInfo()['rom/programs/edit'])
Edited by Sewbacca, 07 April 2016 - 10:45 PM.
#4
Posted 07 April 2016 - 11:33 PM
sewbacca said:
#5
Posted 08 April 2016 - 01:28 AM
TL;DR: Give it a function, not the completion info for 'rom/programs/edit'
#6
Posted 08 April 2016 - 02:53 AM
KingofGamesYami, on 08 April 2016 - 01:28 AM, said:
The completion info for 'rom/programs/edit' is, in fact, a function.
Relevant code:
shell.setCompletionFunction( sProgram, fnComplete )
shell.getCompletionInfo()
"rom/programs/edit" key in tCompletionInfo table gets set
So I guess the question is, "what's the value of customEditPath"? Is a path set to it?
#7
Posted 08 April 2016 - 04:02 AM
Bomb Bloke, on 08 April 2016 - 02:53 AM, said:
No, the completion info is a table with an "fnComplete" key.
This should work (untested):
shell.setCompletionFunction(customEditPath, shell.getCompletionInfo()['rom/programs/edit'].fnComplete)
#8
Posted 08 April 2016 - 04:06 AM
Yes, I'd say you've got it.
#9
Posted 08 April 2016 - 08:26 PM
CoderPuppy, on 08 April 2016 - 04:02 AM, said:
Bomb Bloke, on 08 April 2016 - 02:53 AM, said:
No, the completion info is a table with an "fnComplete" key.
This should work (untested):
shell.setCompletionFunction(customEditPath, shell.getCompletionInfo()['rom/programs/edit'].fnComplete)
Doesn't work: table expected got function
#10
Posted 08 April 2016 - 08:55 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











