[EMAIL PROTECTED] wrote:
Okay, enough rambling and on to the question, I have been playing with edit.py example, (and very nice it is too). However, when you have made some text with line breaks, the cursor will not pass through a line break onto the next line. How would I extend the example to fix that?

Try the attached patch.

Ian
Index: edit.py
===================================================================
--- edit.py	(revision 128)
+++ edit.py	(working copy)
@@ -208,8 +208,20 @@
 			# move the cursor to the new line and reset pref_col
 			self.view.keypress(size, "down")
 			self.view.keypress(size, "home")
+		elif k == "right":
+			w, pos = self.walker.get_focus()
+			w, pos = self.walker.get_next(pos)
+			if w:
+				self.listbox.set_focus(pos, 'above')
+				self.view.keypress(size, "home")
+		elif k == "left":
+			w, pos = self.walker.get_focus()
+			w, pos = self.walker.get_prev(pos)
+			if w:
+				self.listbox.set_focus(pos, 'below')
+				self.view.keypress(size, "end")
+			
 
-
 	def save_file(self):
 		"""Write the file out to disk."""
 		
_______________________________________________
Urwid mailing list
[email protected]
http://lists.excess.org/mailman/listinfo/urwid

Reply via email to