summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/windows.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/windows.py b/src/windows.py
index 3975bf33..c2d4ab60 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -1109,6 +1109,7 @@ class Input(Win):
'M-b': self.jump_word_left,
"M-[1;5D": self.jump_word_left,
'^W': self.delete_word,
+ 'M-d': self.delete_next_word,
'^K': self.delete_end_of_line,
'^U': self.delete_begining_of_line,
'^Y': self.paste_clipboard,
@@ -1182,6 +1183,20 @@ class Input(Win):
return True
+ def delete_next_word(self):
+ """
+ Delete the word just after the cursor
+ """
+ log.debug("delete_next_word")
+ if len(self.text) == self.pos+self.line_pos or not len(self.text):
+ return
+ separators = string.punctuation+' '
+ while len(self.text) != self.pos+self.line_pos and self.text[self.pos+self.line_pos] in separators:
+ self.key_dc()
+ while len(self.text) != self.pos+self.line_pos and self.text[self.pos+self.line_pos] not in separators:
+ self.key_dc()
+ return True
+
def delete_end_of_line(self):
"""
Cut the text from cursor to the end of line