From 4f01a1fbd7f2575c0ae82607a7684d8293f80418 Mon Sep 17 00:00:00 2001 From: svk Date: Wed, 21 Jan 2026 12:24:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D1=84=D0=BB=D0=B0=D0=B3=20=D0=BC=D0=BE=D0=B4?= =?UTF-8?q?=D0=B8=D1=84=D0=B8=D0=BA=D0=B0=D1=86=D0=B8=D0=B8=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D0=BE=D1=82=D0=BA=D1=80=D1=8B=D1=82=D0=B8=D0=B8=20?= =?UTF-8?q?=D1=84=D0=B0=D0=B9=D0=BB=D0=B0,=20=D0=B8=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20'=D0=9E=D1=82=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0'=20=D0=B4=D0=BE=20=D0=BF=D1=83=D1=81=D1=82?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0.=20=D0=92?= =?UTF-8?q?=D0=BD=D0=B5=D1=81=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BD=D0=B0=20=D0=BE=D1=81=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=B5=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B9=20https://github.com/wandrien/projman?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/editor.tcl | 4 ++-- lib/files.tcl | 7 ++++++- lib/procedure.tcl | 14 ++++++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lib/editor.tcl b/lib/editor.tcl index 2588002..10572a1 100644 --- a/lib/editor.tcl +++ b/lib/editor.tcl @@ -799,7 +799,7 @@ namespace eval Editor { bind $txt {OverWrite} bind $txt "Editor::SearchBrackets $txt" bind $txt "Editor::SelectionHighlight $txt" - bind $txt <> "SetModifiedFlag $w $nb" + bind $txt <> "SetModifiedFlag $w $nb auto" bind $txt "Editor::SearchBrackets %W" bind $txt "Editor::SearchBrackets %W" bind $txt "catch {Editor::GoToFunction $txt}" @@ -965,7 +965,7 @@ namespace eval Editor { set nbEditorItem [NB::InsertItem $nbEditor $fileFullPath "file"] # puts "$nbEditorItem, $nbEditor" Editor $fileFullPath $nbEditor $nbEditorItem - SetModifiedFlag $nbEditorItem $nbEditor + SetModifiedFlag $nbEditorItem $nbEditor force focus -force $nbEditorItem.frmText.t.t } diff --git a/lib/files.tcl b/lib/files.tcl index b3c2996..42de62b 100644 --- a/lib/files.tcl +++ b/lib/files.tcl @@ -489,7 +489,7 @@ namespace eval FileOper { set txt $itemName.frmText.t if ![string match "*untitled*" $itemName] { set file [open "$fileFullPath" r] - $txt insert end [chan read -nonewline $file] + $txt insert end [chan read -nonewline $file] close $file } # Delete emty last line @@ -497,6 +497,11 @@ namespace eval FileOper { $txt delete {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 } diff --git a/lib/procedure.tcl b/lib/procedure.tcl index 954a42a..2493408 100644 --- a/lib/procedure.tcl +++ b/lib/procedure.tcl @@ -195,9 +195,19 @@ proc ResetModifiedFlag {w nbEditor} { # puts "ResetModifiedFlag: $lbl" $nbEditor tab $w -text $lbl } -proc SetModifiedFlag {w nbEditor} { +proc SetModifiedFlag {w nbEditor flag} { 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 lbl [$nbEditor tab $w -text] # puts "SetModifiedFlag: $w; $modified($w); >$lbl<"