[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:       "Matthew Woehlke" <mw_triad () users ! sourceforge ! net>
Date:       2013-04-25 19:41:55
Message-ID: 20130425194155.13727.20559 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On April 22, 2013, 4:51 a.m., Dominik Haumann wrote:
> > Moving to the right now stops before the white spaces after a word. Example:
> > > This is a test
> > Ctrl+Right leads to:
> > This| is a test
> > When I want to continue and select something with ctrl+shift+right, I get
> > This[ is]| a test
> > where [...] is selected. Usually I don't want the white spaces in front of it.
> > 
> > In the current implementation, I get them after the word, though.
> > 
> > Chrome implements it the way your patch works. To be honest, I don't have a \
> > strong opinion on this...

...and Qt widgets do it the way katepart (currently) does it.

I prefer the current behavior :-).


- Matthew


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


On April 17, 2013, 9:30 a.m., Alex Turbov wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110059/
> -----------------------------------------------------------
> 
> (Updated April 17, 2013, 9:30 a.m.)
> 
> 
> Review request for Kate.
> 
> 
> 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
> -------
> 
> 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 />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On April 22nd, 2013, 4:51 a.m. EDT, <b>Dominik \
Haumann</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Moving to the right now stops before the white spaces after a word. \
Example: |This is a test
Ctrl+Right leads to:
This| is a test
When I want to continue and select something with ctrl+shift+right, I get
This[ is]| a test
where [...] is selected. Usually I don&#39;t want the white spaces in front of it.

In the current implementation, I get them after the word, though.

Chrome implements it the way your patch works. To be honest, I don&#39;t have a \
strong opinion on this...</pre>  </blockquote>







</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">...and Qt widgets do it \
the way katepart (currently) does it.

I prefer the current behavior :-).</pre>
<br />










<p>- Matthew</p>


<br />
<p>On April 17th, 2013, 9:30 a.m. EDT, Alex Turbov wrote:</p>








<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, 9:30 a.m.</i></p>






<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 </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