Mercurial > octave
diff libinterp/corefcn/pr-output.cc @ 22989:698c1190d790
* pr-output.cc (Fdisplay): Use octave_value::print_name_tag.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 02 Jan 2017 09:33:57 -0500 |
parents | b28801182c08 |
children | b98ebcd7f11c |
line wrap: on
line diff
--- a/libinterp/corefcn/pr-output.cc Fri Dec 30 14:03:01 2016 -0500 +++ b/libinterp/corefcn/pr-output.cc Mon Jan 02 09:33:57 2017 -0500 @@ -3642,16 +3642,19 @@ // function. Rely on built-in functions to display whatever obj is. octave_value value = args(0); - bool is_scalar = value.is_scalar_type (); - + + // If print_name_tag displays a newline, then also print one after + // disp is done. + + bool print_newlines = false; if (valid_identifier (name)) - octave_stdout << name << (is_scalar ? " = " : " =\n\n"); + print_newlines = value.print_name_tag (octave_stdout, name); // Use feval so that dispatch will also work for disp. feval ("disp", ovl (value)); - if (! is_scalar) + if (print_newlines) octave_stdout << std::endl; return ovl ();