Auto indent added for () [] braces
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user