Auto indent added for () [] braces
This commit is contained in:
@@ -171,5 +171,6 @@ proc auto_completition_key { widget K A } {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -798,6 +798,29 @@ proc TabIns {text} {
|
||||
set shouldBeSpaces [expr {$shouldBeSpaces - $indentSize}]
|
||||
}
|
||||
}
|
||||
if {$lastSymbol == "\["} {
|
||||
incr shouldBeSpaces $indentSize
|
||||
}
|
||||
set a ""
|
||||
regexp "^| *\]" $curText a
|
||||
if {$a != ""} {
|
||||
# make unindent
|
||||
if {$shouldBeSpaces >= $indentSize} {
|
||||
set shouldBeSpaces [expr {$shouldBeSpaces - $indentSize}]
|
||||
}
|
||||
}
|
||||
if {$lastSymbol == "\("} {
|
||||
incr shouldBeSpaces $indentSize
|
||||
}
|
||||
set a ""
|
||||
regexp {^| *\)} $curText a
|
||||
if {$a != ""} {
|
||||
# make unindent
|
||||
if {$shouldBeSpaces >= $indentSize} {
|
||||
set shouldBeSpaces [expr {$shouldBeSpaces - $indentSize}]
|
||||
}
|
||||
}
|
||||
|
||||
set spaceNum [string length $spaces]
|
||||
if {$shouldBeSpaces > $spaceNum} {
|
||||
#insert spaces
|
||||
@@ -1202,6 +1225,3 @@ proc TextOperation {oper} {
|
||||
####################################
|
||||
GetOp
|
||||
|
||||
|
||||
|
||||
|
||||
|
34
lib/help.tcl
34
lib/help.tcl
@@ -324,37 +324,3 @@ proc TopLevelHelp {} {
|
||||
|
||||
#GetContent $docDir/tcl.toc.html
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -212,3 +212,4 @@ proc HighLightTCL {text line lineNumber node} {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -1087,3 +1087,4 @@ proc GetExtention {node} {
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user