Исправил сохранение и закрытие нового файла. Теперь при сохранении файл будет переоткрыт под новым именем.
This commit is contained in:
@@ -279,14 +279,16 @@ namespace eval FileOper {
|
|||||||
-icon question -type yesnocancel \
|
-icon question -type yesnocancel \
|
||||||
-detail [::msgcat::mc "Do you want to save it?"]]
|
-detail [::msgcat::mc "Do you want to save it?"]]
|
||||||
switch $answer {
|
switch $answer {
|
||||||
yes Save
|
yes {Save close}
|
||||||
no {}
|
no {}
|
||||||
cancel {return "cancel"}
|
cancel {return "cancel"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$nbEditor forget $nbItem
|
if {[$nbEditor select] eq $nbItem} {
|
||||||
destroy $nbItem
|
$nbEditor forget $nbItem
|
||||||
|
destroy $nbItem
|
||||||
|
}
|
||||||
set treeItem "file::[string range $nbItem [expr [string last "." $nbItem] +1] end ]"
|
set treeItem "file::[string range $nbItem [expr [string last "." $nbItem] +1] end ]"
|
||||||
if [$tree exists $treeItem] {
|
if [$tree exists $treeItem] {
|
||||||
# delete all functions from tree item
|
# delete all functions from tree item
|
||||||
@@ -311,7 +313,7 @@ namespace eval FileOper {
|
|||||||
NB::NextTab $nbEditor 0
|
NB::NextTab $nbEditor 0
|
||||||
}
|
}
|
||||||
|
|
||||||
proc Save {} {
|
proc Save {{type ""}} {
|
||||||
global nbEditor tree env activeProject dir
|
global nbEditor tree env activeProject dir
|
||||||
|
|
||||||
if [info exists activeProject] {
|
if [info exists activeProject] {
|
||||||
@@ -346,6 +348,12 @@ namespace eval FileOper {
|
|||||||
if {[file tail $filePath] eq "projman.ini"} {
|
if {[file tail $filePath] eq "projman.ini"} {
|
||||||
Config::read $dir(cfg)
|
Config::read $dir(cfg)
|
||||||
}
|
}
|
||||||
|
if [string match "*untitled*" $nbEditorItem] {
|
||||||
|
FileOper::Close
|
||||||
|
if {$type ne "close"} {
|
||||||
|
FileOper::Edit $filePath
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc SaveAll {} {
|
proc SaveAll {} {
|
||||||
|
|||||||
Reference in New Issue
Block a user