Skip to content

Commit

Permalink
move before run_command
Browse files Browse the repository at this point in the history
  • Loading branch information
predragnikolic committed Jan 24, 2024
1 parent 0c6068b commit 0db49fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,6 @@ def _update_stored_selection_async(self) -> Tuple[Optional[sublime.Region], bool
return changed_first_region, True

def _format_on_paste_async(self) -> None:
self.purge_changes_async()
clipboard_text = sublime.get_clipboard()
sel = self.view.sel()
split_clipboard_text = clipboard_text.split('\n')
Expand All @@ -987,6 +986,7 @@ def _format_on_paste_async(self) -> None:
formatting_region = sublime.Region(a, pasted_region.b)
regions_to_format.append(formatting_region)
sel.add_all(regions_to_format)
self.purge_changes_async()
self.view.run_command('lsp_format_document_range')
sel.clear()
sel.add_all(original_selection)
Expand Down

0 comments on commit 0db49fe

Please sign in to comment.