summaryrefslogtreecommitdiff
path: root/gdb/gdbtk/library/srcwin.itb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-10-04 15:01:36 +0000
committerTom Tromey <tromey@redhat.com>2001-10-04 15:01:36 +0000
commit267c90f58a412404efda3631809b2efc81c4ad23 (patch)
tree5c02147d92582417bf73b3fed24fda2d3f75d533 /gdb/gdbtk/library/srcwin.itb
parent1d1bbd7dc6e9d97f0bc35c8862fa32cf6aafd0ce (diff)
downloadgdb-267c90f58a412404efda3631809b2efc81c4ad23.tar.gz
* library/tclIndex: Updated.
* library/prefs.tcl (pref_set_defaults): Define gdb/editor preference. * library/srcpref.itb (SrcPref::constructor): Save gdb/editor preference. (SrcPref::build_win): Added external editor control. * library/srctextwin.itb (SrcTextWin::do_source_popup): Always enable external editor. Use `code' instead of `list'. * library/srcwin.itb (SrcWin::edit): Use Editor::edit. * library/editor.tcl: New file. * generic/gdbtk.c (enable_external_editor): Removed. (external_editor_command): Default to NULL. (gdbtk_init): Don't set enable_external_editor. Free external editor command when finished with it.
Diffstat (limited to 'gdb/gdbtk/library/srcwin.itb')
-rw-r--r--gdb/gdbtk/library/srcwin.itb16
1 files changed, 5 insertions, 11 deletions
diff --git a/gdb/gdbtk/library/srcwin.itb b/gdb/gdbtk/library/srcwin.itb
index f54c5a47b35..5d9029669fb 100644
--- a/gdb/gdbtk/library/srcwin.itb
+++ b/gdb/gdbtk/library/srcwin.itb
@@ -684,26 +684,20 @@ body SrcWin::set_execution_status { {line ""} {pc ""}} {
# PUBLIC METHOD: edit - invoke external editor
# ------------------------------------------------------------------
body SrcWin::edit {} {
- global enable_external_editor external_editor_command
+ global external_editor_command
# If external editor is enabled, pass the file to the specified command
-
+
if {$current(filename) == ""} {
tk_dialog .warn {Edit} {No file is loaded in the source window.} error 0 Ok
return
}
-
+
if {[catch {$twin report_source_location} loc_info]} {
tk_dialog .warn "Edit" "No source file selected" error 0 Ok
return
}
-
-
- if {[info exists enable_external_editor] && $enable_external_editor} {
- if {[catch {uplevel \#0 "$external_editor_command edit $loc_info"} ]} {
- tk_dialog .warn-sn "Edit" $err error 0 Ok
- }
- return
- }
+
+ Editor::edit $loc_info
}
# ------------------------------------------------------------------