@@ -70,7 +70,7 @@ def indicate_line(self, line):
7070 """
7171
7272 def indicate_results (
73- self , line , line_num , path = "undefined" , workbox_id = "undefined"
73+ self , line , line_num , path = "undefined" , workbox_name = "undefined"
7474 ):
7575 """Writes a single line adding markup for any matches on the line."""
7676 tool_tip = "Open {} at line number {}" .format (path , line_num )
@@ -82,7 +82,7 @@ def indicate_results(
8282
8383 # Otherwise print the next section of the line text
8484 if indicate :
85- self .callback_matching (text , workbox_id , line_num , tool_tip )
85+ self .callback_matching (text , workbox_name , line_num , tool_tip )
8686 else :
8787 self .callback_non_matching (text )
8888
@@ -121,21 +121,19 @@ def margin(self, line_num, match_found):
121121 def matches (self , line ):
122122 """Returns bool for if find_text is contained in this line."""
123123
124- def print_matching (self , text , workbox_id , line_num , tool_tip ):
124+ def print_matching (self , text , workbox_name , line_num , tool_tip ):
125125 """Simple callback for `callback_matching` that prints text.
126126
127127 The print does not insert an newline character.
128128
129129 Args:
130130 text (str): The matching text to display. This will be inserted
131131 into a markdown link as the link text.
132- workbox_id (str): From `GroupTabWidget.all_widgets`, the group_tab_index
133- and widget_tab_index joined by a comma without a space. Used as
134- the url of the link. Example: `3,1`.
132+ workbox_name (str): From editor.__workbox_name__()
135133 line_number (int): The line number the url should navigate to.
136134 tool_tip (str): Added as a title to the link to show up as a tool tip.
137135 """
138- href = ', {}, {}' .format (workbox_id , line_num )
136+ href = ', {}, {}' .format (workbox_name , line_num )
139137 print ('[{}]({} "{}")' .format (text , href , tool_tip ), end = "" )
140138
141139 def print_non_matching (self , text ):
@@ -145,17 +143,15 @@ def print_non_matching(self, text):
145143 """
146144 print (text , end = "" )
147145
148- def search_text (self , text , path , workbox_id ):
146+ def search_text (self , text , path , workbox_name ):
149147 """Search each line of text for matching text and write the the matches
150148 including context lines.
151149
152150 Args:
153151 text (str): The text to search.
154152 path (str): The workbox name this text represents. Should be the
155153 Group_name and tab_name separated by a `/`.
156- workbox_id (str): From `GroupTabWidget.all_widgets`, the group_tab_index
157- and widget_tab_index joined by a comma without a space. Used as
158- the url of the link. Example: `3,1`.
154+ workbox_name (str): From editor.__workbox_name__()
159155 """
160156 # NOTE: splitlines discards the "newline at end of file" so it doesn't
161157 # show up in the final search results.
@@ -177,14 +173,14 @@ def search_text(self, text, path, workbox_id):
177173 found = False
178174
179175 for i , line in enumerate (lines ):
180- info = dict (path = path , workbox_id = workbox_id )
176+ info = dict (path = path , workbox_name = workbox_name )
181177 if self .matches (line ):
182178 len_pre_history = len (pre_history )
183179 if not found :
184180 # Print the path on the first find
185181 self .callback_non_matching ("# File: " )
186182 tool_tip = "Open {}" .format (path )
187- self .callback_matching (path , workbox_id , 0 , tool_tip )
183+ self .callback_matching (path , workbox_name , 0 , tool_tip )
188184 self .callback_non_matching ("\n " )
189185 found = True
190186 elif i - last_insert - 1 - len_pre_history > 0 :
0 commit comments