In vim, I usually use command 's' to substitute a word. For example, "Kate is very good to use." I want to change "very" to "quite", so I'll put the cursor to 'v' and press 's' '4' then input 'quite', and press ESC to exit the edit mode. In Kate's vi mode, if I use it this way, it will become "Kate is quitequitequitequite good to use." after I press ESC. The repeat times is exactly the number what I input after 's'. Reproducible: Always Steps to Reproduce: 1. Select vi mode in Kate 2. Use vi command 's' '5' to remove a 5-chars words 3. input another word and press ESC Actual Results: The input words will show repeatedly. Expected Results: The input words should show only once.
Do you mean "4s" instead of "s4"? The later doesn't seems to work in my vim. What version of vim do you use? The "4s" variant seems to be working in kde 3.11.3 (guessing it will be the same in 3.11.2).
Created attachment 83818 [details] step 1: Original file 1 of 4 screenshots for this bug. Step 1: Put the cursor to the string which will be replaced.
(In reply to comment #1) > Do you mean "4s" instead of "s4"? The later doesn't seems to work in my vim. > What version of vim do you use? The "4s" variant seems to be working in kde > 3.11.3 (guessing it will be the same in 3.11.2). Yes, "4s" instead of "s4". Sorry for my fault. My vim version is 7.3.429. It worked with "4s" command. My kate version is also 3.11.3. The behavior of "4s" is wrong. I'll attach four screenshots to describe this bug.
Created attachment 83819 [details] step 2: use "8s" to replace the string 2 of 4 screenshots: press '8' 's' to replace the string "Franklin". "Franklin" was gone.
Created attachment 83820 [details] step 3: type the replacing string 3 of 4 screenshots: type the replacing string. For example, "sdsd"
Created attachment 83821 [details] step 4: press ESC, and "sdsd" was repeated 8 times. 4 of 4 snapshots: press ESC and the string "sdsd" was repeated 8 times.
Thanks for report! I can replicate this even on devel version, but I think the fix won't be much complicated. Hang in there.
Created attachment 83827 [details] Quick fix for the issue This patch should fix the issue. Applicable against 3.11.3 too.
Git commit 1e8f5ecdcd04a7d5f69819c644c1c87ded5442fd by Michal Humpula. Committed on 29/11/2013 at 14:50. Pushed by michalhumpula into branch 'master'. vi-mode: fix normal mode "s" command repeat make "4sfoo\\esc" work as expected REVIEW: 114205 M +2 -0 part/vimode/katevinormalmode.cpp M +3 -0 tests/vimode_test.cpp http://commits.kde.org/kate/1e8f5ecdcd04a7d5f69819c644c1c87ded5442fd