Compare commits

...

4 Commits

6 changed files with 60 additions and 33 deletions

5
TODO
View File

@ -9,8 +9,6 @@
--- Ansible ---
1. Определение всех переменных в отдельный список
- если открыт каталог с плэйбуками
подкаталоги vars, group_vars, host_vars, файл inventory
- внутри файла, конструкции вида:
set_fact:
varName: value
@ -22,7 +20,4 @@
- var1.yml
- var2.yml
2. Внутри редактора на переменных {{ var_name }} сделать либо по наведении мыши либо по щелчку,
либо добавить ссылку на файл и где эта переменная определена
3. Если используется роль и переменная не найдена в плэйбуке то искать в роли (не факт что требуется)

View File

@ -618,7 +618,7 @@ namespace eval Editor {
dict set editors $txt variableList $varList
}
proc FindFunction {findString} {
proc FindFunction {findString} {
global nbEditor
puts $findString
set pos "0.0"
@ -838,6 +838,7 @@ proc FindFunction {findString} {
}
wm geom $win +$x+$y
}
proc FindReplaceText {findString replaceString regexp} {
global nbEditor
set txt [$nbEditor select].frmText.t
@ -884,11 +885,15 @@ proc FindFunction {findString} {
$txt tag add sel $ind $endInd
incr i
}
.finddialog.lblCounter configure -text "[::msgcat::mc "Finded"]: $i"
# set pos [$txt search $options $findString $pos end]
# $txt mark set insert $pos
$txt see $pos
if {[lindex $lstFindIndex 0] ne "" } {
$txt see [lindex $lstFindIndex 0]
}
# puts $pos
# # highlight the found word
# set line [lindex [split $pos "."] 0]
@ -917,7 +922,7 @@ proc FindFunction {findString} {
set txt $w.frmText.t
set win .finddialog
set regexpSet ""
# set nocaseSet "-nocase"
set searchAll "-all"
if { [winfo exists $win] } { destroy $win }
toplevel $win
@ -944,7 +949,7 @@ proc FindFunction {findString} {
-command {
puts $Editor::show($Editor::win.entryReplace)
if {$Editor::show($Editor::win.entryReplace) eq "false"} {
grid $Editor::win.entryReplace -row 1 -column 0 -columnspan 2 -sticky nsew
grid $Editor::win.entryReplace -row 1 -column 0 -columnspan 3 -sticky nsew
grid $Editor::win.bDone -row 1 -column 3 -sticky e
grid $Editor::win.bDoneAll -row 1 -column 4 -sticky e
set Editor::show($Editor::win.entryReplace) "true"
@ -955,19 +960,21 @@ proc FindFunction {findString} {
}
ttk::checkbutton $win.chkRegexp -text "Regexp" \
-variable regexpSet -onvalue "-regexp" -offvalue ""
# ttk::checkbutton $win.chkCase -text "Case Sensitive" \
# -variable nocaseSet -onvalue "" -offvalue "-nocase"
grid $win.entryFind -row 0 -column 0 -columnspan 2 -sticky nsew
ttk::checkbutton $win.chkAll -text "All" -state disable\
-variable searchAll -onvalue "-all" -offvalue ""
ttk::label $win.lblCounter -justify right -anchor e -text ""
grid $win.entryFind -row 0 -column 0 -columnspan 3 -sticky nsew
grid $win.bForward -row 0 -column 3 -sticky e
grid $win.bBackward -row 0 -column 4 -sticky e
grid $win.bReplace -row 0 -column 5 -sticky e
grid $win.chkRegexp -row 2 -column 0 -sticky w
# grid $win.chkCase -row 2 -column 1 -sticky w
# grid $win.chkAll -row 2 -column 1 -sticky w
grid $win.lblCounter -row 2 -column 2 -sticky we
# set reqWidth [winfo reqwidth $win]
set boxX [expr [winfo rootx $w] + [expr [winfo width $nbEditor] - 350]]
set boxY [expr [winfo rooty $w] + 10]
set boxX [expr [winfo rootx $w] + [expr [winfo width $nbEditor] - 350]]
set boxY [expr [winfo rooty $w] + 10]
bind $win <Escape> {
destroy $Editor::win
@ -992,8 +999,29 @@ proc FindFunction {findString} {
focus -force $win.entryFind
}
proc SplitEditor {w fileType} {
proc SplitEditorH {w fileType} {
global cfgVariables
puts [$w.panelTxt panes]
if [winfo exists $w.frmText2] {
$w.panelTxt forget $w.frmText2
destroy $w.frmText2
focus -force $w.frmText.t.t
return
}
set frmText [Editor::EditorWidget $w $fileType]
$frmText.t insert end [$w.frmText.t get 0.0 end]
# $w.panelTxt add $w.frmText -weight 0
$w.panelTxt add $frmText -weight 1
$frmText.t see [$w.frmText.t index insert]
focus -force $frmText.t.t
}
proc SplitEditorV {w fileType} {
global cfgVariables
.frmBody.panel add $frmTree -weight 0
puts [$w.panelTxt panes]
if [winfo exists $w.frmText2] {
$w.panelTxt forget $w.frmText2
@ -1032,7 +1060,9 @@ proc FindFunction {findString} {
-tabs "[expr {4 * [font measure $cfgVariables(font) 0]}] left" -tabstyle tabular -undo true
pack $txt -fill both -expand 1
pack $frmText.h -side bottom -fill x
if {$cfgVariables(editorWrap) eq "none"} {
pack $frmText.h -side bottom -fill x
}
# puts ">>>>>>> [bindtags $txt]"
if {$cfgVariables(lineNumberShow) eq "false"} {
$txt configure -linemap 0
@ -1078,9 +1108,9 @@ proc FindFunction {findString} {
set btnSplitV "btnSplitV[string range $itemName [expr [string last "." $itemName] +1] end]"
set btnSplitH "btnSplitH[string range $itemName [expr [string last "." $itemName] +1] end]"
ttk::button $fr.header.$btnSplitH -image split_horizontal_11x11 \
-command "Editor::SplitEditor $fr $fileType"
-command "Editor::SplitEditorH $fr $fileType"
ttk::button $fr.header.$btnSplitV -image split_vertical_11x11 \
-command "Editor::SplitEditor $fr $fileType" -state disable
-command "Editor::SplitEditorV $fr $fileType" -state disable
# pack $fr.$btnSplitH $fr.$btnSplitV -side right -anchor e
pack $fr.header.$lblName -side left -expand true -fill x
pack $fr.header.$btnSplitV $fr.header.$btnSplitH -side right

View File

@ -136,10 +136,11 @@ grid rowconfigure $frmTree 0 -weight 1
set frmWork [ttk::frame .frmWork -border 0 -relief flat]
set nbEditor [ttk::notebook $frmWork.nbEditor]
pack $nbEditor -side left -fill both -expand true
#grid $nbEditor -row 0 -column 0 -sticky nsew
pack $nbEditor -fill both -expand true
# set nbEditor2 [ttk::notebook $frmWork.nbEditor2]
# pack $nbEditor2 -side left -fill both -expand true
#
# Create an image CLOSE for tab
ttk::style element create close_button image close_10x10 -height 12 -width 12 -sticky e -padding {10 0}
@ -153,7 +154,7 @@ ttk::style layout TNotebook.Tab {
}
bind TNotebook <Button-1> "catch {NB::PressTab %W %x %y}\;[bind TNotebook <Button-1>];break"
# bind <<NotebookTabChanged>> "NB::PressTab %W %x %y"
bind TNotebook <ButtonRelease-1> "NB::PressTab %W %x %y"
# bind . <Control-Tab> "NB::NextTab $nbEditor"
bind . <Control-Next> "NB::NextTab $nbEditor 1"
bind . <Control-Prior> "NB::NextTab $nbEditor -1"

View File

@ -77,6 +77,7 @@
::msgcat::mcset ru "File modify" "Файл изменен"
::msgcat::mcset ru "File saved" "Файл сохранен"
::msgcat::mcset ru "Find" "Найти"
::msgcat::mcset ru "Finded" "Найдено"
::msgcat::mcset ru "Find in files" "Найти в файлах"
::msgcat::mcset ru "Font normal" "Нормальный шрифт"
::msgcat::mcset ru "Font bold" "Жирный шрифт"

View File

@ -10,7 +10,7 @@ exec wish "$0" -- "$@"
######################################################
# Version: 2.0.0
# Release: alpha
# Build: 14092022165515
# Build: 15092022154328
######################################################
# определим текущую версию, релиз и т.д.

View File

@ -60,15 +60,17 @@ namespace eval ttk::theme::dark {
# ttk widgets.
ttk::style configure TButton \
-width -8 -padding {5 1} -relief link
-width -8 -padding {5 1} -relief link
ttk::style configure TMenubutton -relief flat -arrowsize 0
ttk::style configure TCheckbutton \
-indicatorbackground "#ffffff" -indicatormargin {1 1 4 1}
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
ttk::style configure TRadiobutton \
-indicatorbackground "#ffffff" -indicatormargin {1 1 4 1}
-indicatorbackground "#ffffff" -indicatormargin {1 1 4 1}
ttk::style configure TFrame -relief flat -border -1
# ttk::style configure TEntry -fieldbackground #ffffff -foreground #000000 -padding {2 0}
ttk::style configure TEntry -fieldbackground $colors(-lightframe) -foreground #ffffff -padding {2 0}
ttk::style configure TEntry -fieldbackground $colors(-lightframe) \
-padding {2 0}
ttk::style configure TLabel -foreground $colors(-disabledfg) \
-background $colors(-frame) -padding {2 0}
ttk::style configure TCombobox \
-fieldbackground $colors(-lightframe) \
@ -105,9 +107,7 @@ namespace eval ttk::theme::dark {
-linemapfg [list active $colors(-linemapfg)]\
-background [list active $colors(-lighter)] \
-foreground [list disabled $colors(-disabledfg)]
ttk::style configure TLabel -foreground $colors(-disabledfg) -padding {2 0}
# ttk::style configure TreeCtrl \
# -background gray30 -itembackground {gray60 gray50} \
# -itemfill #ffffff -itemaccentfill yellow