module PryState::Printer

def stringified_val_or_nil value, color, length

def stringified_val_or_nil value, color, length
  value = stringify_value value
  if value.empty?
    Pry::Helpers::Text.red 'nil'
  else
    text = truncate(value, length)
    Pry::Helpers::Text.send(color, text)
  end
end