Console: add support for displaying tab-stops

Without this it was necessary to convert pasted text into spaces
for them to display properly.

Since tabs are a valid part of a string, it's incorrect to assume
tabs can always be expanded to spaces.

Pasted text and console output now display tabs properly,
the tab still uses spaces for indenting though.
This commit is contained in:
Campbell Barton
2023-09-22 13:16:28 +10:00
parent 18e07098ef
commit a5cd497543
10 changed files with 45 additions and 36 deletions

View File

@@ -34,8 +34,7 @@ class _TempModuleOverride:
def add_scrollback(text, text_type):
for l in text.split("\n"):
bpy.ops.console.scrollback_append(text=l.replace("\t", " "),
type=text_type)
bpy.ops.console.scrollback_append(text=l, type=text_type)
def replace_help(namespace):