Skip to content

Instantly share code, notes, and snippets.

@celediel
Created March 13, 2016 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save celediel/414bb0b2bcc0ae9a12e2 to your computer and use it in GitHub Desktop.
Save celediel/414bb0b2bcc0ae9a12e2 to your computer and use it in GitHub Desktop.
Patch for ncTelegram to restore sane ^W function.
diff -crB ncTelegram-orig/ncTelegram/ui_msgsendwidget.py ncTelegram/ncTelegram/ui_msgsendwidget.py
*** ncTelegram-orig/ncTelegram/ui_msgsendwidget.py 2016-03-13 12:17:19.222512423 -0700
--- ncTelegram/ncTelegram/ui_msgsendwidget.py 2016-03-13 12:30:16.099188604 -0700
***************
*** 156,164 ****
self.autocomplete()
# deletion of current text
! elif key == 'ctrl w' or key == 'ctrl k':
self.widgetEdit.set_edit_text("")
# gives the focus to the message list
elif key == 'up' or key == 'page up' or key == 'esc':
self.Telegram_ui.right_side.focus_position = 0
--- 156,170 ----
self.autocomplete()
# deletion of current text
! elif key == 'ctrl k':
self.widgetEdit.set_edit_text("")
+ elif key == 'ctrl w':
+ t_x = self.widgetEdit.get_edit_text()
+ t_x = t_x.split(' ')[0:-1]
+ t_x = ' '.join(t_x)
+ self.widgetEdit.set_edit_text(t_x)
+
# gives the focus to the message list
elif key == 'up' or key == 'page up' or key == 'esc':
self.Telegram_ui.right_side.focus_position = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment