Исправлена ошибка с закрытием файлов в редакторе при закрытии папки

This commit is contained in:
svkalinin 2022-11-25 08:07:55 +03:00
parent 167c374b9d
commit 0fcc2a652f

View File

@ -157,26 +157,30 @@ namespace eval FileOper {
set treeItem $parent set treeItem $parent
set parent [$tree parent $treeItem] set parent [$tree parent $treeItem]
} }
set upper [Tree::GetUpperItem $tree $treeItem]
if {$parent eq "" && [string match "directory::*" $treeItem] == 1} { if {$parent eq "" && [string match "directory::*" $treeItem] == 1} {
# puts "tree root item: $treeItem" # puts "tree root item: $treeItem"
set proj [string trimleft $upper "directory::"]
foreach nbItem [$nbEditor tabs] { foreach nbItem [$nbEditor tabs] {
set item [string trimleft [file extension $nbItem] "."] set item [string trimleft [file extension $nbItem] "."]
# puts $item # puts "$upper $item"
if [string match "$proj*" $item] {
if [$tree exists "file::$item"] { if [$tree exists "file::$item"] {
$nbEditor select $nbItem $nbEditor select $nbItem
Close Close
} }
} }
}
set nextProj [$tree next $treeItem] set nextProj [$tree next $treeItem]
# puts $nextProj # puts $nextProj
set prevProj [$tree prev $treeItem] set prevProj [$tree prev $treeItem]
# puts $prevProj # puts $prevProj
if {$nextProj ne ""} { if {$nextProj ne ""} {
SetActiveProject [$tree item $nextProj -values] SetActiveProject [$tree item $nextProj -values]
puts $activeProject # puts $activeProject
} elseif {$prevProj ne ""} { } elseif {$prevProj ne ""} {
SetActiveProject [$tree item $prevProj -values] SetActiveProject [$tree item $prevProj -values]
puts $activeProject # puts $activeProject
} else { } else {
unset activeProject unset activeProject
.frmStatus.lblGitLogo configure -image pixel .frmStatus.lblGitLogo configure -image pixel