File tree Expand file tree Collapse file tree 7 files changed +52
-0
lines changed
MarkEditKit/Sources/Bridge/Web/Generated
Sources/Editor/Controllers Expand file tree Collapse file tree 7 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 6
6
updateQuery ,
7
7
updateHasSelection ,
8
8
selectAllOccurrences ,
9
+ selectNextOccurrence ,
9
10
findNext ,
10
11
findPrevious ,
11
12
replaceNext ,
@@ -30,6 +31,7 @@ export interface WebModuleSearch extends WebModule {
30
31
replaceNext ( ) : void ;
31
32
replaceAll ( ) : void ;
32
33
selectAllOccurrences ( ) : void ;
34
+ selectNextOccurrence ( ) : void ;
33
35
numberOfMatches ( ) : CodeGen_Int ;
34
36
}
35
37
@@ -76,6 +78,10 @@ export class WebModuleSearchImpl implements WebModuleSearch {
76
78
selectAllOccurrences ( ) ;
77
79
}
78
80
81
+ selectNextOccurrence ( ) : void {
82
+ selectNextOccurrence ( ) ;
83
+ }
84
+
79
85
numberOfMatches ( ) : CodeGen_Int {
80
86
return numberOfMatches ( ) ;
81
87
}
Original file line number Diff line number Diff line change 3
3
findNext as findNextCommand ,
4
4
findPrevious as findPreviousCommand ,
5
5
replaceNext as replaceNextCommand ,
6
+ selectNextOccurrence as selectNextOccurrenceCommand ,
6
7
} from '@codemirror/search' ;
7
8
8
9
import { Command } from '@codemirror/view' ;
@@ -117,6 +118,10 @@ export function selectAllOccurrences() {
117
118
}
118
119
}
119
120
121
+ export function selectNextOccurrence ( ) {
122
+ selectNextOccurrenceCommand ( window . editor ) ;
123
+ }
124
+
120
125
export function numberOfMatches ( ) : CodeGen_Int {
121
126
const query = getSearchQuery ( window . editor . state ) ;
122
127
const ranges = rangesFromQuery ( query ) ;
Original file line number Diff line number Diff line change @@ -112,6 +112,10 @@ public final class WebBridgeSearch {
112
112
webView? . invoke ( path: " webModules.search.selectAllOccurrences " , completion: completion)
113
113
}
114
114
115
+ public func selectNextOccurrence( completion: ( ( Result < Void , WKWebView . InvokeError > ) -> Void ) ? = nil ) {
116
+ webView? . invoke ( path: " webModules.search.selectNextOccurrence " , completion: completion)
117
+ }
118
+
115
119
public func numberOfMatches( ) async throws -> Int {
116
120
return try await withCheckedThrowingContinuation { continuation in
117
121
webView? . invoke ( path: " webModules.search.numberOfMatches " ) { result in
Original file line number Diff line number Diff line change 574
574
<action selector =" selectAllOccurrences:" target =" Ady-hI-5gd" id =" 83F-Vk-zez" />
575
575
</connections >
576
576
</menuItem >
577
+ <menuItem title =" Select Next Occurrence" keyEquivalent =" d" id =" VIj-UD-bGA" >
578
+ <connections >
579
+ <action selector =" selectNextOccurrence:" target =" Ady-hI-5gd" id =" d1k-Qg-XA4" />
580
+ </connections >
581
+ </menuItem >
577
582
<menuItem title =" Jump to Selection" keyEquivalent =" j" id =" S0p-oC-mLd" >
578
583
<connections >
579
584
<action selector =" scrollToSelection:" target =" Ady-hI-5gd" id =" 2gs-Ni-NAC" />
Original file line number Diff line number Diff line change @@ -333,6 +333,10 @@ extension EditorViewController {
333
333
selectAllOccurrences ( )
334
334
}
335
335
336
+ @IBAction func selectNextOccurrence( _ sender: Any ? ) {
337
+ selectNextOccurrence ( )
338
+ }
339
+
336
340
@IBAction func scrollToSelection( _ sender: Any ? ) {
337
341
bridge. selection. scrollToSelection ( )
338
342
}
Original file line number Diff line number Diff line change @@ -196,6 +196,10 @@ extension EditorViewController {
196
196
bridge. search. selectAllOccurrences ( )
197
197
}
198
198
199
+ func selectNextOccurrence( ) {
200
+ bridge. search. selectNextOccurrence ( )
201
+ }
202
+
199
203
func performSearchOperation( _ operation: SearchOperation ) {
200
204
bridge. search. performOperation ( operation: operation)
201
205
Original file line number Diff line number Diff line change 3745
3745
}
3746
3746
}
3747
3747
},
3748
+ "VIj-UD-bGA.title" : {
3749
+ "comment" : "Class = \"NSMenuItem\"; title = \"Select Next Occurrence\"; ObjectID = \"VIj-UD-bGA\";",
3750
+ "extractionState" : "extracted_with_value",
3751
+ "localizations" : {
3752
+ "en" : {
3753
+ "stringUnit" : {
3754
+ "state" : "new",
3755
+ "value" : "Select Next Occurrence"
3756
+ }
3757
+ },
3758
+ "zh-Hans" : {
3759
+ "stringUnit" : {
3760
+ "state" : "translated",
3761
+ "value" : "选择下个相同项"
3762
+ }
3763
+ },
3764
+ "zh-Hant" : {
3765
+ "stringUnit" : {
3766
+ "state" : "translated",
3767
+ "value" : "選擇下個相同項"
3768
+ }
3769
+ }
3770
+ }
3771
+ },
3748
3772
"vmV-6d-7jI.title" : {
3749
3773
"comment" : "Class = \"NSMenuItem\"; title = \"Make Upper Case\"; ObjectID = \"vmV-6d-7jI\";",
3750
3774
"extractionState" : "extracted_with_value",
You can’t perform that action at this time.
0 commit comments