# File lib/rbreadline.rb, line 5708
  def rl_newline(count, key)
    @rl_done = true

    if (@_rl_history_preserve_point)
      @_rl_history_saved_point = (@rl_point == @rl_end) ? 1 : @rl_point
    end
    rl_setstate(RL_STATE_DONE)

    if (@rl_editing_mode == @vi_mode)
      _rl_vi_done_inserting()
      if (_rl_vi_textmod_command(@_rl_vi_last_command).nil?)   # XXX
        _rl_vi_reset_last()
      end
    end
    # If we've been asked to erase empty lines, suppress the final update,
    #   since _rl_update_final calls rl_crlf().
    if (@rl_erase_empty_line && @rl_point == 0 && @rl_end == 0)
      return 0
    end
    if @readline_echoing_p
      _rl_update_final()
    end
    0
  end