From 22441dff4357a0844bd3a45382e490d3e91b258c Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 17 Oct 2001 20:30:29 +0000 Subject: [PATCH] * console.itb (Console::_build_win): Handle bindings which are ";". Also, completely override underlying Text binding. --- gdb/gdbtk/ChangeLog | 5 +++++ gdb/gdbtk/library/console.itb | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/gdb/gdbtk/ChangeLog b/gdb/gdbtk/ChangeLog index 87d43aa848..fd3affbfab 100644 --- a/gdb/gdbtk/ChangeLog +++ b/gdb/gdbtk/ChangeLog @@ -1,3 +1,8 @@ +2001-10-17 Tom Tromey + + * console.itb (Console::_build_win): Handle bindings which + are ";". Also, completely override underlying Text binding. + 2001-10-12 Tom Tromey * library/console.itb (Console::_build_win): Bind Control-m and diff --git a/gdb/gdbtk/library/console.itb b/gdb/gdbtk/library/console.itb index b5326181ec..fa40c088b8 100644 --- a/gdb/gdbtk/library/console.itb +++ b/gdb/gdbtk/library/console.itb @@ -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 } } } -- 2.11.0