Skip to content

Commit

Permalink
fix add trailing space after ^W
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanoseb committed Apr 18, 2016
1 parent 81d2b42 commit feb675a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ncTelegram/ui_msgsendwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,13 @@ def keypress(self, size, key):
# it deletes the last word of the text area, not the one just before the cursor for now
elif key == 'ctrl w':
edit_text = self.widgetEdit.get_edit_text()
edit_text = re.sub(r'\s+$', '', edit_text)
new_edit_text = ' '.join(edit_text.split(' ')[:-1])
self.widgetEdit.set_edit_text(new_edit_text + " ")
if new_edit_text:
self.widgetEdit.set_edit_text(new_edit_text + ' ')
else:
self.widgetEdit.set_edit_text('')



# gives the focus to the message list
Expand Down

0 comments on commit feb675a

Please sign in to comment.