<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>334612</bug_id>
          
          <creation_ts>2014-05-11 15:17:49 +0000</creation_ts>
          <short_desc>Selecting text and pressing enter doesn&apos;t replace the text but only adds a newline</short_desc>
          <delta_ts>2015-04-29 05:21:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kmail2</product>
          <component>composer</component>
          <version>4.13.1</version>
          <rep_platform>Ubuntu</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Florian E.J. Fruth">spammail01</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          <cc>andysem</cc>
    
    <cc>kamikazow</cc>
    
    <cc>mails.bugs.kde.org-2025-1</cc>
    
    <cc>montel</cc>
          
          <cf_commitlink>http://commits.kde.org/kdepim/dc110d65dcc38af6989ceb3d503271302539c937</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>1</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1447594</commentid>
    <comment_count>0</comment_count>
    <who name="Florian E.J. Fruth">spammail01</who>
    <bug_when>2014-05-11 15:17:49 +0000</bug_when>
    <thetext>After upgrading to kubuntu 14.04 the kmail composer doesn&apos;t replace selected text if you press enter. Instead it just adds a newline at the current position (meaning in front or after the selected text).

Reproducible: Always

Steps to Reproduce:
1. Select a text (e.g. with the mouse or the cursort keys)
2. Press enter
Actual Results:  
Kmail adds a newline

Expected Results:  
Replace the selected text with a newline.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1447597</commentid>
    <comment_count>1</comment_count>
    <who name="Laurent Montel">montel</who>
    <bug_when>2014-05-11 15:32:26 +0000</bug_when>
    <thetext>Ok I understand bug.
I will fix it soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1447635</commentid>
    <comment_count>2</comment_count>
    <who name="Florian E.J. Fruth">spammail01</who>
    <bug_when>2014-05-11 19:05:44 +0000</bug_when>
    <thetext>Sorry for not recognizing this earlier: it seams that this bug only happens if you select text from the signature and press enter. It works fine with the normal email text.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1447719</commentid>
    <comment_count>3</comment_count>
    <who name="Laurent Montel">montel</who>
    <bug_when>2014-05-12 05:46:27 +0000</bug_when>
    <thetext>Git commit dc110d65dcc38af6989ceb3d503271302539c937 by Montel Laurent.
Committed on 12/05/2014 at 05:46.
Pushed by mlaurent into branch &apos;KDE/4.13&apos;.

Fix Bug 334612 - Selecting text and pressing enter doesn&apos;t replace the text but only adds a newline

FIXED-IN: 4.13.1

M  +1    -1    messagecomposer/composer/kmeditor.cpp
M  +1    -1    pimcommon/autocorrection/widgets/lineeditwithautocorrection.cpp
M  +22   -20   pimcommon/autocorrection/widgets/richtexteditwithautocorrection.cpp

