JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
don't wrap after printing in last cell
authorJason Woofenden <jason@jasonwoof.com>
Thu, 31 Jan 2013 04:53:49 +0000 (23:53 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Thu, 31 Jan 2013 04:53:49 +0000 (23:53 -0500)
terminal.coffee

index 37d3971..19296bf 100644 (file)
@@ -92,11 +92,11 @@ class Terminal
                                when '\x0a', '\x0b' # lf, vertical tab (same thing)
                                        @wrap_to_next_line()
                                else
+                                       if @x >= @width
+                                               @wrap_to_next_line()
                                        @text[@y][@x] = c
                                        @attributes[@y][@x] = @a
                                        @x += 1
-                                       if @x is @width
-                                               @wrap_to_next_line()
                return
 
        set_attribute_bits: (mask, value) ->