Bug 296500 - idea: when text is selected, right-arrow moves to end of selection.
Summary: idea: when text is selected, right-arrow moves to end of selection.
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
: 354696 (view as bug list)
Depends on:
Reported: 2012-03-21 14:46 UTC by Richard Neill
Modified: 2019-03-11 02:48 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.57


Note You need to log in before you can comment on or make changes to this bug.
Description Richard Neill 2012-03-21 14:46:06 UTC
This is a wish/idea for some slightly "smarter" behaviour with the interaction of the arrow-keys and selected text.

If I search for something within a document, say a particular variable name, then it appears highlighted. Pressing the left_arrow moves cursor 1 to the left of the start of the word (this is right); pressing the right_arrow moves the cursor 1 to the right of the start of the word (I think it should go right to the END of the word).

(Similar behaviour should also apply to words selected by double-clicking, or to lines selected by triple-clicking).

An example might make this clearer:  Here is a line of text, in my document. I then use Ctrl-F to search for the word "example", which comes up higlighted. (I've shown it in Caps):

   "Hello World, this is an EXAMPLE of what I mean"
                                           12               3

* Pressing the left_arrow  key moves the cursor to position 1.
* Pressing the right_arrow key moves the cursor to position 2 (at the moment), My wish is for it to be position 3 instead.

The reason for this is that it makes it  faster to make edits during refactoring. For example, if I had some variables named "example1" and "example2", and wanted to search for all instances of "example*" , changing some of them  to "example3". My wish would significantly reduce the number of right-arrow-presses required.

I hope that's clear, and you like my idea. Thanks for a wonderful program.
Comment 1 Richard Neill 2012-03-21 15:07:40 UTC
Oops! My example appears to have line-wrapped,  obscuring what I meant:

"Hello World, this is an EXAMPLE of what I mean"
                                        12               3
Comment 2 Richard Neill 2012-03-21 15:10:06 UTC
Really sorry for the bugspam - it's done it again!

"Hello World, this is an EXAMPLE of what I mean"
                                         12               3

position 1 is after the "n" of "an"
position 2 is after the first "E" of "example"
position 4 is after the last "E" of example.
Comment 3 Lothar 2019-03-08 18:41:50 UTC
Comment 4 Nate Graham 2019-03-08 22:37:35 UTC
*** Bug 354696 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2019-03-11 02:48:29 UTC
Git commit 5c94789d28ea09ad1b340f3ddaba8208886b19d2 by Nate Graham, on behalf of loh tar.
Committed on 11/03/2019 at 02:48.
Pushed by ngraham into branch 'master'.

ViewPrivate: Make deselection by arrow keys more handy

This patch move the cursor to the start or end of the selection
instead of simple one position into the key direction
FIXED-IN: 5.57

Reviewers: #ktexteditor, dhaumann

Reviewed By: #ktexteditor, dhaumann

Subscribers: cullmann, brauch, dhaumann, ngraham, kwrite-devel, kde-frameworks-devel, #ktexteditor

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D19621

M  +61   -0    autotests/src/kateview_test.cpp
M  +2    -5    autotests/src/kateview_test.h
M  +34   -12   src/view/kateview.cpp