Bug 454312 - Kate Vi mode mouse selection makes cursor position wrong (always +1 column)
Summary: Kate Vi mode mouse selection makes cursor position wrong (always +1 column)
Status: REPORTED
Alias: None
Product: kate
Classification: Applications
Component: Vi Input Mode (show other bugs)
Version: 22.04.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-24 06:23 UTC by red_Arti
Modified: 2022-10-18 20:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
screenshot (60.16 KB, image/png)
2022-05-24 06:23 UTC, red_Arti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description red_Arti 2022-05-24 06:23:08 UTC
Created attachment 149157 [details]
screenshot

SUMMARY

If you have text:
`123456789`
and you want to select 3 to 7 (vi visual mode) and operate (delete/cut/copy/replace)
The "block cursor" is at 7, making it looks like the selection range is 3 to 7
But the true selection range is 3 to 6
That's different than Vim's behavior, making user can't see the real selection range


STEPS TO REPRODUCE
1. Run Kate. Open a text file
2. Set Kate into Vi input mode 
3. Use mouse to select text (it will enter visual mode)
4. Move mouse and select text from left to right, or from up to down

OBSERVED RESULT
The wrong positioned cursor (selection end position + 1 column)  makes user can't see the range correctly.

EXPECTED RESULT
The cursor should be at the last selected character block position, like Vim (see the screenshot)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.2
Graphics Platform: X11

ADDITIONAL INFORMATION

Such wrong positioned cursor won't occur when:
1. Make selection by h, l (left, right) keyboard
2. Select text from right to left, or from down to up
Comment 1 Sarah Wong 2022-10-18 20:25:07 UTC
Attempting a fix here:
https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/430