def check_margins(length, edit_posn)
      old_margins = [left_margin, right_margin]

      if length < base_width
        set_left_margin(0)
      elsif edit_posn < left_margin
        set_left_margin([edit_posn - scroll_step, 0].max)
      elsif edit_posn > right_margin
        set_right_margin(edit_posn + scroll_step)
      end

      old_margins == [left_margin, right_margin]
    end
def check_margins(length, edit_posn)
      old_margins = [left_margin, right_margin]

      if length < base_width
        set_left_margin(0)
      elsif edit_posn < left_margin
        set_left_margin([edit_posn - scroll_step, 0].max)
      elsif edit_posn > right_margin
        set_right_margin(edit_posn + scroll_step)
      end

      old_margins == [left_margin, right_margin]
    end
Verify/update the window margins. Returns true if they're fine.