[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: Review Request 110059: Consistent behaviour of wordNext()
From:       "Alex Turbov" <i.zaufi () gmail ! com>
Date:       2013-04-17 13:30:28
Message-ID: 20130417133028.5385.37466 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/110059/
-----------------------------------------------------------

(Updated April 17, 2013, 1:30 p.m.)


Review request for Kate.


Changes
-------

review opened again!


Description
-------

consider the following text snippet:

one                       two                         three|

where the '|' symbol shows an initial cursor position. Now try to press \
Ctrl+Shift+Left, you have to see the last word "three" selected. Pressing once again \
and selection extends to the begining of "two", and so on. Now, move the cursor to \
the line start like this:

> one                       two                         three

and try to press Ctrl+Shift+Right -- after this, cursor gets moved to the begining of \
the word "two"! which is definitely not the `wordPrev()` behave like. Personally I've \
always annoyed this misbehaviour in the following case:

enum sample
{
    some                                                    ///< some
  , other                                                   ///< other
  , |smth_else                                              ///< smth_else
};

having code like this, I'd like to get the word "smth_else" into clipboard, but \
pressing Ctrl+Shift+Right makes selection up to "///<" w/ all that spaces, instead of \
just a sequence of non-space characters! So, I have to make a selection char by char \
towards line end. But, everything is fine in oppisite direction:

enum sample
{
    some                                                    ///< some
  , other                                                   ///< other
  , smth_else|                                              ///< smth_else
};

I'll get exactly that I want to select (w/o leading space)!

If you look into the source (before applying this patch), you can even see that \
'wordPrev()' and 'wordNext()' even look asymmetrical! This patch will fix that and \
everything works as expected!

as a result this patch brings an expected behaviour, just like other (good) software \
has... for example FireFox browser (in textarea or input fields).


Diffs
-----

  part/view/kateviewinternal.cpp 785a7f0 

Diff: http://git.reviewboard.kde.org/r/110059/diff/


Testing (updated)
-------

The modified bahaviour probably may look strange (after the previous _incorrect_) to \
someone, but its a matter of a habit and definitely much more consistent than it was \
before... So review opened again!


Thanks,

Alex Turbov


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/110059/">http://git.reviewboard.kde.org/r/110059/</a>
  </td>
    </tr>
   </table>
   <br />




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Kate.</div>
<div>By Alex Turbov.</div>


<p style="color: grey;"><i>Updated April 17, 2013, 1:30 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">review opened again!</pre>  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">consider the following text snippet:

one                       two                         three|

where the &#39;|&#39; symbol shows an initial cursor position. Now try to press \
Ctrl+Shift+Left, you have to see the last word &quot;three&quot; selected. Pressing \
once again and selection extends to the begining of &quot;two&quot;, and so on. Now, \
move the cursor to the line start like this:

> one                       two                         three

and try to press Ctrl+Shift+Right -- after this, cursor gets moved to the begining of \
the word &quot;two&quot;! which is definitely not the `wordPrev()` behave like. \
Personally I&#39;ve always annoyed this misbehaviour in the following case:

enum sample
{
    some                                                    ///&lt; some
  , other                                                   ///&lt; other
  , |smth_else                                              ///&lt; smth_else
};

having code like this, I&#39;d like to get the word &quot;smth_else&quot; into \
clipboard, but pressing Ctrl+Shift+Right makes selection up to &quot;///&lt;&quot; w/ \
all that spaces, instead of just a sequence of non-space characters! So, I have to \
make a selection char by char towards line end. But, everything is fine in oppisite \
direction:

enum sample
{
    some                                                    ///&lt; some
  , other                                                   ///&lt; other
  , smth_else|                                              ///&lt; smth_else
};

I&#39;ll get exactly that I want to select (w/o leading space)!

If you look into the source (before applying this patch), you can even see that \
&#39;wordPrev()&#39; and &#39;wordNext()&#39; even look asymmetrical! This patch will \
fix that and everything works as expected!

as a result this patch brings an expected behaviour, just like other (good) software \
has... for example FireFox browser (in textarea or input fields). </pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing \
(updated)</h1> <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">The modified bahaviour probably may look strange (after the previous \
_incorrect_) to someone, but its a matter of a habit and definitely much more \
consistent than it was before... So review opened again! </pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>part/view/kateviewinternal.cpp <span style="color: grey">(785a7f0)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/110059/diff/" style="margin-left: \
3em;">View Diff</a></p>







  </td>
 </tr>
</table>




  </div>
 </body>
</html>



_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic