Исправлен флаг модификации при открытии файла, исправлена 'Отмена' до пустого файла. Внес исправления на основе изменений https://github.com/wandrien/projman
This commit is contained in:
@@ -799,7 +799,7 @@ namespace eval Editor {
|
|||||||
bind $txt <Insert> {OverWrite}
|
bind $txt <Insert> {OverWrite}
|
||||||
bind $txt <ButtonRelease-1> "Editor::SearchBrackets $txt"
|
bind $txt <ButtonRelease-1> "Editor::SearchBrackets $txt"
|
||||||
bind $txt <Button-1><ButtonRelease-1> "Editor::SelectionHighlight $txt"
|
bind $txt <Button-1><ButtonRelease-1> "Editor::SelectionHighlight $txt"
|
||||||
bind $txt <<Modified>> "SetModifiedFlag $w $nb"
|
bind $txt <<Modified>> "SetModifiedFlag $w $nb auto"
|
||||||
bind $txt <Control-u> "Editor::SearchBrackets %W"
|
bind $txt <Control-u> "Editor::SearchBrackets %W"
|
||||||
bind $txt <Control-Cyrillic_ghe> "Editor::SearchBrackets %W"
|
bind $txt <Control-Cyrillic_ghe> "Editor::SearchBrackets %W"
|
||||||
bind $txt <Control-J> "catch {Editor::GoToFunction $txt}"
|
bind $txt <Control-J> "catch {Editor::GoToFunction $txt}"
|
||||||
@@ -965,7 +965,7 @@ namespace eval Editor {
|
|||||||
set nbEditorItem [NB::InsertItem $nbEditor $fileFullPath "file"]
|
set nbEditorItem [NB::InsertItem $nbEditor $fileFullPath "file"]
|
||||||
# puts "$nbEditorItem, $nbEditor"
|
# puts "$nbEditorItem, $nbEditor"
|
||||||
Editor $fileFullPath $nbEditor $nbEditorItem
|
Editor $fileFullPath $nbEditor $nbEditorItem
|
||||||
SetModifiedFlag $nbEditorItem $nbEditor
|
SetModifiedFlag $nbEditorItem $nbEditor force
|
||||||
focus -force $nbEditorItem.frmText.t.t
|
focus -force $nbEditorItem.frmText.t.t
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -497,6 +497,11 @@ namespace eval FileOper {
|
|||||||
$txt delete {end-1 line} end
|
$txt delete {end-1 line} end
|
||||||
# puts ">[$txt get {end-1 line} end]<"
|
# puts ">[$txt get {end-1 line} end]<"
|
||||||
}
|
}
|
||||||
|
# ------------
|
||||||
|
# Thanks https://github.com/wandrien/
|
||||||
|
# https://github.com/wandrien/projman/commit/7d5539ac2031fbdcb0f4a97465ff19d0c348cf33
|
||||||
|
$txt edit reset
|
||||||
|
# -----------
|
||||||
$txt see 1.0
|
$txt see 1.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -195,9 +195,19 @@ proc ResetModifiedFlag {w nbEditor} {
|
|||||||
# puts "ResetModifiedFlag: $lbl"
|
# puts "ResetModifiedFlag: $lbl"
|
||||||
$nbEditor tab $w -text $lbl
|
$nbEditor tab $w -text $lbl
|
||||||
}
|
}
|
||||||
proc SetModifiedFlag {w nbEditor} {
|
proc SetModifiedFlag {w nbEditor flag} {
|
||||||
global modified
|
global modified
|
||||||
#$w.frmText.t edit modified false
|
# ------------
|
||||||
|
# Thanks https://github.com/wandrien/
|
||||||
|
# https://github.com/wandrien/projman/commit/04e5c892ae06d3e013472d292cd4435804184f6b
|
||||||
|
if {$flag eq "force"} {
|
||||||
|
$w.frmText.t edit modified true
|
||||||
|
} else {
|
||||||
|
if {![$w.frmText.t edit modified]} {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# ---------
|
||||||
set modified($w) "true"
|
set modified($w) "true"
|
||||||
set lbl [$nbEditor tab $w -text]
|
set lbl [$nbEditor tab $w -text]
|
||||||
# puts "SetModifiedFlag: $w; $modified($w); >$lbl<"
|
# puts "SetModifiedFlag: $w; $modified($w); >$lbl<"
|
||||||
|
|||||||
Reference in New Issue
Block a user