original commit: dfd579f2a8d03677d5698890f003952388a766c0
This commit is contained in:
Robby Findler 1999-08-30 00:49:45 +00:00
parent f906c1b6ea
commit f041b7e137
2 changed files with 17 additions and 7 deletions

View File

@ -380,12 +380,22 @@
(get-text-from-user (get-text-from-user
"Goto Line" "Goto Line"
"Goto Line:")))]) "Goto Line:")))])
(if (string? num-str) (when (string? num-str)
(let ([line-num (string->number num-str)]) (let ([line-num (inexact->exact (string->number num-str))])
(if line-num (cond
[(and (number? line-num)
(= line-num (floor line-num))
(<= 1 line-num (+ (send edit last-line) 1)))
(let ([pos (send edit line-start-position (let ([pos (send edit line-start-position
(sub1 line-num))]) (sub1 line-num))])
(send edit set-position pos)))))) (send edit set-position pos))]
[else
(message-box
"Goto Line"
(format "~a is not an integer between 1 and ~a"
num-str
(+ (send edit last-line) 1)))]))))
#t)] #t)]
[goto-position [goto-position
(lambda (edit event) (lambda (edit event)

View File

@ -114,7 +114,7 @@
(at-most-one (void) (at-most-one (void)
(lambda () (lambda ()
(exit:on-exit) (exit:on-exit)
(exit))) (queue-callback (lambda () (exit)))))
(void)))) (void))))
(exit:insert-can?-callback (exit:insert-can?-callback