Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
5c57faf
parenmatch highlighting options
wohlganger Jun 29, 2017
d49170f
fixed whitespace issue
wohlganger Jun 29, 2017
8c3a966
only select from highlighting options
wohlganger Jun 30, 2017
757bb38
fixed whitespace
wohlganger Jun 30, 2017
d7e136c
whitespace
wohlganger Jun 30, 2017
b178af5
Merge remote-tracking branch 'upstream/master'
wohlganger Jul 10, 2017
2adebb9
#27099 - turn builtin extensions to reg modules
wohlganger Jul 10, 2017
86c3d4c
whitespace + fix I thought I already committed.
wohlganger Jul 10, 2017
1c246fc
warning fixes, removed old config entries
wohlganger Jul 11, 2017
0418ad0
calltip append doc fix, default paren-fore fix, help update
wohlganger Jul 11, 2017
097a0d8
fix calltips
wohlganger Jul 12, 2017
4232e77
removed circular import
wohlganger Jul 12, 2017
a7b29f5
fix warnings due to missing default config options in idlelib.config-…
wohlganger Jul 12, 2017
e30b7b4
Merge branch 'master' into master
wohlganger Jul 17, 2017
252672b
added format_pmaxw to config-main
wohlganger Jul 19, 2017
999b573
Merge remote-tracking branch 'upstream/master'
wohlganger Jul 19, 2017
1a74591
replaced help.html edit with idle.rst edit
wohlganger Jul 20, 2017
3501c45
Merge branch 'master' into master
wohlganger Jul 24, 2017
232f711
Merge remote-tracking branch 'upstream/master'
wohlganger Aug 4, 2017
f095c53
added conflict resolved var descriptions to docstring in create_page_…
wohlganger Aug 4, 2017
a661bfa
strip trailing whitespace
wohlganger Aug 4, 2017
5c90a8f
Merge branch 'master' into master
wohlganger Aug 24, 2017
5a6a007
re-introduced highlight options.
wohlganger Aug 24, 2017
709b434
News blurb.
terryjreedy Aug 24, 2017
b9b1f9a
Reinstated zoomheight as an extension. Replaced autoexpand with zoomh…
wohlganger Aug 24, 2017
8b76ccb
fixed configdialog test (wrong cases), fixed whitespace
wohlganger Aug 24, 2017
b986c12
update idle.rst: zoomheight is an extension.
wohlganger Aug 24, 2017
f86acaa
more fixes for zoomheight - trying to minimize changes from master
wohlganger Aug 24, 2017
5805462
zoomheight config fix, zoomheight should be fully back to the way it …
wohlganger Aug 24, 2017
165b548
whitespace
wohlganger Aug 24, 2017
aee5d02
fixed force-open completions missing from config-keys and config. Fix…
wohlganger Aug 24, 2017
cb161bd
Changes made per terryjreedy request.
wohlganger Aug 25, 2017
dc09a2b
re-added autocomplete wait and format paragraph max width options to …
wohlganger Aug 25, 2017
100463e
Merge branch 'master' into master
wohlganger Aug 28, 2017
3fbaa90
Merge branch 'master' into master
wohlganger Aug 30, 2017
60ff82f
changes per terryjreedy
wohlganger Aug 30, 2017
e3f6f16
fix warnings, errors, bugs
wohlganger Aug 30, 2017
a253f0c
whitespace
wohlganger Aug 30, 2017
fe8eb7a
bugfix
wohlganger Aug 30, 2017
caa7774
Make changes need to get IDLE to run
terryjreedy Aug 31, 2017
c29184e
Edit extension/feature files, making existing tests pass.
terryjreedy Aug 31, 2017
c62f726
Redo feature bindings.
terryjreedy Aug 31, 2017
d0e009f
First draft of dummy extension.
terryjreedy Aug 31, 2017
9e889c2
Fix that eliminate startup error and all but 2 test_idle errors.
terryjreedy Aug 31, 2017
6afdea3
Move widgets, load widgets, add tests, make previous tests pass.
terryjreedy Sep 2, 2017
7de27db
Add format-paragraph to core keys.
terryjreedy Sep 5, 2017
a2e76a7
Merge remote-tracking branch 'origin/master' into pr_2494
terryjreedy Sep 5, 2017
2265b53
Fix autocomplete and long lines.
terryjreedy Sep 5, 2017
03eed24
Put fixed-key event-adds in EditorWindow.__init__ for now.
terryjreedy Sep 9, 2017
207b0ca
Don't warn if new core keys not in user key config.
terryjreedy Sep 9, 2017
00acd22
Make code context inoperative in outwin, shell.
terryjreedy Sep 9, 2017
2d2bfbd
Change new bindings for MacOsx.
terryjreedy Sep 9, 2017
fe76cd3
Disable test dependent on extension Alt keys.
terryjreedy Sep 9, 2017
d2966e0
Minor edits.
terryjreedy Sep 9, 2017
6845bb0
File out news blurb explaining effect for users.
terryjreedy Sep 10, 2017
b7afebb
Don't compute ('') during integer input in entry box.
terryjreedy Sep 10, 2017
b1a4101
Merge remote-tracking branch 'upstream/master'
wohlganger Sep 12, 2017
7a53366
fix conflict
wohlganger Sep 12, 2017
d3b6848
fix conflict
wohlganger Sep 12, 2017
eb58d39
fix conflict, match upstream
wohlganger Sep 12, 2017
119bbfc
match upstream
wohlganger Sep 12, 2017
16cca54
partial solution
wohlganger Sep 13, 2017
ce7f967
added option to configdialog
wohlganger Sep 13, 2017
dc503d5
pep8 fixes
wohlganger Sep 14, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/idlelib/config-extensions.def
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ max-width= 72
style= expression
flash-delay= 500
bell= True

