Overview
Comment: | Modified Files: tclreadlineSetup.tcl.in Added Files: Makefile.in tclreadline.c tclreadlineConfig.sh.in tclreadlineInit.tcl.in |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
1ce074b566ff14a38807714d3ca747f7 |
User & Date: | johannes@zellner.org on 1999-08-24 01:23:25 |
Other Links: | manifest | tags |
Context
1999-08-25
| ||
01:03 | Modified Files: .tclshrc bin/script/pkgMkIndex share/vim/functions/selectBuffer.vim src/evim/evimrc src/tclreadline/tclreadlineSetup.tcl.in Added Files: Tag: 0.4 src/csym/version No tag src/tclreadline/Makefile.in src/tclreadline/tclreadline.c src/tclreadline/tclreadlineConfig.sh.in src/tclreadline/tclreadlineInit.tcl.in check-in: a3ee053e89 user: johannes@zellner.org tags: trunk | |
1999-08-24
| ||
01:23 | Modified Files: tclreadlineSetup.tcl.in Added Files: Makefile.in tclreadline.c tclreadlineConfig.sh.in tclreadlineInit.tcl.in check-in: 1ce074b566 user: johannes@zellner.org tags: trunk | |
1999-08-23
| ||
20:38 | Modified Files: tclreadline.n.in Added Files: Makefile.in tclreadline.c tclreadlineConfig.sh.in tclreadlineInit.tcl.in check-in: e5343fb8ae user: johannes@zellner.org tags: trunk | |
Changes
Modified tclreadline.c from [ebe0deb081] to [1f128a2ff8].
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 | - + | /* ================================================================== FILE: "/home/joze/src/tclreadline/tclreadline.c" |
︙ | |||
321 322 323 324 325 326 327 | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | - + - - + + - + + + + | tclrl_interp = interp; return Tcl_PkgProvide(interp, "tclreadline", TCLREADLINE_VERSION); } char* TclReadlineInitialize(char* historyfile) { |
︙ | |||
379 380 381 382 383 384 385 386 387 388 | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | + + - - | int objc; char* quoted_text = TclReadlineQuote(text, "$[]{}\""); char* quoted_rl_line_buffer = TclReadlineQuote(rl_line_buffer, "$[]{}\""); /* fprintf (stderr, "(TclReadlineCompletion) rl_line_buffer = |%s|\n", rl_line_buffer); fprintf (stderr, "(TclReadlineCompletion) quoted_rl_line_buffer = |%s|\n", quoted_rl_line_buffer); fprintf (stderr, "(TclReadlineCompletion) text = |%s|\n", text); fprintf (stderr, "(TclReadlineCompletion) quoted_text = |%s|\n", quoted_text); |
︙ |
Modified tclreadlineSetup.tcl.in from [71baf77ef1] to [211857a65a].
1 | 1 2 3 4 5 6 7 8 9 10 | - - + + | #!/usr/local/bin/tclsh |
︙ | |||
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | } # get the longest common completion # e.g. str == {tcl_version tclreadline_version tclreadline_library} # --> [tclreadline::GetCommon ${str}] == "tcl" # proc tclreadline::GetCommon {str} { # puts stderr str=$str set match0 [lindex ${str} 0] set len0 [string length $match0] set no_matches [llength ${str}] set part "" for {set i 0} {$i < $len0} {incr i} { set char [string index $match0 $i] for {set j 1} {$j < $no_matches} {incr j} { if {$char != [string index [lindex ${str} $j] $i]} { break } } if {$j < $no_matches} { break } else { append part $char } } # puts stderr part=$part return ${part} } proc tclreadline::SubCmd {start line} { set depth 0 for {set i $start} {$i > 0} {incr i -1} { set c [string index $line $i] if {{;} == $c} { incr i; # discard command break character return [list [expr $start - $i] [string range $line $i end]] } elseif {{]} == $c} { incr depth } elseif {{[} == $c} { incr depth -1 if {$depth < 0} { incr i; # discard command break character return [list [expr $start - $i] [string range $line $i end]] } } } return "" } # % p<TAB> # % bla put<TAB> $b # % put<TAB> $b # part == put # start == 0 # end == 3 # line == "put $b" # [PartPosition] should return 0 # proc tclreadline::PartPosition {part start end line} { incr start -1 # puts stderr "(tclreadline::PartPosition) line=|$line|" # puts stderr "(tclreadline::PartPosition) start=$start" set line [string range $line 0 $start] regsub -all -- \" $line {\"} line # puts stderr "(tclreadline::PartPosition) line=|$line|" set result [llength $line] # puts stderr $result return $result } # if the line entered so far is # % puts $b<TAB> # part == $b # start == 5 # end == 7 # line == "$puts $b" # proc tclreadline::ScriptCompleter {part start end line} { # puts stderr "(ScriptCompleter) |$part| $start $end |$line|" variable known_cmds if {{$} == [string index $part 0]} { # variable completion. Check first, if the # variable starts with a plain `$' or should # be enclosed in braces. # if {"\{" == [string index $part 1]} { set var [string range $part 2 end] |
︙ | |||
203 204 205 206 207 208 209 | 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | + + + + + + + + - - - + + + + + + + + + + + + + + + + - + + + + - + + + + + + + + + + + + - - - + + + + + + + | return [join [list $left $matches $right] ""] } } elseif {"" != $matches} { ; # more than one matches return "${left}[tclreadline::GetCommon ${matches}] ${matches}" } else { return ""; # nothing to complete } # SCENARIO: # # % puts bla; put<TAB> $b # part == put # start == 10 # end == 13 # line == "puts bla; put $b" # [SubCmd] --> {1 " put $b"} == sub |
︙ | |||
402 403 404 405 406 407 408 | 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 | + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | if {[info exists tk_version]} { ::tclreadline::InitTkCmds } rename tclreadline::InitCmds "" } proc ::tclreadline::InitTclCmds {} { variable known_cmds foreach line { |