diff options
author | HummyPkg <af123@hummypkg.org.uk> | 2016-10-05 18:29:48 +0100 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2016-10-06 06:22:35 +1000 |
commit | c760be2a2c29ba8ce0848bd894af58a74eb0f14a (patch) | |
tree | 5564d58e431293fd83ce37f49f1ab6a22d06995f /initjimsh.tcl | |
parent | ea1229306c4b99fa2b1a1a4081904d1e4b139443 (diff) | |
download | jimtcl-c760be2a2c29ba8ce0848bd894af58a74eb0f14a.zip jimtcl-c760be2a2c29ba8ce0848bd894af58a74eb0f14a.tar.gz jimtcl-c760be2a2c29ba8ce0848bd894af58a74eb0f14a.tar.bz2 |
add filename completion for source command
Diffstat (limited to 'initjimsh.tcl')
-rw-r--r-- | initjimsh.tcl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/initjimsh.tcl b/initjimsh.tcl index f5420ab..e6e015e 100644 --- a/initjimsh.tcl +++ b/initjimsh.tcl @@ -55,6 +55,13 @@ proc tcl::autocomplete {prefix} { }] } } + # Find matching files. + if {[string match "source *" $prefix]} { + set path [string range $prefix 7 end] + return [lmap p [glob -nocomplain "${path}*"] { + function "source $p" + }] + } # Find matching commands, omitting results containing spaces return [lmap p [lsort [info commands $prefix*]] { if {[string match "* *" $p]} { |