Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions drracket/drracket/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
------------------------------
Version 8.5
------------------------------

. added new file menu item 'Reopen Closed Tab' to open previously
closed tabs.
. Removed keyboard shortcut for 'Spell Check test' in edit menu due
to conflict with 'Reopen Closed Tab'.

------------------------------
Version 8.4
------------------------------
Expand Down
2 changes: 1 addition & 1 deletion drracket/drracket/private/main.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@
l))))

(preferences:set-default 'drracket:recently-closed-tabs-max-count
50
1000
(λ (x) (and (number? x)
(x . > . 0)
(integer? x))))
Expand Down
11 changes: 6 additions & 5 deletions drracket/drracket/private/unit.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -3075,7 +3075,7 @@
;; create-new-tab : -> void
;; creates a new tab and updates the GUI for that new tab
(define/public create-new-tab
(lambda ([filename #f])
(lambda ([filename #f] [start-pos 0] [end-pos 'same])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think keyword arguments here is better, eg:

(lambda ([filename #f] #:start-pos [start-pos 0] #:end-pos [end-pos 'same])

(let* ([defs (new (drracket:get/extend:get-definitions-text))]
[tab-count (length tabs)]
[new-tab (new (drracket:get/extend:get-tab)
Expand All @@ -3086,6 +3086,7 @@
(ints-shown? (not filename)))]
[ints (make-object (drracket:get/extend:get-interactions-text) new-tab)])
(send new-tab set-ints ints)
(send (send new-tab get-defs) set-position start-pos end-pos)
(set! tabs (append tabs (list new-tab)))
(send tabs-panel append
(gui-utils:trim-string
Expand Down Expand Up @@ -3266,8 +3267,8 @@
#t]
[else #f]))

(define/public (open-in-new-tab filename)
(create-new-tab filename))
(define/public (open-in-new-tab filename [start-pos 0] [end-pos 0])
(create-new-tab filename start-pos end-pos))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto here for the keywords.


;; reopen-closed-tab : -> void
;; Opens previously closed tabs. If no tabs were closed in current session, files from
Expand Down Expand Up @@ -3421,7 +3422,7 @@
;; truncate-list : (listof X) -> (listof X)[< new-len]
;; takes a list and returns the
;; front of the list, up to 'new-len' number of items
(define (truncate-list l new-len)
(define/private (truncate-list l new-len)
(define len (length l))
(cond
[(<= len new-len) l]
Expand Down Expand Up @@ -4110,7 +4111,7 @@
(mk-menu-item (λ (ed) (send ed get-spell-check-text))
(λ (ed new-val) (send ed set-spell-check-text new-val))
'framework:spell-check-text?
#\t
#f
(string-constant spell-check-scribble-text))

(new menu:can-restore-menu-item%
Expand Down
8 changes: 6 additions & 2 deletions drracket/scribblings/tools/unit.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,13 @@ Returns the currently active tab.
Returns the number of open tabs in the frame.
}

@defmethod[(open-in-new-tab [filename (or/c path-string? #f)]) void?]{
@defmethod[(open-in-new-tab [filename (or/c path-string? #f)]
[start exact-nonnegative-integer? 0]
[end (or/c exact-nonnegative-integer? 'same) 'same])
void?]{
Opens a new tab in this frame. If @racket[filename] is a @racket[path-string?],
It loads that file in the definitions window of the new tab.
It loads that file in the definitions window of the new tab. If @racket[start] and
@racket[end] are provided, it updates the tab's corresponding insertion positions.
}

@defmethod[(create-new-tab) void?]{
Expand Down