~fancycade/tox.cr

af1c25398e23899e097d2ed6dc79311559d372a0 — fancycade 2 years ago 2f9eddc
Add bounds detection for kill line
1 files changed, 6 insertions(+), 1 deletions(-)

M editor.cr
M editor.cr => editor.cr +6 -1
@@ 294,7 294,12 @@ class Editor
    row.delete_at(@cursor_x..row.size)
    if row.empty?
      @rows.delete_at(@start_row + @cursor_y)
      cursor_up()
      if @start_row > 0
        @start_row -= 1
        cursor_end_of_row()
      else
        cursor_up()
      end
    else
      row << '\n'
      cursor_end_of_row()