http://commits.kde.org/kdepim/dc110d65dcc38af6989ceb3d503271302539c937</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448736</commentid>
    <comment_count>4</comment_count>
    <who name="markuss">kamikazow</who>
    <bug_when>2014-05-15 23:59:20 +0000</bug_when>
    <thetext>No, the bug is sadly not fixed. :-(

Running 4.13.1 under Fedora (kde-unstable packages).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448763</commentid>
    <comment_count>5</comment_count>
    <who name="Laurent Montel">montel</who>
    <bug_when>2014-05-16 06:09:11 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; No, the bug is sadly not fixed. :-(
&gt; 
&gt; Running 4.13.1 under Fedora (kde-unstable packages).

So still update it :)
It&apos;s fixed I already tested it.
As you can see in commit:
&quot; -            if(d-&gt;mAutoCorrection &amp;&amp; !isLineQuoted(textCursor().block().text())) {

   +        if(d-&gt;mAutoCorrection &amp;&amp; !isLineQuoted(textCursor().block().text()) &amp;&amp; !textCursor().hasSelection()) {
&quot;

=&gt; if selection we don&apos;t make autocorrection
=&gt; it&apos;s fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1449306</commentid>
    <comment_count>6</comment_count>
    <who name="Gunter Ohrner">mails.bugs.kde.org-2025-1</who>
    <bug_when>2014-05-18 07:36:59 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; No, the bug is sadly not fixed. :-(
&gt; &gt; Running 4.13.1 under Fedora (kde-unstable packages).
&gt; So still update it :)

He says he&apos;s already running 4.13.1, so to what version is he supposed to update?

I&apos;m also running 4.13.1 on Kubuntu 14.04 (About dialog: KMail Version 4.13.1 unter KDE 4.13.1) and bug clearly is not fixed.

The behaviour if ENTER is pressed is as expected if the line is quoted (which seems to be what your if statement checks), but it&apos;s still wrong if a line is not quoted. In this case, an ENTER or SPACE does not replace the selected text, but simply adds the newline or space character in front of or after the selected text.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1449310</commentid>
    <comment_count>7</comment_count>
    <who name="Gunter Ohrner">mails.bugs.kde.org-2025-1</who>
    <bug_when>2014-05-18 07:40:22 +0000</bug_when>
    <thetext>Mh, can someone re-open this bug, or should I add a new one for KDE 4.13.1?

Also this bug looks like a duplicate of Bug 334571 which also is not fixed in KDE 4.13.1, so maybe it should be tagged / linked accordingly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1449317</commentid>
    <comment_count>8</comment_count>
    <who name="Gunter Ohrner">mails.bugs.kde.org-2025-1</who>
    <bug_when>2014-05-18 08:35:53 +0000</bug_when>
    <thetext>Additional information: If the selection spans multiple lines, some quoted and some not, the behaviour if ENTER or SPACE is pressed does not depend on the selected area but on the row the cursor is positioned in.

If if (parts of) three lines are selected and the cursor is positioned in a quoted line, pressing ENTER or SPACE will replace the selected text by a newline or space character, as expected.

If if (parts of) three lines are selected and the cursor is positioned in a not-quoted line, pressing ENTER or SPACE will simply add a newline or space character in front of or after the selection, contrary to the behaviour of every other GUI text editor I know.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1450411</commentid>
    <comment_count>9</comment_count>
    <who name="markuss">kamikazow</who>
    <bug_when>2014-05-22 11:39:07 +0000</bug_when>
    <thetext>&gt; =&gt; if selection we don&apos;t make autocorrection
&gt; =&gt; it&apos;s fixed.

This bug is called &quot;Selecting text and pressing enter doesn&apos;t replace the text but only adds a newline&quot; and this is a bug that has not been fixed. Maybe there was another bug about autocorrection but this is not it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1450416</commentid>
    <comment_count>10</comment_count>
    <who name="Gunter Ohrner">mails.bugs.kde.org-2025-1</who>
    <bug_when>2014-05-22 11:55:40 +0000</bug_when>
    <thetext>It&apos;s &quot;sort of&quot; fixed if
a) text is selected and
b) you press enter (or space) while the cursor is located in a quoted line.

In this case, the selection is replaced.

If, however, some text is selected and the cursor is NOT in a quoted line while you press enter (or space), then the bug prevails and the selection is NOT replaced.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1455336</commentid>
    <comment_count>11</comment_count>
    <who name="Lastique">andysem</who>
    <bug_when>2014-06-15 11:12:26 +0000</bug_when>
    <thetext>I&apos;ll add to comment 10 that when you select several lines with keyboard, especially at the end of the email you&apos;re replying to, the cursor is typically not on the quoted line, and pressing enter does not remove the selected text. This is really annoying.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1514483</commentid>
    <comment_count>12</comment_count>
    <who name="Gunter Ohrner">mails.bugs.kde.org-2025-1</who>
    <bug_when>2015-04-28 20:01:22 +0000</bug_when>
    <thetext>This bug is fixed in kMail 4.14.2 and 4.14.6, as far as I can tell, and probably can be closed now. :-)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>