Skip to content

Commit

Permalink
fix: progress bars in virtual text (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
benlubas authored Dec 10, 2023
1 parent 6b2660d commit 3b886c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion rplugin/python3/molten/outputbuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ def handle_progress_bars(line_str: str) -> List[str]:
last = parts[-1]
if last != "":
actual_lines.append(last)
lines = actual_lines

return actual_lines

Expand Down
5 changes: 4 additions & 1 deletion rplugin/python3/molten/outputchunks.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ def place(
if hard_wrap:
lines = []
splits = []
# Assume this is a progress bar, or similar, we shouldn't try to wrap it
if text.find("\r") != -1:
return text, 0
for line in text.split("\n"):
index = 0
if len(line) + col > win_width:
splits.append(line[: win_width - col])
line = line[win_width - col :]

for _ in range(len(line) // win_width):
splits.append(line[index * win_width : (index+1)*win_width])
splits.append(line[index * win_width : (index + 1) * win_width])
index += 1
else:
splits.append(line[index * win_width :])
Expand Down

0 comments on commit 3b886c1

Please sign in to comment.