Skip to content

Commit

Permalink
fix single insertion on 2nd+ line
Browse files Browse the repository at this point in the history
Signed-off-by: picobyte <[email protected]>
  • Loading branch information
picobyte authored and picobyte committed Nov 14, 2017
1 parent 6d67fd4 commit 6f73960
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions game/edit_button.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -352,18 +352,19 @@ init -1500 python in _editor:
# Move cursor to end of insertion. This is tricky.
i = 0
cx += len(entries[-1])
while cy + 1 != self.nolines:
bx, by = self.wrap2buf[cy+1]
if i == len(entries) - 1 and (bx == 0 or bx >= len(entries[i])):
if i == 0:
cx -= self.wrap2buf[cy][0]
elif cx == 0:
cx = len(entries[i]) - self.wrap2buf[cy][0]
break
cy += 1
if self.wrap2buf[cy][0] == 0:
i += 1
cx = 0
if len (entries) > 1:
while cy + 1 != self.nolines:
bx, by = self.wrap2buf[cy+1]
if i == len(entries) - 1 and (bx == 0 or bx >= len(entries[i])):
if i == 0:
cx -= self.wrap2buf[cy][0]
elif cx == 0:
cx = len(entries[i]) - self.wrap2buf[cy][0]
break
cy += 1
if self.wrap2buf[cy][0] == 0:
i += 1
cx = 0
self.console.cy = self.console.CY = cy
self.console.max = self.console.cx = self.console.CX = cx
renpy.redraw(self.console, 0)
Expand Down

0 comments on commit 6f73960

Please sign in to comment.