Permalink
Browse files

add Ctrl+Backspace and Ctrl+Del keybindings to delete to start and en…

…d of current word
  • Loading branch information...
1 parent 657504e commit 2c8f80f1f6b414849621b9526af1271449c1118e @mspacek mspacek committed Jun 1, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 IPython/frontend/qt/console/console_widget.py
@@ -988,6 +988,12 @@ def _event_filter_console_keypress(self, event):
intercepted = True
elif key in (QtCore.Qt.Key_Backspace, QtCore.Qt.Key_Delete):
+ if key == QtCore.Qt.Key_Backspace:
+ cursor = self._get_word_start_cursor(position)
+ else: # key == QtCore.Qt.Key_Delete
+ cursor = self._get_word_end_cursor(position)
+ cursor.setPosition(position, QtGui.QTextCursor.KeepAnchor)
+ self._kill_ring.kill_cursor(cursor)
intercepted = True
elif key in (QtCore.Qt.Key_Plus, QtCore.Qt.Key_Equal):

0 comments on commit 2c8f80f

Please sign in to comment.