highlighting = hilite

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's a mismatch between "highlighting" here and "highlight" used in the config dialog.

# IDLE reads several config files to determine user preferences. This
# file is the default configuration file for IDLE extensions settings.
#
Expand Down
16 changes: 14 additions & 2 deletions Lib/idlelib/configdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,8 @@ def create_page_general(self):
StringVar(self), ('extensions', 'AutoComplete', 'popupwait'))
self.paren_style = tracers.add(
StringVar(self), ('extensions', 'ParenMatch', 'style'))
self.paren_highlight = tracers.add(
StringVar(self), ('extensions', 'ParenMatch', 'highlight'))
self.flash_delay = tracers.add(
StringVar(self), ('extensions', 'ParenMatch', 'flash-delay'))
self.paren_bell = tracers.add(
Expand Down Expand Up @@ -1826,6 +1828,12 @@ def create_page_general(self):
self.paren_style_type = OptionMenu(
frame_paren1, self.paren_style, 'expression',
"opener","parens","expression")
paren_highlight_title = Label(frame_paren1,
text=' Paren Match Colors')
self.paren_highlight_type = OptionMenu(
frame_paren1, self.paren_highlight, 'hilite',
'normal','keyword','definition','builtin','comment','string',
'hilite','hit','cursor','break','stdout','stderr')
frame_paren2 = Frame(frame_window, borderwidth=0)
paren_time_title = Label(
frame_paren2, text='Time Match Displayed (milliseconds)\n'
Expand Down Expand Up @@ -1900,8 +1908,10 @@ def create_page_general(self):
self.auto_wait_int.pack(side=TOP, padx=10, pady=5)
# frame_paren.
frame_paren1.pack(side=TOP, padx=5, pady=0, fill=X)
paren_style_title.pack(side=LEFT, anchor=W, padx=5, pady=5)
self.paren_style_type.pack(side=TOP, padx=10, pady=5)
paren_style_title.pack(side=LEFT, anchor=W, padx=5, pady=0)
self.paren_style_type.pack(side=LEFT, padx=5, pady=0)
paren_highlight_title.pack(side=LEFT, anchor=W, padx=5, pady=0)
self.paren_highlight_type.pack(side=LEFT, padx=5, pady=0)
frame_paren2.pack(side=TOP, padx=5, pady=0, fill=X)
paren_time_title.pack(side=LEFT, anchor=W, padx=5)
self.bell_on.pack(side=RIGHT, anchor=E, padx=15, pady=5)
Expand Down Expand Up @@ -1943,6 +1953,8 @@ def load_general_cfg(self):
'extensions', 'AutoComplete', 'popupwait', type='int'))
self.paren_style.set(idleConf.GetOption(
'extensions', 'ParenMatch', 'style'))
self.paren_highlight.set(idleConf.GetOption(
'extensions', 'ParenMatch', 'highlight'))
self.flash_delay.set(idleConf.GetOption(
'extensions', 'ParenMatch', 'flash-delay', type='int'))
self.paren_bell.set(idleConf.GetOption(
Expand Down
12 changes: 3 additions & 9 deletions Lib/idlelib/idle_test/test_parenmatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from idlelib.parenmatch import ParenMatch
from test.support import requires
requires('gui')

import unittest
from unittest.mock import Mock
from tkinter import Tk, Text
Expand Down Expand Up @@ -53,28 +52,26 @@ def test_paren_styles(self):
pm = self.get_parenmatch()
for style, range1, range2 in (
('opener', ('1.10', '1.11'), ('1.10', '1.11')),
('default',('1.10', '1.11'),('1.10', '1.11')),
('default', ('1.10', '1.11'), ('1.10', '1.11')),
('parens', ('1.14', '1.15'), ('1.15', '1.16')),
('expression', ('1.10', '1.15'), ('1.10', '1.16'))):
with self.subTest(style=style):
text.delete('1.0', 'end')
pm.set_style(style)
text.insert('insert', 'def foobar(a, b')

pm.flash_paren_event('event')
self.assertIn('<<parenmatch-check-restore>>', text.event_info())
self.assertIn('<<parenmatch-check-restore>>',
text.event_info())
if style == 'parens':
self.assertTupleEqual(text.tag_nextrange('paren', '1.0'),
('1.10', '1.11'))
self.assertTupleEqual(
text.tag_prevrange('paren', 'end'), range1)

text.insert('insert', ')')
pm.restore_event()
self.assertNotIn('<<parenmatch-check-restore>>',
text.event_info())
self.assertEqual(text.tag_prevrange('paren', 'end'), ())

pm.paren_closed_event('event')
self.assertTupleEqual(
text.tag_prevrange('paren', 'end'), range2)
Expand All @@ -87,14 +84,11 @@ def test_paren_corner(self):
"""
text = self.text
pm = self.get_parenmatch()

text.insert('insert', '# this is a commen)')
pm.paren_closed_event('event')

text.insert('insert', '\ndef')
pm.flash_paren_event('event')
pm.paren_closed_event('event')

text.insert('insert', ' a, *arg)')
pm.paren_closed_event('event')

Expand Down
26 changes: 17 additions & 9 deletions Lib/idlelib/parenmatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
from idlelib.hyperparser import HyperParser
from idlelib.config import idleConf

_openers = {')':'(',']':'[','}':'{'}
CHECK_DELAY = 100 # milliseconds
_openers = {')': '(', ']': '[', '}': '{'}
CHECK_DELAY = 100 # milliseconds


class ParenMatch:
"""Highlight matching openers and closers, (), [], and {}.
Expand Down Expand Up @@ -53,13 +54,17 @@ def __init__(self, editwin):
@classmethod
def reload(cls):
cls.STYLE = idleConf.GetOption(
'extensions','ParenMatch','style', default='opener')
'extensions', 'ParenMatch', 'style', default='opener')
cls.FLASH_DELAY = idleConf.GetOption(
'extensions','ParenMatch','flash-delay', type='int',default=500)
'extensions', 'ParenMatch', 'flash-delay', type='int',
default=500)
cls.BELL = idleConf.GetOption(
'extensions','ParenMatch','bell', type='bool', default=1)
cls.HILITE_CONFIG = idleConf.GetHighlight(idleConf.CurrentTheme(),
'hilite')
'extensions', 'ParenMatch', 'bell', type='bool', default=1)
cls.HILITE_CONFIG = idleConf.GetHighlight(
idleConf.CurrentTheme(), idleConf.GetOption(
'extensions', 'ParenMatch', 'highlighting', type='string',
default='hilite')
)

