Skip to content

Commit 1ee348c

Browse files
committed
Back on track!
1 parent ca6d1c0 commit 1ee348c

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed
240 Bytes
Binary file not shown.

strings_with_arrows.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ def string_with_arrows(text, pos_start, pos_end):
66
idx_end = text.find('\n', idx_start + 1)
77
if idx_end < 0: idx_end = len(text)
88

9-
# Generate each line
9+
1010
line_count = pos_end.ln - pos_start.ln + 1
1111
for i in range(line_count):
12-
# Calculate line columns
1312
line = text[idx_start:idx_end]
1413
col_start = pos_start.col if i == 0 else 0
1514
col_end = pos_end.col if i == line_count - 1 else len(line) - 1
1615

17-
# Append to result
1816
result += line + '\n'
1917
result += ' ' * col_start + '^' * (col_end - col_start)
2018

0 commit comments

Comments
 (0)