File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -2921,20 +2921,14 @@ def _input_line_to_statement(self, line: str) -> Statement:
29212921 else :
29222922 break
29232923
2924- # This will be true when a macro was used
2924+ # If a macro was expanded, the 'statement' now contains the expanded text.
2925+ # We need to swap the 'raw' attribute back to the string the user typed
2926+ # so history shows the original line.
29252927 if orig_line != statement .raw :
2926- # Build a Statement that contains the resolved macro line
2927- # but the originally typed line for its raw member.
2928- statement = Statement (
2929- statement .args ,
2930- raw = orig_line ,
2931- command = statement .command ,
2932- multiline_command = statement .multiline_command ,
2933- terminator = statement .terminator ,
2934- suffix = statement .suffix ,
2935- redirector = statement .redirector ,
2936- redirect_to = statement .redirect_to ,
2937- )
2928+ statement_dict = statement .to_dict ()
2929+ statement_dict ["raw" ] = orig_line
2930+ statement = Statement .from_dict (statement_dict )
2931+
29382932 return statement
29392933
29402934 def _resolve_macro (self , statement : Statement ) -> str | None :
You can’t perform that action at this time.
0 commit comments