Skip to content

Commit

Permalink
Merge from 5.x: PR #16214
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Aug 15, 2021
2 parents bbd9b1f + 5547bda commit 3560014
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions spyder/plugins/editor/widgets/codeeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2833,10 +2833,12 @@ def paste(self):
preceding_text)

# Make sure the code is not flattened
max_dedent = min(
[self.get_line_indentation(line)
for line in remaining_lines if line.strip() != ""])
lines_adjustment = max(lines_adjustment, -max_dedent)
indentations = [
self.get_line_indentation(line)
for line in remaining_lines if line.strip() != ""]
if indentations:
max_dedent = min(indentations)
lines_adjustment = max(lines_adjustment, -max_dedent)

# Get new text
remaining_lines = [
Expand Down

0 comments on commit 3560014

Please sign in to comment.