Skip to content

bpo-33610: When toggling code-context on, immediately show the current context. #14821

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

Merged

Conversation

taleinat
Copy link
Contributor

@taleinat taleinat commented Jul 17, 2019

This avoids a delay of up to 100ms and the accompanying visual artifact.

https://bugs.python.org/issue33610

This avoids a delay of up to 100ms and the accompanying visual
artifact.
@terryjreedy
Copy link
Member

This is a partial solution. Open a file, such as editor.py. Scroll down to where there would be at least 2 line of context. 'Show Code Context'. Before: a double action; I believe a single blank line is opened and then after a deley, the context is expanded and filled in. After: the context is opened full size and filled in. Much better.

To continue: 'Hide Code Context'. 'Show Code Context'. A 1 line blank context is shown. ........ Seconds later, nothing is changed. ... Until do something line scroll that triggers the context. Diagnosis. Hide is not restoring everything to where it was before the first Show. Nor is it putting CC into a 'hidden' state that is properly restored by 'Show'. I have not looked yet.

The new line is likely part of a full solution and should be merged if we cannot do better before b3.

@taleinat
Copy link
Contributor Author

@terryjreedy, I've pushed a fix for the issue of wrong context shown after toggling off and back on. This was actually an entirely separate issue.

I've also added tests for both issues.

@taleinat taleinat added type-bug An unexpected behavior, bug, or error and removed performance Performance or resource usage labels Jul 18, 2019
Copy link
Member

@terryjreedy terryjreedy left a comment

Choose a reason for hiding this comment

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

Problem fixed. There is an issue with flashing (window manager clearing an area before overwriting it) when CC is in 'add' mode, versus 'sub' mode. Another reason to force CC into 'sub' mode. Nothing I tried made a definite improvement, so I am merging now, so we can move on.

@terryjreedy terryjreedy merged commit e0a1f8f into python:master Jul 18, 2019
@miss-islington
Copy link
Contributor

Thanks @taleinat for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 18, 2019
…ly (pythonGH-14821)

Eliminate delay of up to 100ms and accompanying visual artifact.
Fix bug of never showing context when hide and show.
(cherry picked from commit e0a1f8f)

Co-authored-by: Tal Einat <[email protected]>
@bedevere-bot
Copy link

GH-14846 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 18, 2019
…ly (pythonGH-14821)

Eliminate delay of up to 100ms and accompanying visual artifact.
Fix bug of never showing context when hide and show.
(cherry picked from commit e0a1f8f)

Co-authored-by: Tal Einat <[email protected]>
@bedevere-bot
Copy link

GH-14847 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this pull request Jul 18, 2019
…ly (GH-14821)

Eliminate delay of up to 100ms and accompanying visual artifact.
Fix bug of never showing context when hide and show.
(cherry picked from commit e0a1f8f)

Co-authored-by: Tal Einat <[email protected]>
terryjreedy pushed a commit that referenced this pull request Jul 18, 2019
…ly (GH-14821) (#14846)

Eliminate delay of up to 100ms and accompanying visual artifact.
Fix bug of never showing context when hide and show.
(cherry picked from commit e0a1f8f)

Co-authored-by: Tal Einat <[email protected]>
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
…ly (pythonGH-14821)

Eliminate delay of up to 100ms and accompanying visual artifact.
Fix bug of never showing context when hide and show.
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
…ly (pythonGH-14821)

Eliminate delay of up to 100ms and accompanying visual artifact.
Fix bug of never showing context when hide and show.
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
…ly (pythonGH-14821)

Eliminate delay of up to 100ms and accompanying visual artifact.
Fix bug of never showing context when hide and show.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants