@@ -118,29 +118,29 @@ async def format_highlight_block(self, url: str, line_adjustment: int = 10) -> d
118118 return None
119119
120120 bound_adj = line_adjustment # adjustment for upper and lower bound display.
121- _min_boundary = highlighted_line - 1 - bound_adj if bulk is False else line_start - 1
122- _max_boundary = highlighted_line - 1 + bound_adj if bulk is False else line_end - 1
121+ min_boundary = highlighted_line - 1 - bound_adj if bulk is False else line_start - 1
122+ max_boundary = highlighted_line - 1 + bound_adj if bulk is False else line_end - 1
123123
124124 # is our minimum greater than our maximum?
125- if _min_boundary > _max_boundary :
125+ if min_boundary > max_boundary :
126126 # re-arrange the variables so we get the proper min - max scale
127- _min = _min_boundary
128- _max = _max_boundary
127+ min_ = min_boundary
128+ max_ = max_boundary
129129
130- _min_boundary = _max
131- _max_boundary = _min
130+ min_boundary = max_
131+ max_boundary = min_
132132
133133 # get the file extension to format nicely
134134 file = match ["file" ]
135135 extension = file .rsplit ("." )[- 1 ]
136136
137137 msg = f"```{ extension } \n "
138- key = _min_boundary
138+ key = min_boundary
139139
140- max_digit = len (str (_max_boundary ))
140+ max_digit = len (str (max_boundary ))
141141
142142 # loop through all our lines
143- while key <= _max_boundary :
143+ while key <= max_boundary :
144144 curr_line_no : str = str (key + 1 )
145145 spaced_line_no = f"%{ max_digit } d" % int (curr_line_no )
146146
@@ -164,9 +164,8 @@ async def format_highlight_block(self, url: str, line_adjustment: int = 10) -> d
164164
165165 return {
166166 "path" : file_path ,
167- "min" : (_min_boundary if _min_boundary > 0 else highlighted_line - 1 )
168- + 1 , # Do not display negative numbers if <0
169- "max" : _max_boundary + 1 ,
167+ "min" : (min_boundary if min_boundary > 0 else highlighted_line - 1 ) + 1 , # Do not display negative numbers if <0
168+ "max" : max_boundary + 1 ,
170169 "msg" : msg ,
171170 }
172171
@@ -226,8 +225,8 @@ async def on_message(self, message: discord.Message) -> None:
226225 await message .add_reaction (self .code_highlight_emoji )
227226
228227 path = code_segment ["path" ]
229- _min = code_segment ["min" ]
230- _max = code_segment ["max" ]
228+ min_ = code_segment ["min" ]
229+ max_ = code_segment ["max" ]
231230 code_fmt = code_segment ["msg" ]
232231 assert isinstance (code_fmt , str )
233232
@@ -251,7 +250,7 @@ def check(reaction: discord.Reaction, user: discord.User) -> bool:
251250 await message .channel .send ("You've selected too many lines for me to display!" )
252251 return
253252
254- msg : str = f"Showing lines `{ _min } -{ _max } ` in: `{ path } `\n { code_fmt } "
253+ msg : str = f"Showing lines `{ min_ } -{ max_ } ` in: `{ path } `\n { code_fmt } "
255254 await message .channel .send (msg , suppress_embeds = True )
256255
257256 except TimeoutError :
0 commit comments