Some changes into GUI (tabs)
This commit is contained in:
parent
f1ca27d3e0
commit
faf594ce9b
|
@ -5,6 +5,11 @@
|
||||||
# Author: Sergey Kalinin banzaj28@yandex.ru
|
# Author: Sergey Kalinin banzaj28@yandex.ru
|
||||||
##########################################################
|
##########################################################
|
||||||
|
|
||||||
|
0.4.6
|
||||||
|
25.05.2022
|
||||||
|
- Added linux shell highlight
|
||||||
|
- Added "Close" button into file tab
|
||||||
|
|
||||||
0.4.5
|
0.4.5
|
||||||
15.03.2018
|
15.03.2018
|
||||||
- Added sort procedure for projects tree
|
- Added sort procedure for projects tree
|
||||||
|
@ -437,6 +442,8 @@ characters to the right of the insertion cursor.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
BIN
img/close.gif
Normal file
BIN
img/close.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 640 B |
BIN
img/close_16x16.png
Normal file
BIN
img/close_16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
124
lib/editor.tcl
124
lib/editor.tcl
|
@ -606,9 +606,124 @@ proc EditFile {tree node fileName} {
|
||||||
set fileExt [string tolower [string range [file extension $fileName] 1 end]]
|
set fileExt [string tolower [string range [file extension $fileName] 1 end]]
|
||||||
set parentNode [$tree parent $node]
|
set parentNode [$tree parent $node]
|
||||||
set project [$tree itemcget $parentNode -data]
|
set project [$tree itemcget $parentNode -data]
|
||||||
|
image create photo close_16x16 -data {
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAFMXpUWHRSYXcgcHJvZmlsZSB0eXBl
|
||||||
|
IGV4aWYAAHjarVdrrjM3CP3vVXQJBowfy/FT6g66/OKZgdw4udIntbEyJn4APgfwxM1//l7uL/kg
|
||||||
|
hOgCpxxLjF4+oYSCVYTs70+9nuDD9Xx+eBXexp1NoAyR9HT/zPFZr+Pg3zRBFYl/KMr9mWjvEyU8
|
||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iamVjdD4KICAgIDxyZGY6QmFnLz4KICAgPC9pcHRjRXh0OkFydHdvcmtPck9iamVjdD4K
|
||||||
|
ICAgPGlwdGNFeHQ6UmVnaXN0cnlJZD4KICAgIDxyZGY6QmFnLz4KICAgPC9pcHRjRXh0OlJlZ2lz
|
||||||
|
dHJ5SWQ+CiAgIDx4bXBNTTpIaXN0b3J5PgogICAgPHJkZjpTZXE+CiAgICAgPHJkZjpsaQogICAg
|
||||||
|
ICBzdEV2dDphY3Rpb249InNhdmVkIgogICAgICBzdEV2dDpjaGFuZ2VkPSIvIgogICAgICBzdEV2
|
||||||
|
dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjNjMGYyODI4LTRhY2EtNDdmMy1iZjM4LWJjY2YzYTM5MTEz
|
||||||
|
YyIKICAgICAgc3RFdnQ6c29mdHdhcmVBZ2VudD0iR2ltcCAyLjEwIChMaW51eCkiCiAgICAgIHN0
|
||||||
|
RXZ0OndoZW49IiswMzowMCIvPgogICAgPC9yZGY6U2VxPgogICA8L3htcE1NOkhpc3Rvcnk+CiAg
|
||||||
|
IDxwbHVzOkltYWdlU3VwcGxpZXI+CiAgICA8cmRmOlNlcS8+CiAgIDwvcGx1czpJbWFnZVN1cHBs
|
||||||
|
aWVyPgogICA8cGx1czpJbWFnZUNyZWF0b3I+CiAgICA8cmRmOlNlcS8+CiAgIDwvcGx1czpJbWFn
|
||||||
|
ZUNyZWF0b3I+CiAgIDxwbHVzOkNvcHlyaWdodE93bmVyPgogICAgPHJkZjpTZXEvPgogICA8L3Bs
|
||||||
|
dXM6Q29weXJpZ2h0T3duZXI+CiAgIDxwbHVzOkxpY2Vuc29yPgogICAgPHJkZjpTZXEvPgogICA8
|
||||||
|
L3BsdXM6TGljZW5zb3I+CiAgPC9yZGY6RGVzY3JpcHRpb24+CiA8L3JkZjpSREY+CjwveDp4bXBt
|
||||||
|
ZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
IAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAog
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAg
|
||||||
|
Cjw/eHBhY2tldCBlbmQ9InciPz5/607fAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAACxMAAAsTAQCa
|
||||||
|
nBgAAAAHdElNRQfmBRsIGCYdNEHNAAABw0lEQVQozz3NPUxTURxA8XPvfe1TFKRFo8UIRT40GqNh
|
||||||
|
QdEYFReNg4tx00QDC9HBzcQRJ6ODMcbZuDg4OBLTaKIYQgcDVUClDfGjUKClYGn7Xvvu3wU98y85
|
||||||
|
SiNEyTu9+zuOLJ0txku+PxWMlabIbaCwKI1FN14b7Lux3PnZSasS1lrPSxYflkepW4xA4/2Ry7fz
|
||||||
|
bRPOnL6u2/S6KYRNR7hfFqrTCJjhO/PFWbkpB+WSZGRNxmVETku7xL65Z1wY6HmbKkhNvsgjeSae
|
||||||
|
iIh4kpCL0iotr3SzM3DY66rSzCHi1AkDEELIoXD6t3U7S+dnnCrH2UUD/1rlJb8xqKhuN53DftcL
|
||||||
|
naaJVswmCMiSYR2xtaTZeaV+oKBn+EgfezZBiF7OEWXV/hzVK5Mrtg7E2P1/oQjRw1VitpJ11j7g
|
||||||
|
+SHhAlHA8pUCR9lOmdckcm5a51OlCYshggOUecAQj5nlPc+DSsL7brZuVPLuCYksYNhHgif4JJnk
|
||||||
|
jUynKvf0vPHwMnrRHMtFxtUy7/hBmDDZ+q+Uf7c2JqIMhpp2TzXdMidtC0qjrV0sJ0pPg09YUAYH
|
||||||
|
jy34Oxq6TVz2ipCtpatz5k8AwF+X6NHCM54kXAAAAABJRU5ErkJggg==
|
||||||
|
}
|
||||||
# set w [$noteBook insert end $node -text "$file" -image [Bitmap::get [file join $imgDir [GetImage $fileName].gif]] \
|
# set w [$noteBook insert end $node -text "$file" -image [Bitmap::get [file join $imgDir [GetImage $fileName].gif]] \
|
||||||
#-background $editor(bg) -foreground $editor(fg)]
|
#-background $editor(bg) -foreground $editor(fg)]
|
||||||
set w [$noteBook insert end $node -text "$file" -image [Bitmap::get [file join $imgDir [GetImage $fileName].gif]]]
|
set w [$noteBook insert end $node -text "$file" -image [Bitmap::get [file join $imgDir [GetImage $fileName].gif]] \
|
||||||
|
-ractiveimage close_16x16 -rimage close_16x16 -rimagecmd CloseFileNB]
|
||||||
|
# set w [$noteBook insert end $node -text "$file" -image [Bitmap::get [file join $imgDir close.png]]]
|
||||||
|
|
||||||
EditorFileNavigateMenu $w $fileName
|
EditorFileNavigateMenu $w $fileName
|
||||||
|
|
||||||
|
@ -995,14 +1110,17 @@ proc ReadFileStructure {mod line lineNumber tree node} {
|
||||||
# View modern notebook tab header for edited file
|
# View modern notebook tab header for edited file
|
||||||
# like as : "> dir1 > dir2 > file.tcl"
|
# like as : "> dir1 > dir2 > file.tcl"
|
||||||
proc EditorFileNavigateMenu {w fullPathFile} {
|
proc EditorFileNavigateMenu {w fullPathFile} {
|
||||||
set lblEditFileFullPath [label $w.lblEditFileFullPath -text [regsub -all -- {/|\\} $fullPathFile " > "] -anchor w]
|
set lblEditFileFullPath [label $w.lblEditFileFullPath -text [regsub -all -- {/|\\} $fullPathFile " > "] -anchor w ]
|
||||||
pack $lblEditFileFullPath -side top -fill x -padx 2 -pady 3
|
pack $lblEditFileFullPath -side top -fill x -padx 2 -pady 3
|
||||||
}
|
}
|
||||||
|
|
||||||
####################################
|
####################################
|
||||||
GetOp
|
GetOp
|
||||||
|
|
||||||
|
proc CloseFileNB {node nodeItem} {
|
||||||
|
global tree
|
||||||
|
FileDialog $tree close
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -329,10 +329,32 @@ proc FileDialog {nbNode operation} {
|
||||||
|
|
||||||
|
|
||||||
namespace eval FileOperation {
|
namespace eval FileOperation {
|
||||||
global noteBook fontNormal fontBold fileList noteBook projDir activeProject imgDir editor
|
global types noteBook fontNormal fontBold fileList noteBook projDir activeProject imgDir editor rootDir
|
||||||
}
|
}
|
||||||
|
set types {
|
||||||
|
{"Tcl files" {.tcl}}
|
||||||
|
{"Tk files" {.tk}}
|
||||||
|
{"Rivet files" {.rvt}}
|
||||||
|
{"TclHttpd Template" {.tml}}
|
||||||
|
{"Sql files" {.sql}}
|
||||||
|
{"Html files" {.html}}
|
||||||
|
{"Text files" {.txt}}
|
||||||
|
{"JAVA files" {.java}}
|
||||||
|
{"PERL files" {.pl}}
|
||||||
|
{"PHP files" {.php}}
|
||||||
|
{"FORTRAN files" {.for}}
|
||||||
|
{"CAML or ML files" {.ml}}
|
||||||
|
{"CAML or ML interface files" {.mli}}
|
||||||
|
{"Ruby files" {.rb}}
|
||||||
|
{"Text files" {} TEXT}
|
||||||
|
{"All files" *}
|
||||||
|
}
|
||||||
|
set dot "_"
|
||||||
|
|
||||||
proc FileOperation::Open {} {
|
proc FileOperation::Open {} {
|
||||||
set dir $projDir
|
global tree node types dot env noteBook fontNormal fontBold fileList noteBook projDir activeProject imgDir editor rootDir
|
||||||
|
# set dir $projDir
|
||||||
|
set dir $env(HOME)
|
||||||
set fullPath [tk_getOpenFile -initialdir $dir -filetypes $types -parent $noteBook]
|
set fullPath [tk_getOpenFile -initialdir $dir -filetypes $types -parent $noteBook]
|
||||||
set file [string range $fullPath [expr [string last "/" $fullPath]+1] end]
|
set file [string range $fullPath [expr [string last "/" $fullPath]+1] end]
|
||||||
regsub -all "." $file "_" node
|
regsub -all "." $file "_" node
|
||||||
|
@ -341,7 +363,7 @@ proc FileOperation::Open {} {
|
||||||
set name [file rootname $file]
|
set name [file rootname $file]
|
||||||
set ext [string range [file extension $file] 1 end]
|
set ext [string range [file extension $file] 1 end]
|
||||||
set node "$name$dot$ext"
|
set node "$name$dot$ext"
|
||||||
EditFile $node $fullPath
|
EditFile .frmBody.frmCat.noteBook.ffiles.frmTreeFiles.treeFiles $node $fullPath
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
proc FileOperation::Close {} {
|
proc FileOperation::Close {} {
|
||||||
|
|
|
@ -199,8 +199,3 @@ proc HighLightPERL {text line lineNumber node} {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -268,3 +268,4 @@ proc HighLightPHP {text line lineNumber node} {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
202
lib/highlight/shell.tcl
Normal file
202
lib/highlight/shell.tcl
Normal file
|
@ -0,0 +1,202 @@
|
||||||
|
###########################################################
|
||||||
|
# Tcl/Tk Project Manager #
|
||||||
|
# version 0.0.1 #
|
||||||
|
# TCL highlight file #
|
||||||
|
# Copyright (c) "Sergey Kalinin", 2001, http://nuk-svk.ru #
|
||||||
|
# Author: Sergey Kalinin banzaj28@yandex.ru #
|
||||||
|
###########################################################
|
||||||
|
set beginQuote "0.0"
|
||||||
|
set endQuote "2.0"
|
||||||
|
set endQuotePrev "0.0"
|
||||||
|
|
||||||
|
proc HighLightSHELL {text line lineNumber node} {
|
||||||
|
global fontNormal fontBold editorFontBold tree imgDir noteBook systemCmdList
|
||||||
|
global editor color
|
||||||
|
global beginQuote endQuote endQuotePrev
|
||||||
|
set startIndex 0
|
||||||
|
|
||||||
|
$text tag configure bold -font $editor(fontBold)
|
||||||
|
$text tag configure className -font $editor(fontBold) -foreground $color(procName)
|
||||||
|
$text tag configure keyWord -foreground $color(keyWord)
|
||||||
|
$text tag configure comments -foreground $color(comments)
|
||||||
|
$text tag configure variable -foreground $color(var)
|
||||||
|
$text tag configure string -foreground $color(string)
|
||||||
|
$text tag configure braceHighLight -font $editor(fontBold)\
|
||||||
|
-foreground $color(braceBG) -background $color(braceFG)
|
||||||
|
$text tag configure brace -foreground $color(brace)
|
||||||
|
$text tag configure percent -foreground $color(percent)
|
||||||
|
$text tag configure bindKey -foreground $color(bindKey)
|
||||||
|
$text tag configure sql -font $editor(fontBold) -foreground $color(sql)
|
||||||
|
|
||||||
|
set keyWord [info commands]
|
||||||
|
|
||||||
|
foreach n $systemCmdList {lappend keyWord $n}
|
||||||
|
|
||||||
|
# for OOP extention
|
||||||
|
foreach n {if else then fi for done do while lt gt} {lappend keyWord $n}
|
||||||
|
set dataType {list abstract boolean byte char double float int long short}
|
||||||
|
set sqlOperators {select from where and or count sum in order cast as by}
|
||||||
|
set a ""
|
||||||
|
set startPos 0
|
||||||
|
set endPos 0
|
||||||
|
set length 0
|
||||||
|
set workLine $line
|
||||||
|
set className ""
|
||||||
|
while {$workLine != ""} {
|
||||||
|
if {[regexp "(^|\t| )\[a-zA-Z\\_:\]+" $workLine word]} {
|
||||||
|
set length [string length $word]
|
||||||
|
set startPos [string first [string trim $word] $line]
|
||||||
|
set endPos [expr $startPos + $length]
|
||||||
|
set workLine [string range $workLine $length end]
|
||||||
|
if {[lsearch $keyWord [string trim $word]] != -1} {
|
||||||
|
$text tag add keyWord $lineNumber.$startPos $lineNumber.$endPos
|
||||||
|
}
|
||||||
|
if {[lsearch $dataType [string trim $word]] != -1} {
|
||||||
|
$text tag add bold $lineNumber.$startPos $lineNumber.$endPos
|
||||||
|
}
|
||||||
|
if {[lsearch $sqlOperators [string trim $word]] != -1} {
|
||||||
|
$text tag add sql $lineNumber.$startPos $lineNumber.$endPos
|
||||||
|
}
|
||||||
|
if {[string trim $word]=="class" || [string trim $word]=="extends" || [string trim $word]=="implements" || [string trim $word]=="use"} {
|
||||||
|
$text tag add className $lineNumber.[expr $startPos + $length] $lineNumber.[string wordend $line [expr $startPos + $length +2]]
|
||||||
|
}
|
||||||
|
set startPos [expr $endPos + 1]
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# string " " highlight
|
||||||
|
set startPos 0
|
||||||
|
set workLine $line
|
||||||
|
while {$workLine != ""} {
|
||||||
|
if {[regexp "\".*?\"" $workLine a b] || [regexp "\'.*?\'" $workLine a b]} {
|
||||||
|
set start [string first $a $workLine]
|
||||||
|
set end $start
|
||||||
|
incr end [string length $a]
|
||||||
|
set workLine [string range $workLine $end end]
|
||||||
|
incr start $startPos
|
||||||
|
incr end $startPos
|
||||||
|
$text tag add string $lineNumber.$start $lineNumber.$end
|
||||||
|
set startPos $end
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# variable highlight #regexp -nocase -all -- {\$({|)[a-zA-Z0-9]+(:-|)(.+?}|)} string match v1 v2 v3
|
||||||
|
#[regexp "\\$\[a-zA-Z0-9\\_\-\]+" $workLine a] ||
|
||||||
|
set startPos 0
|
||||||
|
set workLine $line
|
||||||
|
while {$workLine != ""} {
|
||||||
|
if [regexp -nocase -all -- {\$({|)([a-zA-Z0-9_\-]+)(:-|)(.+?}|\}|)} $workLine match v1 a v3 v4] {
|
||||||
|
set start [string first $a $workLine]
|
||||||
|
set end $start
|
||||||
|
incr end [string length $a]
|
||||||
|
set workLine [string range $workLine $end end]
|
||||||
|
incr start $startPos
|
||||||
|
incr end $startPos
|
||||||
|
if {$a != ""} {
|
||||||
|
$text tag add variable $lineNumber.$start $lineNumber.$end
|
||||||
|
}
|
||||||
|
set startPos $end
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set startPos 0
|
||||||
|
set workLine $line
|
||||||
|
while {$workLine != ""} {
|
||||||
|
if {[regexp "\\@\[a-zA-Z\\_:\]+" $workLine a]} {
|
||||||
|
set start [string first $a $workLine]
|
||||||
|
set end $start
|
||||||
|
incr end [string length $a]
|
||||||
|
set workLine [string range $workLine $end end]
|
||||||
|
incr start $startPos
|
||||||
|
incr end $startPos
|
||||||
|
if {$a != ""} {
|
||||||
|
$text tag add variable $lineNumber.$start $lineNumber.$end
|
||||||
|
}
|
||||||
|
set startPos $end
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# persent % highlight
|
||||||
|
set startPos 0
|
||||||
|
set workLine $line
|
||||||
|
while {$workLine != ""} {
|
||||||
|
# if {[regexp "\%.*? " $workLine a b]}
|
||||||
|
if {[regexp "\%" $workLine a b] || [regexp "(\-\>)" $workLine a b]} {
|
||||||
|
set start [string first $a $workLine]
|
||||||
|
set end $start
|
||||||
|
incr end [string length $a]
|
||||||
|
set workLine [string range $workLine $end end]
|
||||||
|
incr start $startPos
|
||||||
|
incr end $startPos
|
||||||
|
$text tag add percent $lineNumber.$start $lineNumber.$end
|
||||||
|
set startPos $end
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# DEDERER
|
||||||
|
# hightlight [, {, }, ], ( , )
|
||||||
|
set startPos 0
|
||||||
|
set workLine $line
|
||||||
|
while {$workLine != ""} {
|
||||||
|
if {[regexp {\(|\[|{|}|\]|\)} $workLine a b]} {
|
||||||
|
set start [string first $a $workLine]
|
||||||
|
set end $start
|
||||||
|
incr end [string length $a]
|
||||||
|
set workLine [string range $workLine $end end]
|
||||||
|
incr start $startPos
|
||||||
|
incr end $startPos
|
||||||
|
$text tag add bold $lineNumber.$start $lineNumber.$end
|
||||||
|
set startPos $end
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# parameter for command hightlight regexp -nocase -all -- {\s-+\w+(?=\s)} string match
|
||||||
|
set startPos 0
|
||||||
|
set workLine $line
|
||||||
|
while {$workLine != ""} {
|
||||||
|
if {[regexp -nocase -all -- {\s-+\w+(?=\s)} $workLine a b]} {
|
||||||
|
set start [expr [string first $a $workLine] + 1]
|
||||||
|
set end $start
|
||||||
|
incr end [string length $a]
|
||||||
|
set workLine [string range $workLine $end end]
|
||||||
|
incr start $startPos
|
||||||
|
incr end $startPos
|
||||||
|
$text tag add bindKey $lineNumber.$start $lineNumber.$end
|
||||||
|
set startPos $end
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
## COMENTS ##
|
||||||
|
set workLine [$text get $lineNumber.0 $lineNumber.end]
|
||||||
|
if {[regexp -indices "(^|\t|;| )#" $workLine word]} {
|
||||||
|
set p [lindex $word 1]
|
||||||
|
$text tag add comments $lineNumber.$p $lineNumber.end
|
||||||
|
$text tag raise comments
|
||||||
|
} else {
|
||||||
|
$text tag remove comments $lineNumber.0 $lineNumber.end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -177,6 +177,9 @@ bind . <Control-eacute> Quit
|
||||||
bind . <Control-q> Quit
|
bind . <Control-q> Quit
|
||||||
bind . <Control-ccedilla> PrintDialog
|
bind . <Control-ccedilla> PrintDialog
|
||||||
bind . <Control-p> PrintDialog
|
bind . <Control-p> PrintDialog
|
||||||
|
bind . <Control-o> FileOperation::Open
|
||||||
|
bind . <Control-O> FileOperation::Open
|
||||||
|
|
||||||
set sepIndex 0
|
set sepIndex 0
|
||||||
|
|
||||||
########## STATUS BAR ##########
|
########## STATUS BAR ##########
|
||||||
|
@ -382,3 +385,5 @@ if {[info exists workingProject]} {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ proc GetProjMenu {m} {
|
||||||
$m add command -label [::msgcat::mc "Project settings"] -command {NewProj edit $activeProject ""}\
|
$m add command -label [::msgcat::mc "Project settings"] -command {NewProj edit $activeProject ""}\
|
||||||
-font $fontNormal
|
-font $fontNormal
|
||||||
$m add separator
|
$m add separator
|
||||||
$m add command -label [::msgcat::mc "Open project"] -command {OpenProj} -font $fontNormal
|
$m add command -label [::msgcat::mc "Open project"] -command {OpenProj "projects"} -font $fontNormal
|
||||||
$m add command -label [::msgcat::mc "New project"] -command {NewProj new "" ""} -font $fontNormal
|
$m add command -label [::msgcat::mc "New project"] -command {NewProj new "" ""} -font $fontNormal
|
||||||
$m add command -label [::msgcat::mc "Delete project"] -command DelProj -font $fontNormal
|
$m add command -label [::msgcat::mc "Delete project"] -command DelProj -font $fontNormal
|
||||||
$m add separator
|
$m add separator
|
||||||
|
@ -182,3 +182,4 @@ proc GetFileMenu {m} {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -587,6 +587,8 @@ proc HighLight {ext text line lineNumber node} {
|
||||||
HighLightPHP $text $line $lineNumber $node
|
HighLightPHP $text $line $lineNumber $node
|
||||||
} elseif {($ext == "rb")} {
|
} elseif {($ext == "rb")} {
|
||||||
HighLightRUBY $text $line $lineNumber $node
|
HighLightRUBY $text $line $lineNumber $node
|
||||||
|
} elseif {($ext == "sh")} {
|
||||||
|
HighLightSHELL $text $line $lineNumber $node
|
||||||
} else {
|
} else {
|
||||||
HighLightTCL $text $line $lineNumber $node
|
HighLightTCL $text $line $lineNumber $node
|
||||||
}
|
}
|
||||||
|
@ -665,8 +667,26 @@ proc GetExtention {node} {
|
||||||
return $ext
|
return $ext
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Get system command name from PATH environment variable
|
||||||
|
proc GetSystemCommand {} {
|
||||||
|
global tcl_platform env systemCmdList
|
||||||
|
switch -exact -- $tcl_platform(platform) {
|
||||||
|
"unix" {
|
||||||
|
foreach path [split $env(PATH) ":"] {
|
||||||
|
foreach commandName [lsort [glob -nocomplain [file join $path *]]] {
|
||||||
|
lappend systemCmdList [file tail $commandName]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"windows" {
|
||||||
|
foreach path [split $env(PATH) ";"] {
|
||||||
|
foreach commandName [lsort [glob -nocomplain [file join $path *]]] {
|
||||||
|
lappend systemCmdList [file tail $commandName]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -100,3 +100,4 @@ proc GoToLineButton {w} {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -79,3 +79,5 @@ set workingProject ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ exec wish "$0" -- "$@"
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
########## VERSION INFORMATION ##########
|
########## VERSION INFORMATION ##########
|
||||||
set ver "0.4.5"
|
set ver "0.4.6"
|
||||||
|
|
||||||
package require BWidget
|
package require BWidget
|
||||||
package require msgcat
|
package require msgcat
|
||||||
|
@ -174,7 +174,6 @@ option add *Dialog.msg.background $editor(bg)
|
||||||
# option add *Text.HighlightThickness 2 userDefault
|
# option add *Text.HighlightThickness 2 userDefault
|
||||||
# option add *Entry.HighlightThickness 1 userDefault
|
# option add *Entry.HighlightThickness 1 userDefault
|
||||||
|
|
||||||
|
GetSystemCommand
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user