def _on_completions_refreshed(self, new_completer):
with self._completer_lock:<EOL><INDENT>self.completer = new_completer<EOL>if self.cli:<EOL><INDENT>self.cli.current_buffer.completer = new_completer<EOL><DEDENT><DEDENT>if self.cli:<EOL><INDENT>self.cli.request_redraw()<EOL><DEDENT>
Swap the completer object in cli with the newly created completer.