original commit: 1d57a71acc69cce5b2a71445af84c29d1bbb14ca
This commit is contained in:
Robby Findler 1999-10-22 15:29:43 +00:00
parent 4a3ef8a682
commit f179b5d3cd
3 changed files with 24 additions and 8 deletions

View File

@ -1172,7 +1172,8 @@
(private
[editor-position-changed-offset/numbers
(let ([last-start #f]
[last-end #f])
[last-end #f]
[last-params #f])
(lambda (offset? line-numbers?)
(let* ([edit (get-info-editor)]
[make-one
@ -1201,8 +1202,10 @@
(let ([start (send edit get-start-position)]
[end (send edit get-end-position)])
(unless (and last-start
(equal? last-params (list offset? line-numbers?))
(= last-start start)
(= last-end end))
(set! last-params (list offset? line-numbers?))
(set! last-start start)
(set! last-end end)
(when (object? position-edit)

View File

@ -291,6 +291,7 @@
(make-check 'framework:show-status-line "Show status-line" id id)
(make-check 'framework:line-offsets "Count line and column numbers from one" id id)
(make-check 'framework:display-line-numbers "Display line numbers in buffer; not character offsets" id id)
(make-check 'framework:menu-bindings "Enable keybindings in menus" id id)
(unless (eq? (system-type) 'unix)
(make-check 'framework:print-output-mode "Automatically print to postscript file"
@ -299,7 +300,6 @@
(lambda (n) (eq? 'postscript n))))
(make-check 'framework:display-line-numbers "Display line numbers in buffer; not character offsets" id id)
'(when (eq? (system-type) 'windows)
(make-check 'framework:windows-mdi "Use MDI Windows" id id))
(make-check 'framework:search-using-dialog?

View File

@ -142,7 +142,7 @@
[super-after-delete after-delete]
[super-after-set-size-constraint after-set-size-constraint]
[super-after-set-position after-set-position])
(inherit has-focus?)
(inherit has-focus? find-snip split-snip)
(override
[on-focus
(lambda (on?)
@ -558,7 +558,20 @@
new-pos)))
(end-edit-sequence))
(insert #\newline)))]
[comment-out-selection
[calc-last-para
(lambda (last-pos)
(let ([last-para (position-paragraph last-pos #t)])
(if (and (> last-pos 0)
(> last-para 0))
(begin (split-snip last-pos)
(let ([snip (find-snip last-pos 'before)])
(if (member 'hard-newline (send snip get-flags))
(- last-para 1)
last-para)))
last-para)))]
[comment-out-selection
(opt-lambda ([start-pos (get-start-position)]
[end-pos (get-end-position)])
(begin-edit-sequence)
@ -566,7 +579,7 @@
(= (paragraph-start-position (position-paragraph start-pos))
start-pos)])
(let* ([first-para (position-paragraph start-pos)]
[last-para (position-paragraph end-pos #t)])
[last-para (calc-last-para end-pos)])
(let para-loop ([curr-para first-para])
(if (<= curr-para last-para)
(let ([first-on-para (paragraph-start-position curr-para)])
@ -582,9 +595,9 @@
(opt-lambda ([start-pos (get-start-position)]
[end-pos (get-end-position)])
(begin-edit-sequence)
(let ([last-pos (last-position)]
[first-para (position-paragraph start-pos)]
[last-para (position-paragraph end-pos #t)])
(let* ([last-pos (last-position)]
[first-para (position-paragraph start-pos)]
[last-para (calc-last-para end-pos)])
(let para-loop ([curr-para first-para])
(if (<= curr-para last-para)
(let ([first-on-para