Skip to content

Commit

Permalink
Merge from 3.x: PR #3699
Browse files Browse the repository at this point in the history
Fixes #3141
  • Loading branch information
ccordoba12 committed Nov 23, 2016
2 parents 8f925cd + 78ee099 commit 08dc2dd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions spyder/widgets/comboboxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ def set_current_text(self, text):
def add_current_text(self):
"""Add current text to combo box history (convenient method)"""
text = self.currentText()
if osp.isdir(text):
if text[-1] == os.sep:
text = text[:-1]
self.add_text(text)

def add_current_text_if_valid(self):
Expand Down Expand Up @@ -272,6 +269,17 @@ def selected(self):
self.valid.emit(True, True)
self.open_dir.emit(self.selected_text)

def add_current_text(self):
"""
Add current text to combo box history (convenient method).
If path ends in os separator ("\" windows, "/" unix) remove it.
"""
text = self.currentText()
if osp.isdir(text) and text:
if text[-1] == os.sep:
text = text[:-1]
self.add_text(text)


class UrlComboBox(PathComboBox):
"""
Expand Down

0 comments on commit 08dc2dd

Please sign in to comment.