3435 after the last line" |
3435 after the last line" |
3436 |
3436 |
3437 |line col nLines wasOn| |
3437 |line col nLines wasOn| |
3438 |
3438 |
3439 lines notNil ifTrue:[ |
3439 lines notNil ifTrue:[ |
3440 wasOn := self hideCursor. |
3440 wasOn := self hideCursor. |
3441 nLines := lines size. |
3441 nLines := lines size. |
3442 line := cursorLine. |
3442 line := cursorLine. |
3443 col := cursorCol. |
3443 col := cursorCol. |
3444 lines keysAndValuesDo:[:i :l | |
3444 lines keysAndValuesDo:[:i :l | |
3445 self replaceString:l atLine:line col:col. |
3445 self replaceString:(l ? '') atLine:line col:col. |
3446 (i ~~ nLines or:[withCr]) ifTrue:[ |
3446 (i ~~ nLines or:[withCr]) ifTrue:[ |
3447 line := line + 1. |
3447 line := line + 1. |
3448 col := 1. |
3448 col := 1. |
3449 ] ifFalse:[ |
3449 ] ifFalse:[ |
3450 col := col + (l size). |
3450 col := col + (l size). |
3451 ] |
3451 ] |
3452 ]. |
3452 ]. |
3453 self cursorLine:line col:col. |
3453 self cursorLine:line col:col. |
3454 self makeCursorVisibleAndShowCursor:wasOn. |
3454 self makeCursorVisibleAndShowCursor:wasOn. |
3455 "/ wasOn ifTrue:[self showCursor]. |
3455 "/ wasOn ifTrue:[self showCursor]. |
3456 ] |
3456 ] |
3457 |
3457 |
3458 "Created: / 18.5.1996 / 15:32:06 / cg" |
3458 "Created: / 18-05-1996 / 15:32:06 / cg" |
3459 "Modified: / 12.6.1998 / 22:05:51 / cg" |
3459 "Modified: / 25-07-2013 / 17:00:53 / cg" |
3460 ! |
3460 ! |
3461 |
3461 |
3462 replaceSelectionBy:something |
3462 replaceSelectionBy:something |
3463 "delete the selection (if any) and insert something, a character or string; |
3463 "delete the selection (if any) and insert something, a character or string; |
3464 leave cursor after insertion" |
3464 leave cursor after insertion" |