Добавил обновление информации в просмотрщике MD при сохранении открытого в редакторе файла.
This commit is contained in:
7
debian/changelog
vendored
7
debian/changelog
vendored
@@ -1,3 +1,9 @@
|
|||||||
|
projman (2.0.0-beta6) stable; urgency=medium
|
||||||
|
|
||||||
|
* Новая сборка
|
||||||
|
|
||||||
|
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 8 Apr 2026 16:50:52 +0300
|
||||||
|
|
||||||
projman (2.0.0-beta6) stable; urgency=medium
|
projman (2.0.0-beta6) stable; urgency=medium
|
||||||
|
|
||||||
* Добавлены настройки для просмотрщика MD в части касаемой ссылок и выделения текста.
|
* Добавлены настройки для просмотрщика MD в части касаемой ссылок и выделения текста.
|
||||||
@@ -546,3 +552,4 @@ projman (2.0.0-alfa0) stable; urgency=medium
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ codeBlockFont=Monospace 10 italic
|
|||||||
textBG=#333333
|
textBG=#333333
|
||||||
linkFont={Droid Sans Mono} 10 bold
|
linkFont={Droid Sans Mono} 10 bold
|
||||||
linkFG=#54bcff
|
linkFG=#54bcff
|
||||||
|
runViewer=true
|
||||||
"
|
"
|
||||||
proc Config::create {dir} {
|
proc Config::create {dir} {
|
||||||
set cfgFile [open [file join $dir projman.ini] "w+"]
|
set cfgFile [open [file join $dir projman.ini] "w+"]
|
||||||
|
|||||||
@@ -1511,6 +1511,15 @@ namespace eval Editor {
|
|||||||
}
|
}
|
||||||
# puts [$w.panelTxt panes]
|
# puts [$w.panelTxt panes]
|
||||||
DebugPuts "$w $fileType $nb $fileFullPath"
|
DebugPuts "$w $fileType $nb $fileFullPath"
|
||||||
|
|
||||||
|
# set fileType [string toupper [string trimleft [file extension $filePath] "."]]
|
||||||
|
|
||||||
|
# Execute the MD-file viewer
|
||||||
|
if {$fileType eq "MD" && $cfgVariables(runViewer) eq "true"} {
|
||||||
|
ShowMD $fileFullPath
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if [winfo exists $w.frmText2] {
|
if [winfo exists $w.frmText2] {
|
||||||
$w.panelTxt forget $w.frmText2
|
$w.panelTxt forget $w.frmText2
|
||||||
destroy $w.frmText2
|
destroy $w.frmText2
|
||||||
|
|||||||
@@ -395,6 +395,14 @@ namespace eval FileOper {
|
|||||||
# puts "$f was saved"
|
# puts "$f was saved"
|
||||||
close $f
|
close $f
|
||||||
ResetModifiedFlag $nbEditorItem $nbEditorWindow
|
ResetModifiedFlag $nbEditorItem $nbEditorWindow
|
||||||
|
|
||||||
|
# Проверяем если в редакторе открыт MD-файл и запущен его просмотрщик
|
||||||
|
if {[string toupper [string trimleft [file extension $filePath] "."]] eq "MD" && [winfo exists .viewer]} {
|
||||||
|
if {[wm title .viewer] eq $filePath} {
|
||||||
|
ShowMD $filePath true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if {[file tail $filePath] eq "projman.ini"} {
|
if {[file tail $filePath] eq "projman.ini"} {
|
||||||
Config::read $dir(cfg)
|
Config::read $dir(cfg)
|
||||||
}
|
}
|
||||||
|
|||||||
104
lib/mdviewer.tcl
104
lib/mdviewer.tcl
@@ -9,61 +9,65 @@
|
|||||||
#
|
#
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
proc ShowMD {fileFullPath} {
|
proc ShowMD {fileFullPath {reload "false"}} {
|
||||||
global cfgVariables
|
global cfgVariables
|
||||||
|
|
||||||
set win .viewer
|
set win .viewer
|
||||||
|
if {$reload eq "false"} {
|
||||||
set parentGeometry [wm geometry .]
|
set parentGeometry [wm geometry .]
|
||||||
set parentWidth [winfo width .]
|
set parentWidth [winfo width .]
|
||||||
set parentHeight [winfo height .]
|
set parentHeight [winfo height .]
|
||||||
set parentX [winfo x .]
|
set parentX [winfo x .]
|
||||||
set parentY [winfo y .]
|
set parentY [winfo y .]
|
||||||
|
|
||||||
|
# Устанавливаем размеры нового окна (меньше на 200)
|
||||||
|
set newWidth [expr {$parentWidth - 200}]
|
||||||
|
set newHeight [expr {$parentHeight - 200}]
|
||||||
|
|
||||||
|
# Вычисляем позицию для центрирования относительно родительского окна
|
||||||
|
set x [expr {$parentX + ($parentWidth - $newWidth) / 2}]
|
||||||
|
set y [expr {$parentY + ($parentHeight - $newHeight) / 2}]
|
||||||
|
|
||||||
|
# Применяем геометрию
|
||||||
|
|
||||||
# Устанавливаем размеры нового окна (меньше на 200)
|
if { [winfo exists $win] } { destroy $win; return false }
|
||||||
set newWidth [expr {$parentWidth - 200}]
|
toplevel $win
|
||||||
set newHeight [expr {$parentHeight - 200}]
|
# wm title $win "[::msgcat::mc "Help"]"
|
||||||
|
wm title $win $fileFullPath
|
||||||
|
wm geometry $win ${newWidth}x${newHeight}+${x}+${y}
|
||||||
|
wm overrideredirect $win 0
|
||||||
|
|
||||||
|
set frm [ttk::frame $win.frmHelp]
|
||||||
|
pack $frm -expand 1 -fill both
|
||||||
|
|
||||||
|
set txt [text $frm.txt -wrap $cfgVariables(editorWrap) -background $cfgVariables(textBG) \
|
||||||
|
-xscrollcommand "$win.h set" -yscrollcommand "$frm.v set" -font $cfgVariables(viewerFont)]
|
||||||
|
pack $txt -side left -expand 1 -fill both
|
||||||
|
pack [ttk::scrollbar $frm.v -command "$frm.txt yview"] -side right -fill y
|
||||||
|
ttk::scrollbar $win.h -orient horizontal -command "$frm.txt xview"
|
||||||
|
if {$cfgVariables(editorWrap) eq "none"} {
|
||||||
|
pack $win.h -side bottom -fill x
|
||||||
|
|
||||||
# Вычисляем позицию для центрирования относительно родительского окна
|
}
|
||||||
set x [expr {$parentX + ($parentWidth - $newWidth) / 2}]
|
bind .viewer <Escape> {destroy .viewer}
|
||||||
set y [expr {$parentY + ($parentHeight - $newHeight) / 2}]
|
|
||||||
|
$txt tag configure h1 -font $cfgVariables(h1Font)
|
||||||
# Применяем геометрию
|
$txt tag configure h2 -font $cfgVariables(h2Font)
|
||||||
|
$txt tag configure h3 -font $cfgVariables(h3Font)
|
||||||
if { [winfo exists $win] } { destroy $win; return false }
|
$txt tag configure h4 -font $cfgVariables(h4Font)
|
||||||
toplevel $win
|
$txt tag configure h5 -font $cfgVariables(h5Font)
|
||||||
wm title $win "[::msgcat::mc "Help"]"
|
$txt tag configure h6 -font $cfgVariables(h6Font)
|
||||||
wm geometry $win ${newWidth}x${newHeight}+${x}+${y}
|
$txt tag configure mdList -font $cfgVariables(mdListFont)
|
||||||
wm overrideredirect $win 0
|
$txt tag configure codeBlock -foreground $cfgVariables(codeBlockFG) \
|
||||||
|
-background $cfgVariables(codeBlockBG) -font $cfgVariables(codeBlockFont)
|
||||||
set frm [ttk::frame $win.frmHelp]
|
$txt tag configure italic -font $cfgVariables(italicFont)
|
||||||
pack $frm -expand 1 -fill both
|
$txt tag configure bold -font $cfgVariables(boldFont)
|
||||||
|
$txt tag configure italicBold -font $cfgVariables(italicBoldFont)
|
||||||
set txt [text $frm.txt -wrap $cfgVariables(editorWrap) -background $cfgVariables(textBG) \
|
$txt tag configure link -foreground $cfgVariables(linkFG) -font $cfgVariables(linkFont)
|
||||||
-xscrollcommand "$win.h set" -yscrollcommand "$frm.v set" -font $cfgVariables(viewerFont)]
|
} else {
|
||||||
pack $txt -side left -expand 1 -fill both
|
set txt .viewer.frmHelp.txt
|
||||||
pack [ttk::scrollbar $frm.v -command "$frm.txt yview"] -side right -fill y
|
$txt delete 0.0 end
|
||||||
ttk::scrollbar $win.h -orient horizontal -command "$frm.txt xview"
|
|
||||||
if {$cfgVariables(editorWrap) eq "none"} {
|
|
||||||
pack $win.h -side bottom -fill x
|
|
||||||
|
|
||||||
}
|
}
|
||||||
bind .viewer <Escape> {destroy .viewer}
|
|
||||||
|
|
||||||
$txt tag configure h1 -font $cfgVariables(h1Font)
|
|
||||||
$txt tag configure h2 -font $cfgVariables(h2Font)
|
|
||||||
$txt tag configure h3 -font $cfgVariables(h3Font)
|
|
||||||
$txt tag configure h4 -font $cfgVariables(h4Font)
|
|
||||||
$txt tag configure h5 -font $cfgVariables(h5Font)
|
|
||||||
$txt tag configure h6 -font $cfgVariables(h6Font)
|
|
||||||
$txt tag configure mdList -font $cfgVariables(mdListFont)
|
|
||||||
$txt tag configure codeBlock -foreground $cfgVariables(codeBlockFG) \
|
|
||||||
-background $cfgVariables(codeBlockBG) -font $cfgVariables(codeBlockFont)
|
|
||||||
$txt tag configure italic -font $cfgVariables(italicFont)
|
|
||||||
$txt tag configure bold -font $cfgVariables(boldFont)
|
|
||||||
$txt tag configure italicBold -font $cfgVariables(italicBoldFont)
|
|
||||||
$txt tag configure link -foreground $cfgVariables(linkFG) -font $cfgVariables(linkFont)
|
|
||||||
|
|
||||||
set codeBlockBegin false
|
set codeBlockBegin false
|
||||||
|
|
||||||
set f [open "$fileFullPath" r]
|
set f [open "$fileFullPath" r]
|
||||||
@@ -382,5 +386,3 @@ proc ExtractBlocks {line pattern} {
|
|||||||
return $result
|
return $result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ exec wish8.6 "$0" -- "$@"
|
|||||||
######################################################
|
######################################################
|
||||||
# Version: 2.0.0
|
# Version: 2.0.0
|
||||||
# Release: beta6
|
# Release: beta6
|
||||||
# Build: 08042026164832
|
# Build: 08042026165056
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
# определим текущую версию, релиз и т.д.
|
# определим текущую версию, релиз и т.д.
|
||||||
|
|||||||
Reference in New Issue
Block a user