def activate_restore(self):
"Activate mechanism to restore text from highlighting."
Expand Down Expand Up @@ -140,7 +145,8 @@ def create_tag_parens(self, indices):
rightindex = indices[1]+"+1c"
else:
rightindex = indices[1]
self.text.tag_add("paren", indices[0], indices[0]+"+1c", rightindex+"-1c", rightindex)
self.text.tag_add("paren", indices[0], indices[0] + "+1c",
rightindex + "-1c", rightindex)
self.text.tag_config("paren", self.HILITE_CONFIG)

def create_tag_expression(self, indices):
Expand All @@ -162,6 +168,7 @@ def set_timeout_none(self):
# if the event is for the most recent timer and the insert has changed,
# or schedules another call for itself.
self.counter += 1

def callme(callme, self=self, c=self.counter,
index=self.text.index("insert")):
if index != self.text.index("insert"):
Expand All @@ -171,7 +178,8 @@ def callme(callme, self=self, c=self.counter,
self.editwin.text_frame.after(CHECK_DELAY, callme, callme)

def set_timeout_last(self):
"""The last highlight created will be removed after FLASH_DELAY millisecs"""
"""The last highlight created will be removed
after FLASH_DELAY millisecs"""
# associate a counter with an event; only disable the "paren"
# tag if the event is for the most recent timer.
self.counter += 1
Expand Down
Empty file modified Tools/ssl/multissltests.py
100755 → 100644
Empty file.