Author: nornagon
Date: 2005-01-01 04:10:33 -0500 (Sat, 01 Jan 2005)
New Revision: 505

Modified:
   trunk/clients/termvisual/termvisual.pl
Log:
Haver::Config b0rkenness indicator

Modified: trunk/clients/termvisual/termvisual.pl
===================================================================
--- trunk/clients/termvisual/termvisual.pl      2005-01-01 09:01:10 UTC (rev 
504)
+++ trunk/clients/termvisual/termvisual.pl      2005-01-01 09:10:33 UTC (rev 
505)
@@ -20,7 +20,7 @@
 use Haver::Config;
 use Haver::OS;
 
-my ($config, %ucommands, %scommands);
+my (%ucommands, %scommands);
 
 my %palette = (
     channel => 'bright cyan on black',
@@ -66,8 +66,13 @@
         },
     );
     $heap->{config} = $heap->{config_handle}->config;
+    $heap->{config}{CommandChars} = '/.';
 
-    $heap->{vt} = Term::Visual->new( Alias => "user_interface" );
+    $heap->{vt} = Term::Visual->new(
+        Alias        => "user_interface",
+        Common_Input => 1,
+        Tab_Complete => \&tab_complete,
+    );
 
     $heap->{vt}->set_palette(%palette);
 
@@ -387,5 +392,21 @@
     return $poe_kernel->get_active_session()->get_heap();
 }
 
+sub tab_complete {
+    my $left = shift;
+    my $heap = get_heap();
+    my $cc = $heap->{config}{CommandChars};
+    if ($cc ne '/.') { return $cc; }
+    return;
+    $left =~ /^[$cc]/;
+    return;
+    # return if it's not a command
+    if (!($left =~ /^[$heap->{config}{CommandChars}]/)) { vt_print("b"); }
+    return;
+    $left =~ s/^[$heap->{config}{CommandChars}]//;
+    my @ret = grep { /^$left/ } keys %ucommands;
+#    return @ret;
+}
+
 POE::Kernel->run();
 exit 0;


Reply via email to