[shpy-commit] r2880 - shpy/trunk/dist/shpy/ui_pygame

mwh@codespeak.net mwh@codespeak.net
Fri, 23 Jan 2004 14:12:56 +0100 (MET)


Author: mwh
Date: Fri Jan 23 14:12:55 2004
New Revision: 2880

Modified:
   shpy/trunk/dist/shpy/ui_pygame/ui_pygame.py
Log:
C-k implementation.  No kill-ring yet.


Modified: shpy/trunk/dist/shpy/ui_pygame/ui_pygame.py
==============================================================================
--- shpy/trunk/dist/shpy/ui_pygame/ui_pygame.py	(original)
+++ shpy/trunk/dist/shpy/ui_pygame/ui_pygame.py	Fri Jan 23 14:12:55 2004
@@ -221,6 +221,18 @@
 
     def CTRL_K_e(self, event):
         self.cursor.x = len(self.cursor.line.content)
+
+    def CTRL_K_k(self, event):
+        line = self.cursor.line
+        x = self.cursor.x
+        for c in line.content[x:]:
+            if not c.isspace():
+                line.content = line.content[:x]
+                return
+        else:
+            nextline = self.cursor.cell.lines.next(line)
+            line.content = line.content[:x] + nextline.content
+            self.cursor.cell.lines.remove(nextline)
         
     def K_UP(self, event):
         self.cursor.moveup()