mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-21 05:41:54 +03:00
Add support for tab, backspace, and (ignoring) bell for ANSI loading
This commit is contained in:
parent
de4cf01f73
commit
7ce6cc08ca
@ -871,6 +871,17 @@ class AnsiArtDocument:
|
||||
document.ch.append([])
|
||||
document.bg.append([])
|
||||
document.fg.append([])
|
||||
elif char == '\t':
|
||||
x += 8 - (x % 8)
|
||||
elif char == '\b':
|
||||
x -= 1
|
||||
if x < 0:
|
||||
x = 0
|
||||
# on some terminals, backspace at the start of a line moves the cursor up,
|
||||
# but we're not defining a width for the document up front, so we can't do that
|
||||
elif char == '\x07':
|
||||
# ignore bell
|
||||
pass
|
||||
else:
|
||||
while len(document.ch[y]) <= x:
|
||||
document.ch[y].append(' ')
|
||||
|
Loading…
Reference in New Issue
Block a user