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

On April 22nd, 2013, 4:51 a.m. EDT, 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


On April 17th, 2013, 9:30 a.m. EDT, Alex Turbov wrote:

Review request for Kate.
By Alex Turbov.

Updated April 17, 2013, 9:30 a.m.

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).

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!

Diffs

  • part/view/kateviewinternal.cpp (785a7f0)

View Diff