Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 00da6a3f1d759e5d4c3679a765a54b38 > files > 3

perl-Curses-UI-0.960.900-2.mga3.src.rpm

--- Curses-UI-0.95/lib/Curses/UI/TextEditor.pm.pix	2004-11-27 18:12:58.000000000 +0100
+++ Curses-UI-0.95/lib/Curses/UI/TextEditor.pm	2006-10-18 13:31:54.000000000 +0200
@@ -494,9 +494,11 @@
             # Get the part of the line that is in view.
             my $inscreen = '';
             my $fromxscr = '';
+	    my $return_ended;
             if ($this->{-xscrpos} < length($l))
             {
                 $fromxscr = substr($l, $this->{-xscrpos}, length($l));
+		$return_ended = chomp($fromxscr);
                 $inscreen = ($this->text_wrap(
 		    $fromxscr, 
 		    $this->canvaswidth, 
@@ -520,13 +522,11 @@
 		" "x$this->canvaswidth
 	    );
 
+	    $this->{-canvasscr}->addstr($id, 0, $inscreen);
+
             # Strip newline and replace by diamond character
             # if the showhardreturns option is on.
-            if ($inscreen =~ /\n/)
-            {
-                $inscreen =~ s/\n//;
-                $this->{-canvasscr}->addstr($id, 0, $inscreen);
-                if ($this->{-showhardreturns})
+            if ($return_ended && $this->{-showhardreturns})
                 {
                     if ($this->root->compat)
                     {
@@ -537,9 +537,6 @@
                     $this->{-canvasscr}->attroff(A_ALTCHARSET);
                     }
                 }
-            } else {
-                $this->{-canvasscr}->addstr($id, 0, $inscreen);
-            }
             
             # Draw overflow characters.
             if (not $this->{-wrapping} and $this->{-showoverflow})