From dbb8c3f91125fd4f35b69a00ce570f15f8cf5f92 Mon Sep 17 00:00:00 2001 From: svkalinin Date: Wed, 23 Nov 2022 12:50:07 +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=D0=BE=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BA=D0=BB=D1=8E?= =?UTF-8?q?=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B2=D0=BA=D0=BB=D0=B0=D0=B4?= =?UTF-8?q?=D0=BE=D0=BA=20=D0=BF=D1=80=D0=B8=20=D0=B7=D0=B0=D0=BA=D1=80?= =?UTF-8?q?=D1=8B=D1=82=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/files.tcl | 12 ++++++++---- lib/gui.tcl | 1 + lib/notebook.tcl | 3 +++ lib/procedure.tcl | 3 ++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/files.tcl b/lib/files.tcl index 23b58ea..ae1930a 100644 --- a/lib/files.tcl +++ b/lib/files.tcl @@ -233,10 +233,13 @@ namespace eval FileOper { $tree delete $treeItem } } - unset modified($nbItem) + if [info exists modified($nbItem)] { + unset modified($nbItem) + } .frmStatus.lblPosition configure -text "" .frmStatus.lblEncoding configure -text "" .frmStatus.lblSize configure -text "" + NB::NextTab $nbEditor 0 } proc Save {} { @@ -439,9 +442,10 @@ namespace eval FileOper { set res [SearchStringInFolder $str] } } - FindInFilesDialog $txt $res - .find.entryFind delete 0 end - .find.entryFind insert end $str + if [FindInFilesDialog $txt $res] { + .find.entryFind delete 0 end + .find.entryFind insert end $str + } } proc ReplaceInFiles {} { diff --git a/lib/gui.tcl b/lib/gui.tcl index b8f706c..0f359bb 100644 --- a/lib/gui.tcl +++ b/lib/gui.tcl @@ -188,6 +188,7 @@ ttk::style layout TNotebook.Tab { bind TNotebook "catch {NB::PressTab %W %x %y}\;[bind TNotebook ];break" # bind <> "NB::PressTab %W %x %y" bind TNotebook "NB::PressTab %W %x %y" +# bind TNotebook FileOper::Close # bind . "NB::NextTab $nbEditor" bind . "NB::NextTab $nbEditor 1" bind . "NB::NextTab $nbEditor -1" diff --git a/lib/notebook.tcl b/lib/notebook.tcl index 338d4fb..af24975 100644 --- a/lib/notebook.tcl +++ b/lib/notebook.tcl @@ -61,6 +61,9 @@ namespace eval NB { proc NextTab {w step} { global tree set i [expr [$w index end] - 1] + if {[$w select] eq ""} { + return + } set nbItemIndex [$w index [$w select]] if {$nbItemIndex eq 0 && $step eq "-1"} { $w select $i diff --git a/lib/procedure.tcl b/lib/procedure.tcl index 51b3f07..5135199 100644 --- a/lib/procedure.tcl +++ b/lib/procedure.tcl @@ -511,7 +511,7 @@ proc FindInFilesDialog {txt {args ""}} { } set win .find - if { [winfo exists $win] } { destroy $win } + if { [winfo exists $win] } { destroy $win; return false} toplevel $win wm transient $win . wm overrideredirect $win 1 @@ -639,6 +639,7 @@ proc FindInFilesDialog {txt {args ""}} { focus -force $win.entryFind } # $win.lBox focus I001 + return true } proc ShowMessage {title msg} {