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
2122b62c
Commit
2122b62c
authored
Sep 27, 2015
by
Terry Jan Reedy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backed out changeset: 70c01dd35100
parent
7082cbce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
Lib/idlelib/EditorWindow.py
Lib/idlelib/EditorWindow.py
+30
-1
No files found.
Lib/idlelib/EditorWindow.py
View file @
2122b62c
...
...
@@ -317,6 +317,36 @@ class EditorWindow(object):
self
.
askinteger
=
tkSimpleDialog
.
askinteger
self
.
showerror
=
tkMessageBox
.
showerror
self
.
_highlight_workaround
()
# Fix selection tags on Windows
def
_highlight_workaround
(
self
):
# On Windows, Tk removes painting of the selection
# tags which is different behavior than on Linux and Mac.
# See issue14146 for more information.
if
not
sys
.
platform
.
startswith
(
'win'
):
return
text
=
self
.
text
text
.
event_add
(
"<<Highlight-FocusOut>>"
,
"<FocusOut>"
)
text
.
event_add
(
"<<Highlight-FocusIn>>"
,
"<FocusIn>"
)
def
highlight_fix
(
focus
):
sel_range
=
text
.
tag_ranges
(
"sel"
)
if
sel_range
:
if
focus
==
'out'
:
HILITE_CONFIG
=
idleConf
.
GetHighlight
(
idleConf
.
CurrentTheme
(),
'hilite'
)
text
.
tag_config
(
"sel_fix"
,
HILITE_CONFIG
)
text
.
tag_raise
(
"sel_fix"
)
text
.
tag_add
(
"sel_fix"
,
*
sel_range
)
elif
focus
==
'in'
:
text
.
tag_remove
(
"sel_fix"
,
"1.0"
,
"end"
)
text
.
bind
(
"<<Highlight-FocusOut>>"
,
lambda
ev
:
highlight_fix
(
"out"
))
text
.
bind
(
"<<Highlight-FocusIn>>"
,
lambda
ev
:
highlight_fix
(
"in"
))
def
_filename_to_unicode
(
self
,
filename
):
"""Return filename as BMP unicode so diplayable in Tk."""
# Decode bytes to unicode.
...
...
@@ -755,7 +785,6 @@ class EditorWindow(object):
insertbackground
=
cursor_color
,
selectforeground
=
select_colors
[
'foreground'
],
selectbackground
=
select_colors
[
'background'
],
inactiveselectbackground
=
select_colors
[
'background'
],
)
IDENTCHARS
=
string
.
ascii_letters
+
string
.
digits
+
"_"
...
...
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