Skip to content

Commit

Permalink
fix cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Apr 19, 2024
1 parent 787331e commit b54f780
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2840,15 +2840,19 @@ def _display(self, screen: Screen, renderable: RenderableType | None) -> None:
try:
try:
if isinstance(renderable, CompositorUpdate):
cursor_x, cursor_y = self._previous_cursor_position
terminal_sequence = Control.move(
-cursor_x, -cursor_y
).segment.text
cursor_x, cursor_y = self.cursor_position
terminal_sequence += renderable.render_segments(console)
terminal_sequence += Control.move(
cursor_x, cursor_y
).segment.text
if self._driver.is_inline:
terminal_sequence = Control.move(
*(-self._previous_cursor_position)
).segment.text
terminal_sequence += renderable.render_segments(console)
terminal_sequence += Control.move(
*self.cursor_position
).segment.text
else:
terminal_sequence = renderable.render_segments(console)
terminal_sequence += Control.move_to(
*self.cursor_position
).segment.text
self._previous_cursor_position = self.cursor_position
else:
segments = console.render(renderable)
Expand Down

0 comments on commit b54f780

Please sign in to comment.