Compare commits

...

5 Commits

Author SHA1 Message Date
svkalinin 167c374b9d Новая сборка 2022-11-24 16:41:33 +03:00
svkalinin 0d5832c84c Переделана процедура определения активного проекта. Исправлено определение ветки git.
Теперь можно нормально работать в двух и более открытых проектах (каталогах/папках)
2022-11-24 13:28:11 +03:00
svkalinin f8c268294a Новая сборка 2022-11-24 12:16:49 +03:00
svkalinin edf2a5e86d Доделан вид диалога поиска по файлам 2022-11-24 11:58:21 +03:00
svkalinin 976aa30657 Исправлен поиск имени функции 2022-11-24 10:46:30 +03:00
7 changed files with 59 additions and 26 deletions

View File

@ -930,11 +930,12 @@ namespace eval Editor {
}
proc FindFunction {txt findString} {
puts "txt: $txt, $findString"
set pos "0.0"
$txt see $pos
set line [lindex [split $pos "."] 0]
set x [lindex [split $pos "."] 1]
set pattern "$findString\\W"
set pattern "$findString\(\\W\|\$\)"
set pos [$txt search -nocase -regexp $pattern $line.$x end]
$txt mark set insert $pos
$txt see $pos

View File

@ -135,16 +135,16 @@ namespace eval FileOper {
set dir $env(HOME)
}
set fullPath [tk_chooseDirectory -initialdir $dir -parent .]
set file [string range $fullPath [expr [string last "/" $fullPath]+1] end]
regsub -all "." $file "_" node
set dir [file dirname $fullPath]
# EditFile .frmBody.frmCat.noteBook.ffiles.frmTreeFiles.treeFiles $node $fullPath
# puts $fullPath
if ![info exists activeProject] {
set activeProject $fullPath
}
.frmStatus.lblGitLogo configure -image git_logo_20x20
.frmStatus.lblGit configure -text "[::msgcat::mc "Branch"]: [Git::Branches current]"
# set file [string range $fullPath [expr [string last "/" $fullPath]+1] end]
# regsub -all "." $file "_" node
# set dir [file dirname $fullPath]
# # EditFile .frmBody.frmCat.noteBook.ffiles.frmTreeFiles.treeFiles $node $fullPath
# # puts $fullPath
# if ![info exists activeProject] {
# set activeProject $fullPath
# }
# .frmStatus.lblGitLogo configure -image git_logo_20x20
# .frmStatus.lblGit configure -text "[::msgcat::mc "Branch"]: [Git::Branches current]"
return $fullPath
}
@ -172,10 +172,10 @@ namespace eval FileOper {
set prevProj [$tree prev $treeItem]
# puts $prevProj
if {$nextProj ne ""} {
set activeProject [$tree item $nextProj -values]
SetActiveProject [$tree item $nextProj -values]
puts $activeProject
} elseif {$prevProj ne ""} {
set activeProject [$tree item $prevProj -values]
SetActiveProject [$tree item $prevProj -values]
puts $activeProject
} else {
unset activeProject

View File

@ -94,7 +94,10 @@ namespace eval Git {
set d [pwd]
if {$activeProject ne ""} {
cd $activeProject
} else {
return ""
}
puts $activeProject
lappend cmd $cfgVariables(gitCommand)
lappend cmd "branch"
# lappend cmd "-s"

View File

@ -29,7 +29,8 @@ proc GetFileMenu {m} {
$m add command -label [::msgcat::mc "Open folder"] -accelerator "Ctrl+K" -command {
set folderPath [FileOper::OpenFolderDialog]
if {$folderPath != ""} {
set activeProject $folderPath
# set activeProject $folderPath
SetActiveProject $folderPath
FileOper::ReadFolder $folderPath
ReadFilesFromDirectory $folderPath $folderPath
}

View File

@ -553,16 +553,16 @@ proc FindInFilesDialog {txt {args ""}} {
bind $win.entryFind <Return> $cmd
grid $win.entryFind -row 0 -column 0 -sticky nsew
grid $win.entryReplace -row 1 -column 0 -sticky nsew
grid $win.bForward -row 0 -column 1 -sticky e
grid $win.bDoneAll -row 1 -column 1 -sticky e
grid $win.entryReplace -row 1 -column 0 -sticky nsew
grid $win.bForward -row 0 -column 2 -sticky e -columnspan 2
grid $win.bDoneAll -row 1 -column 2 -sticky e -columnspan 2
# grid $win.chkRegexp -row 2 -column 0 -sticky w
# grid $win.chkAll -row 2 -column 1 -sticky w
grid $win.lblCounter -row 2 -column 0 -columnspan 2 -sticky we
grid $win.lblCounter -row 2 -column 0 -columnspan 4 -sticky we
grid $win.lBox -row 3 -column 0 -columnspan 2 -sticky nsew
grid $win.v -row 3 -column 2 -sticky nsew
grid $win.h -row 4 -column 0 -sticky nsew
grid $win.lBox -row 3 -column 0 -columnspan 3 -sticky nsew
grid $win.v -row 3 -column 3 -sticky nsew
grid $win.h -row 4 -column 0 -sticky nsew -columnspan 4
grid columnconfigure $win 0 -weight 1
grid rowconfigure $win 0 -weight 1
@ -651,3 +651,20 @@ proc ShowMessage {title msg} {
ok {return}
}
}
proc SetActiveProject {path} {
global activeProject projman
set activeProject $path
set titleFolder [file tail $path]
wm title . "ProjMan \($projman(Version)-$projman(Release)\) - $titleFolder"
# set file [string range $fullPath [expr [string last "/" $fullPath]+1] end]
# regsub -all "." $file "_" node
# set dir [file dirname $fullPath]
# EditFile .frmBody.frmCat.noteBook.ffiles.frmTreeFiles.treeFiles $node $fullPath
# puts $fullPath
# if ![info exists activeProject] {
# set activeProject $fullPath
# }
.frmStatus.lblGitLogo configure -image git_logo_20x20
.frmStatus.lblGit configure -text "[::msgcat::mc "Branch"]: [Git::Branches current]"
}

View File

@ -91,11 +91,11 @@ namespace eval Tree {
}
proc PressItem {tree} {
global nbEditor lexers editors
global nbEditor lexers editors activeProject
set id [$tree selection]
$tree tag remove selected
$tree item $id -tags selected
SetActiveProject [GetItemID $tree [GetUpperItem $tree $id]]
set values [$tree item $id -values]
set key [lindex [split $id "::"] 0]
if {$values eq "" || $key eq ""} {return}
@ -144,4 +144,14 @@ namespace eval Tree {
$tree selection set $treeItemName
}
}
proc GetUpperItem {tree item} {
set parent [$tree parent $item]
if {$parent eq ""} {
return $item
} else {
GetUpperItem $tree $parent
}
}
}

View File

@ -10,7 +10,7 @@ exec wish "$0" -- "$@"
######################################################
# Version: 2.0.0
# Release: alpha
# Build: 23112022152902
# Build: 24112022163913
######################################################
# определим текущую версию, релиз и т.д.
@ -118,7 +118,8 @@ if [info exists opened] {
exit
}
if [file isdirectory $path] {
set activeProject $path
# set activeProject $path
SetActiveProject $path
.frmStatus.lblGitLogo configure -image git_logo_20x20
.frmStatus.lblGit configure -text "[::msgcat::mc "Branch"]: [Git::Branches current]"
FileOper::ReadFolder $path
@ -130,7 +131,7 @@ if [info exists opened] {
} else {
if {$cfgVariables(opened) ne ""} {
# puts "<$cfgVariables(opened)"
set activeProject $cfgVariables(opened)
SetActiveProject $cfgVariables(opened)
.frmStatus.lblGitLogo configure -image git_logo_20x20
.frmStatus.lblGit configure -text "[::msgcat::mc "Branch"]: [Git::Branches current]"
FileOper::ReadFolder $cfgVariables(opened)