Skip to content

Commit

Permalink
fix dialog box
Browse files Browse the repository at this point in the history
  • Loading branch information
thatstoasty committed Dec 8, 2024
1 parent cc91a9b commit 638d94a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/mog/style.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -1833,11 +1833,10 @@ struct Style:

# Render sides
for i in range(len(lines)):
var line = lines[i]
if has_left:
result.write(self.style_border(border.left, left_fg, left_bg))

result.write(line)
result.write(lines[i])

if has_right:
result.write(self.style_border(border.right, right_fg, right_bg))
Expand Down Expand Up @@ -2129,8 +2128,8 @@ struct Style:
# if transform:
# return transform(result)

lines = result.splitlines()
if width != 0:
lines, widest = get_lines(result)
if width != 0 or widest != 0:
var style = mist.Style(self.renderer.color_profile.value)
if color_whitespace or use_whitespace_styler:
style = term_style_whitespace
Expand Down
4 changes: 2 additions & 2 deletions src/mog/whitespace.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct WhitespaceRenderer:
self.style = style
self.chars = chars

fn render(mut self, width: Int) -> String:
fn render(self, width: Int) -> String:
"""Render whitespaces.
Args:
Expand All @@ -64,7 +64,7 @@ struct WhitespaceRenderer:

while i < width:
for char in self.chars:
result.write_bytes(char.as_bytes())
result.write(char)
var printable_width = ansi.printable_rune_width(char)
if j >= printable_width:
j = 0
Expand Down

0 comments on commit 638d94a

Please sign in to comment.