Skip to content

Commit

Permalink
Fix to issue spyder-ide#1785 regarding comment function in the editor
Browse files Browse the repository at this point in the history
Comment function : adds a space after the comment string (# for Python)
Uncomment function : removes the comment string and removes one space
if there is one
  • Loading branch information
Ericvulpi committed Jun 25, 2017
1 parent a6b7934 commit a803d80
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spyder/widgets/sourcecode/codeeditor.py
Expand Up @@ -2206,11 +2206,12 @@ def toggle_comment(self):

def comment(self):
"""Comment current line or selection."""
self.add_prefix(self.comment_string)
self.add_prefix(self.comment_string + " ")

def uncomment(self):
"""Uncomment current line or selection."""
self.remove_prefix(self.comment_string)
self.remove_prefix(" ")

def __blockcomment_bar(self):
return self.comment_string + '='*(79-len(self.comment_string))
Expand Down

0 comments on commit a803d80

Please sign in to comment.