@@ -118,29 +118,29 @@ async def format_highlight_block(self, url: str, line_adjustment: int = 10) -> d
118
118
return None
119
119
120
120
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
123
123
124
124
# is our minimum greater than our maximum?
125
- if _min_boundary > _max_boundary :
125
+ if min_boundary > max_boundary :
126
126
# 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
129
129
130
- _min_boundary = _max
131
- _max_boundary = _min
130
+ min_boundary = max_
131
+ max_boundary = min_
132
132
133
133
# get the file extension to format nicely
134
134
file = match ["file" ]
135
135
extension = file .rsplit ("." )[- 1 ]
136
136
137
137
msg = f"```{ extension } \n "
138
- key = _min_boundary
138
+ key = min_boundary
139
139
140
- max_digit = len (str (_max_boundary ))
140
+ max_digit = len (str (max_boundary ))
141
141
142
142
# loop through all our lines
143
- while key <= _max_boundary :
143
+ while key <= max_boundary :
144
144
curr_line_no : str = str (key + 1 )
145
145
spaced_line_no = f"%{ max_digit } d" % int (curr_line_no )
146
146
@@ -164,9 +164,8 @@ async def format_highlight_block(self, url: str, line_adjustment: int = 10) -> d
164
164
165
165
return {
166
166
"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 ,
170
169
"msg" : msg ,
171
170
}
172
171
@@ -226,8 +225,8 @@ async def on_message(self, message: discord.Message) -> None:
226
225
await message .add_reaction (self .code_highlight_emoji )
227
226
228
227
path = code_segment ["path" ]
229
- _min = code_segment ["min" ]
230
- _max = code_segment ["max" ]
228
+ min_ = code_segment ["min" ]
229
+ max_ = code_segment ["max" ]
231
230
code_fmt = code_segment ["msg" ]
232
231
assert isinstance (code_fmt , str )
233
232
@@ -251,7 +250,7 @@ def check(reaction: discord.Reaction, user: discord.User) -> bool:
251
250
await message .channel .send ("You've selected too many lines for me to display!" )
252
251
return
253
252
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 } "
255
254
await message .channel .send (msg , suppress_embeds = True )
256
255
257
256
except TimeoutError :
0 commit comments