From c38dffeeb9b26c246817c1926729c5863c87d9a8 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Fri, 31 Oct 2025 18:56:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=B8=20=D0=B7=D0=B0=D0=BA=D1=80=D1=8B=D1=82=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BD=D0=BE=D0=B2=D0=BE=D0=B3=D0=BE=20=D1=84=D0=B0?= =?UTF-8?q?=D0=B9=D0=BB=D0=B0.=20=D0=A2=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B8=20=D1=84=D0=B0=D0=B9=D0=BB=20=D0=B1=D1=83?= =?UTF-8?q?=D0=B4=D0=B5=D1=82=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D1=80=D1=8B=D1=82=20=D0=BF=D0=BE=D0=B4=20=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D1=8B=D0=BC=20=D0=B8=D0=BC=D0=B5=D0=BD=D0=B5=D0=BC.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/files.tcl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/files.tcl b/lib/files.tcl index 67ab73a..42b1503 100644 --- a/lib/files.tcl +++ b/lib/files.tcl @@ -279,14 +279,16 @@ namespace eval FileOper { -icon question -type yesnocancel \ -detail [::msgcat::mc "Do you want to save it?"]] switch $answer { - yes Save + yes {Save close} no {} cancel {return "cancel"} } } } - $nbEditor forget $nbItem - destroy $nbItem + if {[$nbEditor select] eq $nbItem} { + $nbEditor forget $nbItem + destroy $nbItem + } set treeItem "file::[string range $nbItem [expr [string last "." $nbItem] +1] end ]" if [$tree exists $treeItem] { # delete all functions from tree item @@ -311,7 +313,7 @@ namespace eval FileOper { NB::NextTab $nbEditor 0 } - proc Save {} { + proc Save {{type ""}} { global nbEditor tree env activeProject dir if [info exists activeProject] { @@ -346,6 +348,12 @@ namespace eval FileOper { if {[file tail $filePath] eq "projman.ini"} { Config::read $dir(cfg) } + if [string match "*untitled*" $nbEditorItem] { + FileOper::Close + if {$type ne "close"} { + FileOper::Edit $filePath + } + } } proc SaveAll {} {