Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Fix FoldingPanel._expand_selection to not select text an extra line below a folded region (Editor) #23044

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

athompson673
Copy link
Contributor

@athompson673 athompson673 commented Nov 21, 2024

Description of Changes

Edited FoldingPanel._expand_selection

  • don't select a entire extra line with TextHelper.select_lines (eliminated +1 from end_line)
  • select the leftover newline using MoveOperation.NextBlock so blank line is not left after deleting folded portion
  • Wrote at least one-line docstrings (for any new functions)
  • Added unit test(s) covering the changes (if testable)
  • Included a screenshot or animation (see linked issue)

Issue(s) Resolved

Fixes #23042

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct: athompson673

@pep8speaks
Copy link

pep8speaks commented Nov 21, 2024

Hello @athompson673! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-11-21 16:07:04 UTC

@athompson673 athompson673 marked this pull request as ready for review November 21, 2024 16:07
@ccordoba12 ccordoba12 changed the title fix _expand_selection to not select text on extra line below folded b… PR: fix FoldingPanel._expand_selection to not select text on extra line below a folded region (Editor) Nov 21, 2024
@ccordoba12 ccordoba12 changed the title PR: fix FoldingPanel._expand_selection to not select text on extra line below a folded region (Editor) PR: Fix FoldingPanel._expand_selection to not select text on extra line below a folded region (Editor) Nov 21, 2024
@ccordoba12 ccordoba12 added this to the v6.0.3 milestone Nov 21, 2024
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and it works like a charm. Thanks @athompson673!

@ccordoba12 ccordoba12 changed the title PR: Fix FoldingPanel._expand_selection to not select text on extra line below a folded region (Editor) PR: Fix FoldingPanel._expand_selection to not select text an extra line below a folded region (Editor) Nov 21, 2024
@ccordoba12 ccordoba12 merged commit 932d642 into spyder-ide:master Nov 21, 2024
17 checks passed
@athompson673 athompson673 deleted the patch-1 branch November 21, 2024 17:29
@ccordoba12
Copy link
Member

@meeseeksdev please backport to 6.x

meeseeksmachine pushed a commit to meeseeksmachine/spyder that referenced this pull request Nov 21, 2024
…` to not select text an extra line below a folded region (Editor)
ccordoba12 pushed a commit that referenced this pull request Nov 21, 2024
…tion` to not select text an extra line below a folded region (Editor)) (#23046)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete folded block erases text on following line
3 participants