diff --git a/aider/io.py b/aider/io.py index ae27a9ff3ab..4e1d54d94ba 100644 --- a/aider/io.py +++ b/aider/io.py @@ -901,7 +901,7 @@ def get_continuation(width, line_number, is_soft_wrap): if self.clipboard_watcher: self.clipboard_watcher.stop() - if line.strip("\r\n") and not multiline_input: + if line and line.strip("\r\n") and not multiline_input: stripped = line.strip("\r\n") if stripped == "{": multiline_input = True @@ -921,7 +921,7 @@ def get_continuation(width, line_number, is_soft_wrap): inp = line break continue - elif multiline_input and line.strip(): + elif multiline_input and line and line.strip(): if multiline_tag: # Check if line is exactly "tag}" if line.strip("\r\n") == f"{multiline_tag}}}": @@ -933,7 +933,7 @@ def get_continuation(width, line_number, is_soft_wrap): break else: inp += line + "\n" - elif multiline_input: + elif multiline_input and line: inp += line + "\n" else: inp = line