aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtk.tcl
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1996-05-18 00:24:41 +0000
committerFred Fish <fnf@specifix.com>1996-05-18 00:24:41 +0000
commit81ae689aa3a8a714e434e494e01f34b10c02e524 (patch)
tree4f7aa463c30caec722f3df56f6ac0e6d501242f5 /gdb/gdbtk.tcl
parent311a76b2665a4ad0ef5ea447fed36a88e93c4ddc (diff)
downloadgdb-81ae689aa3a8a714e434e494e01f34b10c02e524.zip
gdb-81ae689aa3a8a714e434e494e01f34b10c02e524.tar.gz
gdb-81ae689aa3a8a714e434e494e01f34b10c02e524.tar.bz2
* gdbtk.tcl (create_command_window): Change a misspelled "get"
to the intended "cget". (delete_line): Fix so it deletes the current line at the insertion cursor.
Diffstat (limited to 'gdb/gdbtk.tcl')
-rw-r--r--gdb/gdbtk.tcl19
1 files changed, 14 insertions, 5 deletions
diff --git a/gdb/gdbtk.tcl b/gdb/gdbtk.tcl
index 3fcf2ce..30af7b3 100644
--- a/gdb/gdbtk.tcl
+++ b/gdb/gdbtk.tcl
@@ -2315,7 +2315,7 @@ proc create_command_window {} {
set bsBinding [bind Text <BackSpace>]
bind .cmd.text <Delete> "delete_char %W ; $bsBinding; break"
bind .cmd.text <BackSpace> {
- if {([%W get -state] == "disabled")} { break }
+ if {([%W cget -state] == "disabled")} { break }
delete_char %W
}
bind .cmd.text <Control-u> {
@@ -2400,18 +2400,27 @@ proc create_command_window {} {
}
}
+# Trim one character off the command line. The argument is ignored.
+
proc delete_char {win} {
global command_line
set tmp [expr [string length $command_line] - 2]
set command_line [string range $command_line 0 $tmp]
}
+# FIXME: This should actually check that the first characters of the current
+# line match the gdb prompt, since the user can move the insertion point
+# anywhere. It should also check that the insertion point is in the last
+# line of the text widget.
+
proc delete_line {win} {
- global command_line
+ global command_line
+ global gdb_prompt
- $win delete {end linestart + 6 chars} end
- $win see insert
- set command_line {}
+ set tmp [string length $gdb_prompt]
+ $win delete "insert linestart + $tmp chars" "insert lineend"
+ $win see insert
+ set command_line {}
}
#