Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
71662dc2
Commit
71662dc2
authored
Aug 14, 2019
by
Tal Einat
Committed by
Terry Jan Reedy
Aug 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-37849: IDLE: fix completion window positioning above line (GH-15267)
parent
4fa10dde
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
Lib/idlelib/NEWS.txt
Lib/idlelib/NEWS.txt
+5
-0
Lib/idlelib/autocomplete_w.py
Lib/idlelib/autocomplete_w.py
+13
-2
Misc/NEWS.d/next/IDLE/2019-08-14-09-43-15.bpo-37849.-bcYF3.rst
...NEWS.d/next/IDLE/2019-08-14-09-43-15.bpo-37849.-bcYF3.rst
+2
-0
No files found.
Lib/idlelib/NEWS.txt
View file @
71662dc2
...
...
@@ -3,6 +3,11 @@ Released on 2019-10-20?
======================================
bpo-37849: Fix completions list appearing too high or low when shown
above the current line.
bpo-36419: Refactor autocompete and improve testing.
bpo-37748: Reorder the Run menu. Put the most common choice,
Run Module, at the top.
...
...
Lib/idlelib/autocomplete_w.py
View file @
71662dc2
...
...
@@ -52,10 +52,12 @@ class AutoCompleteWindow:
# (for example, he clicked the list)
self
.
userwantswindow
=
None
# event ids
self
.
hideid
=
self
.
keypressid
=
self
.
listupdateid
=
self
.
winconfigid
\
=
self
.
keyreleaseid
=
self
.
doubleclickid
=
None
self
.
hideid
=
self
.
keypressid
=
self
.
listupdateid
=
\
self
.
winconfigid
=
self
.
keyreleaseid
=
self
.
doubleclickid
=
None
# Flag set if last keypress was a tab
self
.
lastkey_was_tab
=
False
# Flag set to avoid recursive <Configure> callback invocations.
self
.
is_configuring
=
False
def
_change_start
(
self
,
newstart
):
min_len
=
min
(
len
(
self
.
start
),
len
(
newstart
))
...
...
@@ -223,12 +225,18 @@ class AutoCompleteWindow:
self
.
widget
.
event_add
(
KEYRELEASE_VIRTUAL_EVENT_NAME
,
KEYRELEASE_SEQUENCE
)
self
.
listupdateid
=
listbox
.
bind
(
LISTUPDATE_SEQUENCE
,
self
.
listselect_event
)
self
.
is_configuring
=
False
self
.
winconfigid
=
acw
.
bind
(
WINCONFIG_SEQUENCE
,
self
.
winconfig_event
)
self
.
doubleclickid
=
listbox
.
bind
(
DOUBLECLICK_SEQUENCE
,
self
.
doubleclick_event
)
return
None
def
winconfig_event
(
self
,
event
):
if
self
.
is_configuring
:
# Avoid running on recursive <Configure> callback invocations.
return
self
.
is_configuring
=
True
if
not
self
.
is_active
():
return
# Position the completion list window
...
...
@@ -236,6 +244,7 @@ class AutoCompleteWindow:
text
.
see
(
self
.
startindex
)
x
,
y
,
cx
,
cy
=
text
.
bbox
(
self
.
startindex
)
acw
=
self
.
autocompletewindow
acw
.
update
()
acw_width
,
acw_height
=
acw
.
winfo_width
(),
acw
.
winfo_height
()
text_width
,
text_height
=
text
.
winfo_width
(),
text
.
winfo_height
()
new_x
=
text
.
winfo_rootx
()
+
min
(
x
,
max
(
0
,
text_width
-
acw_width
))
...
...
@@ -256,6 +265,8 @@ class AutoCompleteWindow:
acw
.
unbind
(
WINCONFIG_SEQUENCE
,
self
.
winconfigid
)
self
.
winconfigid
=
None
self
.
is_configuring
=
False
def
_hide_event_check
(
self
):
if
not
self
.
autocompletewindow
:
return
...
...
Misc/NEWS.d/next/IDLE/2019-08-14-09-43-15.bpo-37849.-bcYF3.rst
0 → 100644
View file @
71662dc2
Fixed completions list appearing too high or low when shown above
the current line.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment