Skip to content

Commit

Permalink
Merge from 5.x: PR #16223
Browse files Browse the repository at this point in the history
Fixes #16180
  • Loading branch information
ccordoba12 committed Aug 16, 2021
2 parents 3560014 + c6fefb8 commit 4701e2f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spyder/plugins/editor/widgets/codeeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,11 @@ def _apply_document_edits(self, edits):
if edits is None:
return

text = self.get_text_with_eol()
# We need to use here toPlainText and not get_text_with_eol to
# to not mess up the code when applying formatting.
# See spyder-ide/spyder#16180
text = self.toPlainText()

text_tokens = list(text)
merged_text = None
for edit in edits:
Expand Down

0 comments on commit 4701e2f

Please sign in to comment.