public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Multi-line tcl expressions
@ 2000-12-07 11:54 Syd Polk
  0 siblings, 0 replies; only message in thread
From: Syd Polk @ 2000-12-07 11:54 UTC (permalink / raw)
  To: insight

I committed the following today:

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:27:04
@@ -379,8 +379,18 @@
  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
+    }
+  }
+
    incr _invoking
-  set text [$_twin get {cmdmark + 1 char} {cmdmark lineend}]
+
    if {$text == ""} {
      set text [lindex $_history 0]
      $_twin insert {insert lineend} $text

Syd Polk		spolk@redhat.com
Engineering Manager	+1 415 777 9810 x 241
Red Hat, Inc.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-12-07 11:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-07 11:54 [PATCH] Multi-line tcl expressions Syd Polk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).