mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-27 03:42:49 +00:00
Preserve line breaks to keep the line numbers in error messages
This commit is contained in:
parent
621453b068
commit
576ab24609
1 changed files with 1 additions and 1 deletions
|
|
@ -233,7 +233,7 @@ def prepare_script(ans: str, replacements: Dict[str, str], script_type: str) ->
|
|||
if script_type == 'sh':
|
||||
# Remove comments and indents. The dropbear SSH server has 9000 bytes limit on ssh arguments length.
|
||||
# Needs to be trimmed before replacing EXEC_CMD to avoid affecting the indentation of user commands.
|
||||
ans = re.sub(r'^\s*#.*\n|^\s*', '', ans, flags=re.MULTILINE)
|
||||
ans = re.sub(r'^[ \t]*#.*$|^[ \t]*', '', ans, flags=re.MULTILINE)
|
||||
return re.sub('|'.join(fr'\b{k}\b' for k in replacements), sub, ans)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue