Summary: | wrong behavior of vi command "s" | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Franklin Weng <franklin> |
Component: | Vi Input Mode | Assignee: | Michal Humpula <michal.humpula> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | michal.humpula |
Priority: | NOR | ||
Version: | 3.11.2 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kate/1e8f5ecdcd04a7d5f69819c644c1c87ded5442fd | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: |
step 1: Original file
step 2: use "8s" to replace the string step 3: type the replacing string step 4: press ESC, and "sdsd" was repeated 8 times. Quick fix for the issue |
Description
Franklin Weng
2013-11-25 03:50:04 UTC
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 |