about summary refs log tree commit diff stats
path: root/src/render/renderdocument.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-11-20 18:33:38 +0100
committerbptato <nincsnevem662@gmail.com>2023-11-20 18:34:27 +0100
commitb355647ac668bffb3c27c18b56d81812eb189ca4 (patch)
treefb9dc7a31eb7c587733af90329adac6486d33b42 /src/render/renderdocument.nim
parent342a1a7f787fc260448842ee312cf29825f96ba6 (diff)
downloadchawan-b355647ac668bffb3c27c18b56d81812eb189ca4.tar.gz
renderdocument: fix regression in d20fc30
The reasoning for using early returns was wrong, and they should be
unnecessary anyway.
Diffstat (limited to 'src/render/renderdocument.nim')
-rw-r--r--src/render/renderdocument.nim12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/render/renderdocument.nim b/src/render/renderdocument.nim
index 5f9be5fa..d412e4d3 100644
--- a/src/render/renderdocument.nim
+++ b/src/render/renderdocument.nim
@@ -76,14 +76,6 @@ proc setText(lines: var FlexibleGrid, linestr: string, cformat: ComputedFormat,
   if nx < 0:
     nx = 0
 
-  # Note: following algorithm breaks if cx == nx or x == nx (I think).
-  # So we do an early return in both cases, just in case.
-  # This should result in correct behavior in all cases, since the formatting
-  # inserted would be for a zero width text.
-  if cx == nx:
-    # cx is nx, early return.
-    return
-
   # Skip unchanged formats before the new string
   var fi = lines[y].findFormatN(cx) - 1
 
@@ -121,10 +113,6 @@ proc setText(lines: var FlexibleGrid, linestr: string, cformat: ComputedFormat,
     assert lines[y].formats[fi].pos <= x
 
   # Now for the text's formats:
-  if x == nx:
-    # x is nx, early return.
-    return
-
   var format = cformat.formatFromWord()
   var lformat: Format
   var lnode: StyledNode