bpo-39781: Do not jump when select in IDLE codecontext (GH-18683)

Previously, the button-up part of selecting with a mouse was treated as a click
that meant 'jump' to this line, which modified the context and undid the selection
This commit is contained in:
Terry Jan Reedy 2020-02-28 13:22:55 -05:00 committed by GitHub
parent 4f17c5cd9a
commit c705fd1e89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 19 deletions

View file

@ -332,6 +332,14 @@ class CodeContextTest(unittest.TestCase):
jump()
eq(cc.topvisible, 8)
# Context selection stops jump.
cc.text.yview('5.0')
cc.update_code_context()
cc.context.tag_add('sel', '1.0', '2.0')
cc.context.mark_set('insert', '1.0')
jump() # Without selection, to line 2.
eq(cc.topvisible, 5)
@mock.patch.object(codecontext.CodeContext, 'update_code_context')
def test_timer_event(self, mock_update):
# Ensure code context is not active.