OSDN Git Service

* console.itb (Console::_build_win): Handle bindings which
authorTom Tromey <tromey@redhat.com>
Wed, 17 Oct 2001 20:30:29 +0000 (20:30 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 17 Oct 2001 20:30:29 +0000 (20:30 +0000)
are ";".  Also, completely override underlying Text binding.

gdb/gdbtk/ChangeLog
gdb/gdbtk/library/console.itb

index 87d43aa..fd3affb 100644 (file)
@@ -1,3 +1,8 @@
+2001-10-17  Tom Tromey  <tromey@cygnus.com>
+
+       * console.itb (Console::_build_win): Handle bindings which
+       are ";".  Also, completely override underlying Text binding.
+
 2001-10-12  Tom Tromey  <tromey@redhat.com>
 
        * library/console.itb (Console::_build_win): Bind Control-m and
index b532618..fa40c08 100644 (file)
@@ -108,7 +108,7 @@ body Console::_build_win {} {
     %W delete {cmdmark + 1 char} insert
     %W see {insert linestart}
   }
-  
+
   # Control-w deletes previous word.
   bind_plain_key $_twin Control-w {
     if {[%W compare {insert -1c wordstart} > cmdmark]} {
@@ -127,13 +127,19 @@ body Console::_build_win {} {
   # movement.  We only need to do this after events we do not
   # explicitly override.  Note that since the edit line is always the
   # last line, we can't possibly go past it, so we don't bother
-  # checking that.
+  # checking that.  Note also that we check for a binding which is
+  # simply `;'; this lets us handle keys already bound via
+  # bind_plain_key.
   foreach event [bind Text] {
-    if {[string match *Key* $event] && [bind $_twin $event] == ""} {
-      bind $_twin $event {
+    if {[string match *Key* $event]
+       && ([bind $_twin $event] == ""
+           || [bind $_twin $event] == ";")} {
+      bind $_twin $event [bind Text $event]
+      bind $_twin $event {+
        if {[%W compare insert <= {cmdmark + 1 char}]} {
          %W mark set insert {cmdmark + 1 char}
        }
+       break
       }
     }
   }