fackup
This commit is contained in:
parent
2f5af66c5c
commit
0b8584d4f8
|
@ -367,7 +367,7 @@ namespace eval Editor {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
proc VarHelper {x y w word} {
|
proc VarHelper {x y w word fileType} {
|
||||||
global editors lexers variables
|
global editors lexers variables
|
||||||
variable txt
|
variable txt
|
||||||
variable win
|
variable win
|
||||||
|
@ -377,12 +377,17 @@ namespace eval Editor {
|
||||||
# puts "$x $y $w $word"
|
# puts "$x $y $w $word"
|
||||||
set varList [dict get $editors $txt variableList]
|
set varList [dict get $editors $txt variableList]
|
||||||
set findedVars ""
|
set findedVars ""
|
||||||
foreach i [lsearch -all $varList $word*] {
|
|
||||||
# puts [lindex $varList $i]
|
set lastSymbol [string last "[dict get $lexers $fileType variableSymbol]" $word]
|
||||||
set item [lindex [lindex $varList $i] 0]
|
if {$lastSymbol ne "-1"} {
|
||||||
# puts $item
|
set word [string trim [string range $word $lastSymbol end]]
|
||||||
if {[lsearch $findedVars $item] eq "-1"} {
|
foreach i [lsearch -all $varList $word*] {
|
||||||
lappend findedVars $item
|
# puts [lindex $varList $i]
|
||||||
|
set item [lindex [lindex $varList $i] 0]
|
||||||
|
# puts $item
|
||||||
|
if {[lsearch $findedVars $item] eq "-1"} {
|
||||||
|
lappend findedVars $item
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if { [winfo exists $win] } { destroy $win }
|
if { [winfo exists $win] } { destroy $win }
|
||||||
|
@ -400,7 +405,7 @@ namespace eval Editor {
|
||||||
pack $win.lBox -expand true -fill y -side left
|
pack $win.lBox -expand true -fill y -side left
|
||||||
# pack $win.yscroll -side left -expand false -fill y
|
# pack $win.yscroll -side left -expand false -fill y
|
||||||
|
|
||||||
foreach { word } $findedVars {
|
foreach { word } [lsort $findedVars] {
|
||||||
$win.lBox insert end $word
|
$win.lBox insert end $word
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,24 +500,22 @@ namespace eval Editor {
|
||||||
wm geom $win +$x+$y
|
wm geom $win +$x+$y
|
||||||
}
|
}
|
||||||
|
|
||||||
proc ReleaseKey {k txt} {
|
proc ReleaseKey {k txt fileType} {
|
||||||
global cfgVariables
|
global cfgVariables lexers
|
||||||
set pos [$txt index insert]
|
set pos [$txt index insert]
|
||||||
set lineNum [lindex [split $pos "."] 0]
|
set lineNum [lindex [split $pos "."] 0]
|
||||||
set posNum [lindex [split $pos "."] 1]
|
set posNum [lindex [split $pos "."] 1]
|
||||||
SearchBrackets $txt
|
SearchBrackets $txt
|
||||||
# set lineStart [$txt index "$pos linestart"]
|
# set lineStart [$txt index "$pos linestart"]
|
||||||
# puts "$pos $lineStart"
|
# puts "$pos $lineStart"
|
||||||
|
puts [$txt get [$txt index insert -1 word] $pos]
|
||||||
|
set lastSymbol [string last " " [$txt get $lineNum.0 $pos]]
|
||||||
if {$cfgVariables(variableHelper) eq "true"} {
|
if {$cfgVariables(variableHelper) eq "true"} {
|
||||||
set lastSymbol [string last "$" [$txt get $lineNum.0 $pos]]
|
set word [string trim [$txt get $lineNum.[expr $lastSymbol + 1] $pos]]
|
||||||
if {$lastSymbol ne "-1"} {
|
set box [$txt bbox insert]
|
||||||
set word [string trim [$txt get $lineNum.[expr $lastSymbol + 1] $pos]]
|
set box_x [expr [lindex $box 0] + [winfo rootx $txt] ]
|
||||||
# puts "$pos; $lineNum; $pos; $lastSymbol; $word"
|
set box_y [expr [lindex $box 1] + [winfo rooty $txt] + [lindex $box 3] ]
|
||||||
set box [$txt bbox insert]
|
Editor::VarHelper $box_x $box_y $txt $word $fileType
|
||||||
set box_x [expr [lindex $box 0] + [winfo rootx $txt] ]
|
|
||||||
set box_y [expr [lindex $box 1] + [winfo rooty $txt] + [lindex $box 3] ]
|
|
||||||
Editor::VarHelper $box_x $box_y $txt $word
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if {$cfgVariables(procedureHelper) eq "true"} {
|
if {$cfgVariables(procedureHelper) eq "true"} {
|
||||||
puts "Find proc"
|
puts "Find proc"
|
||||||
|
@ -586,7 +589,7 @@ namespace eval Editor {
|
||||||
global cfgVariables
|
global cfgVariables
|
||||||
# variable txt
|
# variable txt
|
||||||
# set txt $w.frmText.t
|
# set txt $w.frmText.t
|
||||||
bind $txt <KeyRelease> "Editor::ReleaseKey %K $txt"
|
bind $txt <KeyRelease> "Editor::ReleaseKey %K $txt $fileType"
|
||||||
bind $txt <KeyPress> "Editor::PressKey %K $txt"
|
bind $txt <KeyPress> "Editor::PressKey %K $txt"
|
||||||
# bind $txt <KeyRelease> "Editor::Key %k %K"
|
# bind $txt <KeyRelease> "Editor::Key %k %K"
|
||||||
#$txt tag bind Sel <Control-/> {puts ">>>>>>>>>>>>>>>>>>>"}
|
#$txt tag bind Sel <Control-/> {puts ">>>>>>>>>>>>>>>>>>>"}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user