This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[RFA] Multi-line tcl expressions in GUI console
- To: insight at sources dot redhat dot com
- Subject: [RFA] Multi-line tcl expressions in GUI console
- From: Larry Smith <larry at smith-house dot org>
- Date: Fri, 1 Dec 2000 16:15:57 -0500
This patch allows the user to enter multi-line tcl expressions
when using the "tk" command. It uses [info complete $cmd] to
determine if the command is complete, and if it is not, inserts
the continuation character "\" and allows the user to continue
on the next line, until the expression is finally complete and
ready to be evaluated.
2000-12-01 Larry Smith <lsmith@redhat.com>
* console.itb (invoke): Added logic to allow user to build
up multiline "tk" commands based on results from checking
command with [info complete $cmd]s.
Index: console.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/console.itb,v
retrieving revision 1.4
diff -u -r1.4 console.itb
--- console.itb 2000/11/01 22:15:37 1.4
+++ console.itb 2000/12/01 21:11:17
@@ -379,8 +379,19 @@
body Console::invoke {} {
global gdbtk_state
+ set text [$_twin get {cmdmark + 1 char} end ]
+
+ if { "[string range $text 0 1]" == "tk" } {
+ if {! [info complete $text] } {
+ $_twin insert {insert lineend} " \\\n"
+ $_twin see insert
+ return
+ } else {
+ }
+ }
+
incr _invoking
- set text [$_twin get {cmdmark + 1 char} {cmdmark lineend}]
+
if {$text == ""} {
set text [lindex $_history 0]
$_twin insert {insert lineend} $text