TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Nested Tab Completions

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
atraeyu



Joined: 12 Dec 2007
Posts: 165

PostPosted: Fri Sep 26, 2014 7:34 pm    Post subject: Nested Tab Completions Reply with quote

Would it be possible to add support for nested tab completions?

I use a lot of commands that take arguments, but they unfortunately don't work quite right with the tab completion, as a simple example:



Quote:

palette
palette bg


if I try to add a tab completion for "palette bg"
pal <tab> expands to palette and palette<tab> expands to "palette bg" but then another tab expands to "palette bg pal" rather than back "palette".
Back to top
View user's profile Send private message AIM Address
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Fri Sep 26, 2014 7:42 pm    Post subject: Reply with quote

Might be a bug. Will add it to my todo list.
Back to top
View user's profile Send private message Send e-mail
atraeyu



Joined: 12 Dec 2007
Posts: 165

PostPosted: Sat Sep 27, 2014 10:04 am    Post subject: Reply with quote

Awesome, thank you.
Back to top
View user's profile Send private message AIM Address
atraeyu



Joined: 12 Dec 2007
Posts: 165

PostPosted: Sat Sep 27, 2014 2:14 pm    Post subject: Reply with quote

Just as an example:

Code:
#nop VSOF;

#tab module list;
#tab module load;
#tab module kill;
#tab module reload;

#alias module {

    #showme MODULE;

    #if {"%1" == "list"} {moduleList};
    #elseif {"%1" == "load"} {moduleLoad %2};
    #elseif {"%1" == "kill"} {moduleKill %2};
    #elseif {"%1" == "reload"} {mdouleReload %2};
    #else {
        #showme ERROR: Usage: module list | load <module> | kill <module> | reload <module>;
    };
}


#alias moduleList   {#showme MODULELIST};
#alias moduleLoad   {#showme MODULELOAD %1};
#alias moduleKill   {#showme MODULEKILL %1};
#alias moduleReload {#showme MODULERELOAD %1};


Quote:
mod<tab>
module kill<tab>
module mod<tab>
module kill mod<tab>
module module mod


Also, it would be really awesome to be able to specify the tab completion order, for example - the most common command I use from this completion list is "module list" - so being able to force that as the highest priority completion would be great, something like:

Code:
#tab module list {1};
#tab module load {2};
#tab module reload {3};
#tab module kill {4};


Quote:
mod<tab>
module list<tab>
module load<tab>
module reload <tab>
module kill <tab>
module list


On a side node, it appears that whatever the original item you tabbed to complete is inserted into the tab completion list. Not sure that this is desired behavior? I can't imagine why it would be used.

For example, when I type:

Quote:
mod<tab>


And then tab through the available completions, I end up back at "mod". I know that in bash & zsh, the original item you tabbed from isn't in the completion list, it only cycles through the legitimate completions, if you wanted to undo the tab completion, you typically hit backspace to cancel it.
Back to top
View user's profile Send private message AIM Address
atraeyu



Joined: 12 Dec 2007
Posts: 165

PostPosted: Sat Sep 27, 2014 2:17 pm    Post subject: Reply with quote

Just as an example:

Code:
#nop VSOF;

#tab module list;
#tab module load;
#tab module kill;
#tab module reload;

#alias module {

    #showme MODULE;

    #if {"%1" == "list"} {moduleList};
    #elseif {"%1" == "load"} {moduleLoad %2};
    #elseif {"%1" == "kill"} {moduleKill %2};
    #elseif {"%1" == "reload"} {mdouleReload %2};
    #else {
        #showme ERROR: Usage: module list | load <module> | kill <module> | reload <module>;
    };
}


#alias moduleList   {#showme MODULELIST};
#alias moduleLoad   {#showme MODULELOAD %1};
#alias moduleKill   {#showme MODULEKILL %1};
#alias moduleReload {#showme MODULERELOAD %1};


Quote:
mod<tab>
module kill<tab>
module mod<tab>
module kill mod<tab>
module module mod


So with the nested completions, it's not even hitting anything except the one item, then it's just cycling through the original completion stub and the "module kill" completion, but it looks like it's tokenizing the completion with the space in it, and discarding the first token somewhere along the process.

Also, it would be really awesome to be able to specify the tab completion order, for example - the most common command I use from this completion list is "module list" - so being able to force that as the highest priority completion would be great, something like:

Code:
#tab module list {1};
#tab module load {2};
#tab module reload {3};
#tab module kill {4};


Quote:
mod<tab>
module list<tab>
module load<tab>
module reload <tab>
module kill <tab>
module list


On a side node, it appears that whatever the original item you tabbed to complete is inserted into the tab completion list. Not sure that this is desired behavior? I can't imagine why it would be used.

For example, when I type:

Quote:
mod<tab>


And then tab through the available completions, I end up back at "mod". I know that in bash & zsh, the original item you tabbed from isn't in the completion list, it only cycles through the legitimate completions, if you wanted to undo the tab completion, you typically hit backspace to cancel it.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Feature Requests All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group