X Tutup
Skip to content

Commit 5cb82a5

Browse files
committed
Split on os.path.sep in list_win() for filenames instead of '.'
This will close issue #61.
1 parent 7fd101f commit 5cb82a5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

bpython/cli.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,10 +726,15 @@ def show_list(self, items, topline=None, current_item=None):
726726
max_h = y+1
727727
max_w = int(w * 0.8)
728728
self.list_win.erase()
729-
if items and '.' in items[0]:
730-
items = [x.rsplit('.')[-1] for x in items]
731-
if current_item:
732-
current_item = current_item.rsplit('.')[-1]
729+
if items:
730+
sep = '.'
731+
if os.path.sep in items[0]:
732+
# Filename completion
733+
sep = os.path.sep
734+
if sep in items[0]:
735+
items = [x.rstrip(sep).rsplit(sep)[-1] for x in items]
736+
if current_item:
737+
current_item = current_item.rstrip(sep).rsplit(sep)[-1]
733738

734739
if topline:
735740
height_offset = self.mkargspec(topline, down) + 1

0 commit comments

Comments
 (0)
X Tutup