From ae1a1aaba71f13446173028366c269cde180f4df Mon Sep 17 00:00:00 2001 From: svkalinin Date: Fri, 18 Nov 2022 11:43:57 +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=B8=D0=B5=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D0=B4?= =?UTF-8?q?=D1=83=D1=80=D1=8B=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BD=D0=B0=D0=B8=D0=BC=D0=B5=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/editor.tcl | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/editor.tcl b/lib/editor.tcl index 2425eb4..20b39c8 100644 --- a/lib/editor.tcl +++ b/lib/editor.tcl @@ -921,31 +921,23 @@ namespace eval Editor { } proc FindFunction {txt findString} { - global nbEditor - puts $findString set pos "0.0" - # set txt [$nbEditor select].frmText.t $txt see $pos set line [lindex [split $pos "."] 0] set x [lindex [split $pos "."] 1] - # set pos [$txt search -nocase $findString $line.$x end] - set pos [$txt search -nocase -regexp $findString $line.$x end] + set pattern "$findString\\W" + set pos [$txt search -nocase -regexp $pattern $line.$x end] $txt mark set insert $pos $txt see $pos - puts $pos - # highlight the found word set line [lindex [split $pos "."] 0] - # set x [lindex [split $pos "."] 1] - # set x [expr {$x + [string length $findString]}] $txt tag remove sel 1.0 end $txt tag add sel $pos $line.end - # #$text tag configure sel -background $editor(selectbg) -foreground $editor(fg) $txt tag raise sel focus -force $txt.t - # Position return 1 } - # "Alexander Dederer (aka Korwin) + + # "Alexander Dederer (aka Korwin) ## Search close bracket in editor widget proc _searchCloseBracket { widget o_bracket c_bracket start_pos end_pos } { # puts "_searchCloseBracket: $widget $o_bracket $c_bracket $start_pos $end_pos"