Author: wmb Date: 2007-07-05 19:12:04 +0200 (Thu, 05 Jul 2007) New Revision: 457
Modified: forth/lib/cmdcpl.fth Log: Command completion - don't erase back to longest possible match. This helps when you try to complete a filename. Filename completion isn't implemented (and would be very hard to implement), but it isn't nice when someone tries to complete a filename and thus loses most of what they have already typed.
Modified: forth/lib/cmdcpl.fth =================================================================== --- forth/lib/cmdcpl.fth 2007-07-05 17:09:48 UTC (rev 456) +++ forth/lib/cmdcpl.fth 2007-07-05 17:12:04 UTC (rev 457) @@ -153,6 +153,7 @@ /n +loop ( flag ) ;
+0 [if] : do-erase ( -- ) \ Side effect: span and bufcursor may be reduced begin word-to-string ( addr ) @@ -163,6 +164,7 @@ cerase repeat ; +[then]
: do-expand ( -- ) expand-initial-substring @@ -173,7 +175,9 @@
: expand-word ( -- ) collect-string find-candidates ( ) - #candidates @ if do-expand else do-erase then + #candidates @ if do-expand else +[ifdef] do-erase do-erase [else] beep [then] + then ;
: show-candidates ( -- )