You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
While using interactive confirm-replace with global substitute flag (either specified with /g option or vim.substituteGlobalFlag setting), the plugin adds multiple changes to the first occurrence of the matched pattern in the line and keeps further occurrences in the line unchanged or changes incorrectly. This only is reproduced by a certain rename types, esp. for 'pattern' -> 'pattern-new' or 'pattern' -> 'new-pattern'.
To Reproduce
Steps to reproduce the behavior:
Open any file, find/create a line with the repeating pattern, like these: Occurrence #1: trololo, Occurrence #2: trololo, Occurrence #3: trololo
Run the rename command (make sure you have vim.substituteGlobalFlag = true or use /g flag) and accept all subsitutions for the line (press y):
Attempt 1: :s/trololo/trololo-new/cg
Attempt 2: :s/trololo/new-trololo/cg
Expected behavior
Result for attempt 1: Occurrence #1: trololo-new, Occurrence #2: trololo-new, Occurrence #3: trololo-new
Result for attempt 2: Occurrence #1: new-trololo, Occurrence #2: new-trololo, Occurrence #3: new-trololo
What happened
Result for attempt 1: Occurrence #1: trololo-new-new-new, Occurrence #2: trololo, Occurrence #3: trololo trololololo
Result for attempt 2: Occurrence #1: new-new-new-trololo, Occurrence #2: trololo, Occurrence #3: trololo trololololo
I ran %s/Id/ID/gc then denied the first change (SourceId ==> SourceID) and confirmed the 2nd change (someId ==> someID) . However once the plugin applied my choices I received SourceID: someId , that is it applied to the first match on the line, not the one I confirmed on.
Bug description
While using interactive confirm-replace with global substitute flag (either specified with /g option or vim.substituteGlobalFlag setting), the plugin adds multiple changes to the first occurrence of the matched pattern in the line and keeps further occurrences in the line unchanged or changes incorrectly. This only is reproduced by a certain rename types, esp. for 'pattern' -> 'pattern-new' or 'pattern' -> 'new-pattern'.
To Reproduce
Steps to reproduce the behavior:
Open any file, find/create a line with the repeating pattern, like these:
Occurrence #1: trololo, Occurrence #2: trololo, Occurrence #3: trololo
Run the rename command (make sure you have
vim.substituteGlobalFlag = true
or use/g
flag) and accept all subsitutions for the line (pressy
):Attempt 1:
:s/trololo/trololo-new/cg
Attempt 2:
:s/trololo/new-trololo/cg
Expected behavior
Result for attempt 1:
Occurrence #1: trololo-new, Occurrence #2: trololo-new, Occurrence #3: trololo-new
Result for attempt 2:
Occurrence #1: new-trololo, Occurrence #2: new-trololo, Occurrence #3: new-trololo
What happened
Result for attempt 1:
Occurrence #1: trololo-new-new-new, Occurrence #2: trololo, Occurrence #3: trololo trololololo
Result for attempt 2:
Occurrence #1: new-new-new-trololo, Occurrence #2: trololo, Occurrence #3: trololo trololololo
Environment:
vim vsc 0.16.0
Version: 1.25.1
Commit: 1dfc5e557209371715f655691b1235b6b26a06be
Date: 2018-07-11T15:40:20.190Z
Electron: 1.7.12
Chrome: 58.0.3029.110
Node.js: 7.9.0
V8: 5.8.283.38
Architecture: x64
Ubuntu Linux 18.04
The text was updated successfully, but these errors were encountered: