|
698 | 698 | @racket['framework:anchored-search] preference is on. |
699 | 699 | } |
700 | 700 |
|
701 | | - @defmethod[(get-search-hit-count) (values number? number?)]{ |
| 701 | + @defmethod[(get-search-hit-count) (values natural? natural?)]{ |
702 | 702 | Returns the number of hits for the search in the buffer before the |
703 | 703 | insertion point and the total number of hits. Both are based on the count |
704 | 704 | found last time that a search completed. |
|
711 | 711 |
|
712 | 712 | } |
713 | 713 |
|
714 | | - @defmethod[(get-replace-search-hit) (or/c number? #f)]{ |
| 714 | + @defmethod[(get-replace-search-hit) (or/c (list*of (is-a?/c text%) natural?) #f)]{ |
715 | 715 | Returns the position of the nearest search hit that comes after the |
716 | 716 | insertion point. |
717 | 717 |
|
|
722 | 722 | @method[text:searching<%> finish-pending-search-work]. |
723 | 723 | } |
724 | 724 |
|
725 | | - @defmethod[(set-replace-start [pos (or/c number? #f)]) void?]{ |
| 725 | + @defmethod[(set-replace-start [pos (or/c natural? #f)]) void?]{ |
726 | 726 | This method is ignored. (The next replacement start is now |
727 | 727 | tracked via the @method[text% after-set-position] method.) |
728 | 728 | } |
|
758 | 758 | } |
759 | 759 |
|
760 | 760 | @defmixin[text:searching-mixin (editor:keymap<%> text:basic<%>) (text:searching<%>)]{ |
761 | | - This @racket[text%] can be searched. |
| 761 | + This @racket[text%] can be searched. See also @racket[text:searching-embedded-mixin] |
762 | 762 |
|
763 | 763 | The result of this mixin uses the same initialization arguments as the |
764 | 764 | mixin's argument. |
|
784 | 784 | } |
785 | 785 | } |
786 | 786 |
|
| 787 | +@definterface[text:searching-embedded<%> ()]{ |
| 788 | + Classes that implement this interface are produced by |
| 789 | + @racket[text:searching-exmbedded-mixin] and have overridden |
| 790 | + observer methods that forward information about changes to the editor |
| 791 | + that can affect the searching results state. |
| 792 | + |
| 793 | +@history[#:added "1.80"] |
| 794 | + |
| 795 | +} |
| 796 | + |
| 797 | +@defmixin[text:searching-embedded-mixin (text%) (text:searching-embedded<%>)]{ |
| 798 | + This mixin is expected to be used with editors that appear inside @racket[editor-snip%]s |
| 799 | + and that can have search results. I cooperates with the enclosing @racket[text:searching<%>] |
| 800 | + object to inform it when a change to the editor has occurred that can affect |
| 801 | + the current search results and how they are displayed. |
| 802 | + |
| 803 | +@history[#:added "1.80"] |
| 804 | + |
| 805 | + @defmethod[#:mode augment (after-insert [start exact-nonnegative-integer?] |
| 806 | + [len exact-nonnegative-integer?]) void?]{ |
| 807 | + Tells the outermost enclosing editor that the contents |
| 808 | + of the editor has changed, which can affect the way |
| 809 | + search results are displayed. |
| 810 | + } |
| 811 | + |
| 812 | + @defmethod[#:mode augment (after-delete [start exact-nonnegative-integer?] |
| 813 | + [len exact-nonnegative-integer?]) void?]{ |
| 814 | + Tells the outermost enclosing editor that the contents |
| 815 | + of the editor has changed, which can affect the way |
| 816 | + search results are displayed. |
| 817 | + } |
| 818 | + |
| 819 | + @defmethod[#:mode augment (after-set-position) void?]{ |
| 820 | + Tells the outermost enclosing editor that the position |
| 821 | + of the editor has changed, which can affect the way |
| 822 | + search results are displayed. |
| 823 | + } |
| 824 | +} |
787 | 825 | @definterface[text:return<%> (text%)]{ |
788 | 826 | Objects supporting this interface were created by @racket[text:return-mixin]. |
789 | 827 | } |
|
0 commit comments