File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1779,15 +1779,21 @@ def _handle_completion_token_quote(self, raw_completion_token):
17791779 # If common_prefix contains a space, then we must add an opening quote to it
17801780 if ' ' in common_prefix :
17811781
1782- new_completion_token = '"' + common_prefix
1782+ # Figure out what kind of quote to add
1783+ if '"' in common_prefix :
1784+ quote = "'"
1785+ else :
1786+ quote = '"'
1787+
1788+ new_completion_token = quote + common_prefix
17831789
17841790 # Handle a single result
17851791 if len (self .completion_matches ) == 1 :
17861792 str_to_append = ''
17871793
17881794 # Add a closing quote if allowed
17891795 if self .allow_closing_quote :
1790- str_to_append += '"'
1796+ str_to_append += quote
17911797
17921798 orig_line = readline .get_line_buffer ()
17931799 endidx = readline .get_endidx ()
You can’t perform that action at this time.
0 commit comments