beta2 #8

Merged
svk merged 49 commits from beta2 into master 2026-01-28 12:45:48 +03:00
13 changed files with 536 additions and 58 deletions
Showing only changes of commit 807131eee2 - Show all commits

View File

@@ -158,6 +158,29 @@ Or type "projman" into terminal, Or choose the name of the program "Projman" on
- Alt-S - Split the edited window horizontally - Alt-S - Split the edited window horizontally
- Alt-K - Open folder - Alt-K - Open folder
### Work with external tools
ProjMan allows you to connect any external tools to the editor. To do this, you need to add an entry to the file ~/.config/projman/tools.ini.
Calling an external program is available through the main and pop-up menus. To transfer the parameters, write the appropriate template in the file.
- %s - template for substituting selected text in the editor
- %f - template for substituting selected file\(s\) in the file tree
When adding multiple %f templates, the corresponding number of files allocated in the tree will be substituted.
```
[TkDIFF]
commandString=tkdiff %f %f
description=TkDiff is a Tcl/Tk front-end to diff
icon=
shortCut=
[VisualRegexp]
commandString=tkregexp "%s"
description=A graphical front-end to write/debug regular expression
icon=
shortCut=
```
## Credits ## Credits
Sergey Kalinin - author Sergey Kalinin - author

11
debian/changelog vendored
View File

@@ -1,3 +1,14 @@
projman (2.0.0-beta2) stable; urgency=medium
* Сделана обработка шаблонов командной строки и запуск внешних инструментов.
* Добавлен tkregexp для установки в /usr/bin
* Начало работы с внешними инструментами: - Добавлено создание и работа (проверка параметров
* Исправлен скрипт сборки бсд-пакета
* Добавлена сборка пакетов для openbsd
* Релиз 1-й бета версии
-- svk <svk@nuk-svk.ru> Thu, 22 Jan 2026 17:58:15 +0300
projman (2.0.0-beta1) stable; urgency=medium projman (2.0.0-beta1) stable; urgency=medium
* Сделан вывод отладочной информации по запросу. * Сделан вывод отладочной информации по запросу.

View File

@@ -11,8 +11,8 @@ namespace eval Tools {} {
} }
set ::toolsDefault "\[VisualRegexp\] set ::toolsDefault "\[VisualRegexp\]
commandString=tkregexp %s commandString=tkregexp \"%s\"
description'A graphical front-end to write/debug regular expression description=A graphical front-end to write/debug regular expression
icon= icon=
shortCut= shortCut=
\[TkDIFF\] \[TkDIFF\]
@@ -124,6 +124,28 @@ proc Tools::GetMenu {m} {
} }
} }
proc Tools::CommandPathSettings {command} {
global tcl_platform
if [file exists $command] {return $command}
if {$tcl_platform(platform) eq "windows"} {
set cmd "where $command)"
} else {
set cmd "which $command"
}
DebugPuts [catch {exec {*}$cmd} toolsPath]
DebugPuts "executor_path $toolsPath"
if {[catch {exec {*}$cmd} toolsPath]} {
DebugPuts "Программа $command не найдена в системе"
return ""
}
set fullPath [string trim $toolsPath]
set firstPath [lindex [split $toolsPath "\n"] 0]
DebugPuts "Tools::CommandPathSettings: executable path $fullPath"
return $fullPath
}
proc Tools::Execute {toolName} { proc Tools::Execute {toolName} {
global cfgVariables toolsVariables tree global cfgVariables toolsVariables tree
if ![dict exists $::toolsVariables $toolName commandString] { if ![dict exists $::toolsVariables $toolName commandString] {
@@ -133,13 +155,22 @@ proc Tools::Execute {toolName} {
set command [dict get $::toolsVariables $toolName commandString] set command [dict get $::toolsVariables $toolName commandString]
DebugPuts "Tools::Execute: command for $toolName as $command" DebugPuts "Tools::Execute: command for $toolName as $command"
} }
# 7. Проверять команды на доступность в системе и подставлять полный путь к команде
# если в конфиге не указан полный путь.
# Проверем наличие внешгних программ в системе
set cmd [lindex [split $command " "] 0]
if [file exists $cmd] {
set fullCommand $command set fullCommand $command
} else {
set fullPathToExec [Tools::CommandPathSettings "$cmd"]
set fullCommand [lreplace [split $command " "] 0 0 $fullPathToExec]
}
DebugPuts "Tools::Execute: $fullPathToExec, $fullCommand"
# 2. Определять выделен ли текст в открытом редакторе # 2. Определять выделен ли текст в открытом редакторе
# 5. Заменяем %s на выделенный в редакторе текст
set selectedText [Editor::SelectionGet] set selectedText [Editor::SelectionGet]
if {$selectedText ne ""} { if {$selectedText ne ""} {
regsub -all "%s" $command "$selectedText" fullCommand regsub -all "%s" $fullCommand "$selectedText" fullCommand
DebugPuts "Tools::Execute: selected text \"$selectedText\", command \"$fullCommand\"" DebugPuts "Tools::Execute: selected text \"$selectedText\", command \"$fullCommand\""
} }
@@ -154,14 +185,12 @@ proc Tools::Execute {toolName} {
if {![string match "*%f*" $fullCommand]} break if {![string match "*%f*" $fullCommand]} break
set fullCommand [regsub {%f} $fullCommand $file] set fullCommand [regsub {%f} $fullCommand $file]
} }
DebugPuts "Tools::Execute: $fullCommand"
} }
# 5. Заменяем %s на выделенный в редакторе текст
# 6. Заменяем %d на текущий каталог(и), если он выделен в дереве, # 6. Заменяем %d на текущий каталог(и), если он выделен в дереве,
# и если не выделено то корневой открытый в дереве # и если не выделено то корневой открытый в дереве
# 7. Проверять команды на доступность в системе и подставлять полный путь к команде DebugPuts "Tools::Execute: $fullCommand"
# если в конфиге не указан полный путь.
set pipe [open "|$fullCommand" "r"] set pipe [open "|$fullCommand" "r"]
fileevent $pipe readable fileevent $pipe readable
fconfigure $pipe -buffering none -blocking no fconfigure $pipe -buffering none -blocking no

View File

@@ -9,8 +9,8 @@ exec wish8.6 "$0" -- "$@"
# Home page: https://nuk-svk.ru # Home page: https://nuk-svk.ru
###################################################### ######################################################
# Version: 2.0.0 # Version: 2.0.0
# Release: beta1 # Release: beta2
# Build: 22012026174911 # Build: 27012026142407
###################################################### ######################################################
# определим текущую версию, релиз и т.д. # определим текущую версию, релиз и т.д.