fix tab context menu close (invalid switching after deletion)

This commit is contained in:
stefan schippers 2023-10-25 16:47:11 +02:00
parent 8e844ff913
commit f9d3661c15
1 changed files with 6 additions and 2 deletions

View File

@ -5604,11 +5604,15 @@ proc tab_ctx_cmd {tab_but what} {
xschem new_schematic switch $old {} 0 ;# no draw
} elseif {$what eq {close}} {
set old [xschem get current_win_path]
set ntabs [xschem get ntabs]
xschem new_schematic switch $win_path {} 0 ;# no draw
xschem exit
set remaining_tabs [xschem exit]
if { $old != $win_path || $remaining_tabs == $ntabs} {
# don't switch if we were on the tab that has been closed.
xschem new_schematic switch $old {} 1 ;# draw
}
}
}
# puts $filename
}
proc tab_context_menu {tab_but} {