Bug 309191 - Extra char removed on "select text -> delete selection -> undo -> delete selection", also when editing a placeholder in a snippet
Summary: Extra char removed on "select text -> delete selection -> undo -> delete sele...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: Vi Input Mode (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-29 11:47 UTC by Ivan Shapovalov
Modified: 2013-07-11 18:55 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Shapovalov 2012-10-29 11:47:36 UTC
An extra char is removed after selection when one deletes ("d") a text block previously re-selected by undoing ("u") a deletion of previously manually selected text.
Also this happens when one uses "c" to change a placeholder string when applying a snippet.

Reproducible: Always

Steps to Reproduce:
Starting in Vi's normal mode
1. "i", "test another", Esc
2. "2b", "ve" - selected is the word "test"
3. "d" - the word "test" is deleted, and a space before "another" is left intact
4. "u" - the word "test" is restored and selected again
5. "d" - the word "test" AND the space before "another" are deleted


Expected Results:  
Expected the step (5) to behave like the step (3).

Kate version is 3.9.2, but there is no matching option in "Version" field. KDE version is 4.9.2, Qt's - 4.8.3.
Comment 1 Simon St James 2013-07-11 18:48:02 UTC
Git commit 0a1f61640cb83efdf62344e05f87ced586cff825 by Simon St James.
Committed on 11/07/2013 at 18:40.
Pushed by sstjames into branch 'master'.

Looks like there was a bit of a misunderstanding about how either Kate Ranges, or just selections, actually work: the end of the selectionRange appears to be one space ahead of where I expected.  Fix earlier test, and add test for bug 309191, which was the motivating example for this.

M  +2    -1    part/vimode/katevivisualmode.cpp
M  +5    -2    tests/vimode_test.cpp

http://commits.kde.org/kate/0a1f61640cb83efdf62344e05f87ced586cff825
Comment 2 Simon St James 2013-07-11 18:55:36 UTC
Git commit 4a20941bcde1d048298750173366dadbd7aefc5d by Simon St James.
Committed on 11/07/2013 at 18:40.
Pushed by sstjames into branch 'KDE/4.11'.

Looks like there was a bit of a misunderstanding about how either Kate Ranges, or just selections, actually work: the end of the selectionRange appears to be one space ahead of where I expected.  Fix earlier test, and add test for bug 309191, which was the motivating example for this.

Backport of 0a1f61640c from master.

M  +2    -1    part/vimode/katevivisualmode.cpp
M  +5    -0    tests/vimode_test.cpp

http://commits.kde.org/kate/4a20941bcde1d048298750173366dadbd7aefc5d