diff --git a/libinterp/octave-value/ov-classdef.cc b/libinterp/octave-value/ov-classdef.cc --- a/libinterp/octave-value/ov-classdef.cc +++ b/libinterp/octave-value/ov-classdef.cc @@ -396,15 +396,23 @@ octave_classdef::print_raw (std::ostream else { octave_value val = prop.get_value (m_object, false); - dim_vector dims = val.dims (); - os << std::setw (max_len+2) << nm << ": "; - if (val.is_string ()) - os << val.string_value (); - else if (val.islogical ()) - os << val.bool_value (); + // FIXME: We need a better way to decide what is too wide + // to display and/or display truncated values. The + // octave_value::short_disp function was intended to do + // that, but it doesn't really fit this situation well and + // doesn't appear to properly truncate values. No "..." + // is displayed for numerical arrays that are too wide, + // character arrays don't appear to be truncated, and it + // doesn't respect the width of the terminal window. + + if (val.rows () == 1 && (val.isnumeric () || val.islogical () || val.is_string ())) + val.short_disp (os); else - os << "[" << dims.str () << " " << val.class_name () << "]"; + { + dim_vector dims = val.dims (); + os << "[" << dims.str () << " " << val.class_name () << "]"; + } } newline (os);