changeset 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 cd33c785e80e
children f71191aea679
files libinterp/corefcn/pr-output.cc
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
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 ();