Diff
Not logged in

Differences From Artifact [d56a0206cd]:

To Artifact [cf379af2f8]:


621
622
623
624
625
626
627
628

629
630
631
632
633
634
635
621
622
623
624
625
626
627

628
629
630
631
632
633
634
635







-
+







					return 0
				}
			} else {
				return 0
			}
		}
	}
	if {![catch [list set type [image type ${cmd}]]]} {
	if {![catch {set type [image type $cmd]}]} {
		switch -- ${type} {
			photo {
				set result [PhotoObj ${text} ${start} ${end} ${line} ${pos}]
				return 1
			}
			default {
				# let the fallback completers do the job.
1456
1457
1458
1459
1460
1461
1462
1463

1464
1465
1466
1467
1468
1469
1470
1456
1457
1458
1459
1460
1461
1462

1463
1464
1465
1466
1467
1468
1469
1470







-
+







			set alias [uplevel [info level] \
			subst [lindex [lindex [QuoteQuotes ${line}] 0] 0]]

			# make `alias' a fully qualified name.
			# this can raise an error, if alias is
			# no valid command.
			#
			if {[catch [list set alias [namespace origin $alias]]]} {
			if {[catch {set alias [namespace origin $alias]}]} {
				return ""
			}

			# strip leading ::'s.
			#
			regsub -all {^::} $alias {} alias
			set namespc [namespace qualifiers $alias]
3038
3039
3040
3041
3042
3043
3044
3045

3046
3047
3048
3049
3050
3051
3052
3038
3039
3040
3041
3042
3043
3044

3045
3046
3047
3048
3049
3050
3051
3052







-
+







# proc complete(regexp) {text start end line pos mod} {
#     We're not on windoze here ...
# }

proc complete(regsub) {text start end line pos mod} {
	set prev [PreviousWord ${start} ${line}]
	if {[llength ${prev}] && "--" != $prev && \
		("-" == [string index ${prev} 0] || 1 == ${pos)}} {
		("-" == [string index ${prev} 0] || 1 == ${pos})} {
		set cmds [RemoveUsedOptions ${line} {
			-all -nocase --} {--}]
		if {[llength ${cmds}]} {
			return [string trim [CompleteFromList ${text} ${cmds}]]
		}
	} else {
		set virtual_pos [expr ${pos} - [FirstNonOption ${line}]]
3445
3446
3447
3448
3449
3450
3451
3452

3453
3454
3455
3456
3457
3458
3459
3445
3446
3447
3448
3449
3450
3451

3452
3453
3454
3455
3456
3457
3458
3459







-
+







	return [CompleteFromList ${text} [RemoveUsedOptions ${line} {
		-nobackslashes -nocommands -novariables <string>}]]
}

proc complete(switch) {text start end line pos mod} {
	set prev [PreviousWord ${start} ${line}]
	if {[llength ${prev}] && "--" != ${prev} && \
		("-" == [string index ${prev} 0] || 1 == ${pos)}} {
		("-" == [string index ${prev} 0] || 1 == ${pos})} {
		set cmds [RemoveUsedOptions ${line} {
			-exact -glob -regexp --} {--}]
		if {[llength ${cmds}]} {
			return [string trim [CompleteFromList ${text} ${cmds}]]
		}
	} else {
		set virtual_pos [expr ${pos} - [FirstNonOption ${line}]]