Bug 436621 - Provide option to transpose words
Summary: Provide option to transpose words
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: kwrite (show other bugs)
Version: 20.12.2
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-05 11:48 UTC by daobrien
Modified: 2021-05-24 11:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.83


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description daobrien 2021-05-05 11:48:28 UTC
SUMMARY

In Kate there is an option to transpose characters. It would be great if this were extended to transpose words.

STEPS TO REPRODUCE
1. N/A
2. 
3. 



SOFTWARE/OS VERSIONS

Using Gnome on F33 with various KDE bits installed.

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2021-05-19 15:57:09 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/153
Comment 2 Jan Paul Batrina 2021-05-20 13:05:50 UTC
Git commit 0aa491a9b1d08d6c803f06edfa7add6e5a3181bc by Jan Paul Batrina.
Committed on 20/05/2021 at 11:46.
Pushed by cullmann into branch 'master'.

Add "Transpose Words" feature

Similar to "Transpose Characters", the word at the current cursor
position is swapped with the next word (or the previous word if
there is no next word in the line). Since KateView::word[Left|Right]
is used, the next word would be the word to the right for LTR
layouts and the word to the left for RTL layouts. The cursor's
relative position inside the word is also preserved.

For example, before transpose:
wor|d1  word2

after transpose:
word2 wor|d1

M  +19   -0    src/document/katedocument.cpp
M  +1    -0    src/document/katedocument.h
M  +55   -0    src/view/kateview.cpp
M  +8    -0    src/view/kateview.h

https://invent.kde.org/frameworks/ktexteditor/commit/0aa491a9b1d08d6c803f06edfa7add6e5a3181bc
Comment 3 daobrien 2021-05-24 10:05:48 UTC
Thanks so much for getting this done so quickly. How can I get this into my version of Kate on F33?
Comment 4 Waqar Ahmed 2021-05-24 11:51:30 UTC
You can try the latest nightly and it will have this change hopefully: https://kate-editor.org/get-it