Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
7adb9ad
initial working shell sidebar
taleinat Aug 5, 2019
26bbaec
fix recall and handling of prompt and input lines
taleinat Aug 23, 2019
9076da5
update only as needed during editing, accounting for line wrapping
taleinat Aug 23, 2019
cad2cd1
properly insert delegators into their proper place in the percolator
taleinat Aug 24, 2019
4040e26
move non-syntax tag highlighting out of ColorDelegator
taleinat Aug 24, 2019
9b31031
replace shell sidebar prompt and input line recognition method
taleinat Aug 24, 2019
37a0db3
minor code cleanup
taleinat Aug 24, 2019
c766822
remove unnecessary .replace() delegator method
taleinat Aug 24, 2019
50bd082
fix inverted condition in deciding whether to update sidebar (oops!)
taleinat Aug 24, 2019
6f186f0
fix "stdin" tag removed when undo-ing a deletion
taleinat Aug 24, 2019
f7f3de9
fix sidebar update on new prompt
taleinat Aug 24, 2019
e929ea7
add a NEWS entry
taleinat Aug 24, 2019
d04bfa3
fix recall handling with multiple successive statements
taleinat Aug 24, 2019
81f4852
remove a dead line
taleinat Aug 24, 2019
46be85e
remove commented out initial attempt
taleinat Aug 24, 2019
1fc4bcb
update shell sidebar font upon font config changes
taleinat Aug 25, 2019
6f1c975
update sidebar text colors upon highlight config changes
taleinat Sep 17, 2020
083fede
use the prompt ("console") foreground color for the shell sidebar text
taleinat Sep 17, 2020
4ad72a1
show continuation prompts ("...") for multi-line history recall
taleinat Sep 17, 2020
009e08d
show continuation prompts ("...") after multi-line replace in the shell
taleinat Sep 17, 2020
e524cce
show continuation prompts ("...") after multi-line undo/redo in the s…
taleinat Sep 17, 2020
3ea2986
don't show continuation prompts ("...") for print() outputs
taleinat Sep 17, 2020
7f9182f
allow deleting ">>> " at the beginning of a line in shell windows
taleinat Sep 17, 2020
10aaf1d
update shell sidebar on shell output squeeze/unsqueeze
taleinat Sep 17, 2020
7c91901
remove failing editor window test that is no longer relevant
taleinat Sep 17, 2020
50ca9c6
add several tests for the shell sidebar
taleinat Sep 18, 2020
23c218f
reduce shell sidebar test run time by reusing the PyShell
taleinat Sep 18, 2020
6cef0a9
revert removal of the "hit" tag from Colorizer.tag_defs
taleinat Oct 11, 2020
a018135
hide unnecessary extra "root" Tk window in tests
taleinat Oct 11, 2020
525fe44
fix test method names
taleinat Oct 11, 2020
7b8913d
fix test comments according to pep-8 style
taleinat Oct 11, 2020
8c8d0c0
rename sidebar test class according to convention
taleinat Oct 11, 2020
7ecc843
re-word doc-strings for BaseSideBar and EndLineDelegator
taleinat Oct 12, 2020
bedb1cb
re-word doc-strings for get_lineno and get_end_linenumber
taleinat Oct 12, 2020
eee0453
optimize tests and make them more robust
taleinat Oct 12, 2020
7afcb57
handle mouse buttons except for button 1 (left-click)
taleinat Oct 12, 2020
8a7dd60
add tests for text font and color configs
taleinat Oct 12, 2020
6efb968
remove show/hide_sidebar from the shell sidebar
taleinat Oct 12, 2020
cc37924
add more test cases
taleinat Oct 12, 2020
97576da
update coverage percentage
taleinat Oct 12, 2020
2aa4e1a
re-word squeeze_current_text() doc-string
taleinat Oct 12, 2020
71f343e
update coverage percentage
taleinat Oct 13, 2020
45e66a5
Merge branch 'master' into idle-shell-sidebar
taleinat Oct 13, 2020
dbe931c
fix wrong colors at ends of input lines/blocks
taleinat Oct 14, 2020
779adc4
fix some sidebar tests affected by losing window focus
taleinat Oct 14, 2020
8f81915
fix highlighting and sidebar prompts after syntax errors
taleinat Oct 15, 2020
ddc0026
better long-term disabling of line numbers tests
taleinat Oct 15, 2020
d1e0d32
update unittest coverage percentage
taleinat Oct 15, 2020
0516db9
run sidebar tests with PyShell without a sub-process
taleinat Oct 22, 2020
afa6669
avoid creating text widgets for whitespace shell prompts
taleinat Oct 22, 2020
9d06f26
simplify some test code
taleinat Oct 22, 2020
73146fb
remove unnecessary parentheses
taleinat Oct 22, 2020
19b16a4
fix first prompt when shown text starts with the end of a wrapped line
taleinat Oct 22, 2020
ecab884
fix failing tests on Azure Devops
taleinat Nov 1, 2020
7b2d9dc
Merge remote-tracking branch 'upstream/master' into pr_22682
terryjreedy Jan 22, 2021
d6e35cc
Merge remote-tracking branch 'upstream/master' into pr_22682
terryjreedy Apr 25, 2021
f6c9a7c
revert indentation change
taleinat Apr 25, 2021
990cef4
revert InteractiveInterpreter.runsource return values
taleinat Apr 25, 2021
e86353b
fix removal of final newline and surrounding whitespace
taleinat Apr 25, 2021
a1891a4
simplify fixed newline+whitespace removal using \Z
taleinat Apr 25, 2021
3e52c5d
revert unneeded changes to ResetColorizer
taleinat Apr 26, 2021
cc709ab
wrap some overly long lines of code
taleinat Apr 26, 2021
c4e79f3
Print saved debug info (can't print while shell exists)
terryjreedy Apr 27, 2021
42886dc
try resetting sys.stdout
taleinat Apr 27, 2021
e292d62
cleanup
taleinat Apr 27, 2021
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
Prev Previous commit
Next Next commit
fix recall handling with multiple successive statements
  • Loading branch information
taleinat committed Sep 17, 2020
commit d04bfa31b4b867eef943d9b2efa0608fcf652b39
33 changes: 19 additions & 14 deletions Lib/idlelib/pyshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -1189,25 +1189,30 @@ def enter_callback(self, event):
# the current line, less a leading prompt, less leading or
# trailing whitespace
if self.text.compare("insert", "<", "iomark linestart"):
# Check if there's a relevant stdin range -- if so, use it
# Check if there's a relevant stdin range -- if so, use it.
# Note: "stdin" blocks may include several successive statements,
# so look for "console" tags on the newline before each statement
# (and possibly on prompts).
prev = self.text.tag_prevrange("stdin", "insert")
if prev and self.text.compare("insert", "<", prev[1]):
for line in reversed(range(self.getlineno(prev[0]),
self.getlineno(prev[1]))):
if "console" in self.text.tag_names(f"{line}.0-1c"):
break
if self.text.compare(f"{line}.0", ">", prev[0]):
prev = (f"{line}.0", prev[1])
if (
prev and
self.text.compare("insert", "<", prev[1]) and
# The following is needed to handle empty statements.
"console" not in self.text.tag_names("insert")
):
prev_cons = self.text.tag_prevrange("console", "insert")
if prev_cons and self.text.compare(prev_cons[1], ">=", prev[0]):
prev = (prev_cons[1], prev[1])
next_cons = self.text.tag_nextrange("console", "insert")
if next_cons and self.text.compare(next_cons[0], "<", prev[1]):
prev = (prev[0], self.text.index(next_cons[0] + "+1c"))
self.recall(self.text.get(prev[0], prev[1]), event)
return "break"
next = self.text.tag_nextrange("stdin", "insert")
if next and self.text.compare("insert lineend", ">=", next[0]):
for line in range(self.getlineno(next[0]),
self.getlineno(next[1])):
if "console" in self.text.tag_names(f"{line+1}.0-1c"):
break
if self.text.compare(f"{line}.end", "<", next[1]):
next = (next[0], f"{line}.end")
next_cons = self.text.tag_nextrange("console", "insert lineend")
if next_cons and self.text.compare(next_cons[0], "<", next[1]):
next = (next[0], self.text.index(next_cons[0] + "+1c"))
self.recall(self.text.get(next[0], next[1]), event)
return "break"
# No stdin mark -- just get the current line, less any prompt
Expand Down