X Tutup
Skip to content

Commit ec1f436

Browse files
remove list win visible code
1 parent 766f8e4 commit ec1f436

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

bpython/cli.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -454,21 +454,13 @@ def complete(self, tab=False):
454454
Called whenever these should be updated, and called
455455
with tab
456456
"""
457-
if self.paste_mode and self.list_win_visible:
458-
self.scr.touchwin()
459-
460457
if self.paste_mode:
461-
return
462-
463-
if self.list_win_visible and not self.config.auto_display_list:
464-
self.scr.touchwin()
465-
self.list_win_visible = False
466-
self.matches_iter.clear()
458+
self.scr.touchwin() #TODO necessary?
467459
return
468460

469461
if self.config.auto_display_list or tab:
470-
self.list_win_visible = repl.Repl.complete(self, tab)
471-
if self.list_win_visible:
462+
list_win_visible = repl.Repl.complete(self, tab)
463+
if list_win_visible:
472464
try:
473465
self.show_list(self.matches_iter.matches, topline=self.argspec, formatter=self.matches_iter.completer.format)
474466
except curses.error:
@@ -477,8 +469,8 @@ def complete(self, tab=False):
477469
# using it.
478470
self.list_win.border()
479471
self.list_win.refresh()
480-
self.list_win_visible = False
481-
if not self.list_win_visible:
472+
list_win_visible = False
473+
if not list_win_visible:
482474
self.scr.redrawwin()
483475
self.scr.refresh()
484476

@@ -1463,7 +1455,6 @@ def tab(self, back=False):
14631455
self.print_line(self.s)
14641456
if not self.matches_iter and self.config.auto_display_list:
14651457
self.complete()
1466-
#self.scr.touchwin() #TODO necessary?
14671458

14681459
# 4. swap current word for a match list item
14691460
elif self.matches_iter.matches:

bpython/repl.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,6 @@ def __init__(self, interp, config):
420420
self.argspec = None
421421
self.current_func = None
422422
self.highlighted_paren = None
423-
self.list_win_visible = False
424423
self._C = {}
425424
self.prev_block_finished = 0
426425
self.interact = Interaction(self.config)
@@ -641,8 +640,7 @@ def complete(self, tab=False):
641640
self.current_line(),
642641
matches, completer)
643642
self.matches_iter.next()
644-
self.list_win_visible = True #TODO what else is list_win_visible used for?
645-
if tab: # if this complete is being run for a tab key press, do the swap
643+
if tab: # if this complete is being run for a tab key press, tab() to do the swap
646644
self.tab()
647645
self.matches_iter.clear()
648646
return False

0 commit comments

Comments
 (0)
X Tutup