Skip to content

Commit

Permalink
Merge pull request #3699 from rlaverde/remove-magic-dir-separator-find
Browse files Browse the repository at this point in the history
PR: Remove logic to delete last dir separator (\, /) in find and replace widget
  • Loading branch information
ccordoba12 authored Nov 23, 2016
2 parents 07bedec + cb90ce6 commit 78ee099
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 78ee099

Please sign in to comment.