guillermooo / Vintageous

Vi/Vim emulation for Sublime Text 3
http://guillermooo.bitbucket.org/Vintageous/
Other
1.64k stars 115 forks source link

:%s/$/,/ not working as expected #1061

Open kuna-matata opened 8 years ago

kuna-matata commented 8 years ago

Hi, I would like to add a comma to the end of each line. In vim I can do ":%s/$/,/". However this does not work the same in sublime. I think it just adds one comma to the very end of the file.

deconvolved commented 8 years ago

I believe this is due to an issue that is fixed in the latest code, however I don't think it has been packaged yet. The underlying Python regex handling wasn't setting MULTILINE mode, and as a result $ was matching only at the end of the string (i.e. the end of the file in the case of %s).

I am using a hand-edited copy of the package that includes the fix, and :%s/$/,/g works as expected.

The project's GitHub page has instructions for building the package from source, however I haven't tried that myself.

AOrazaev commented 7 years ago

I checked last version from repo. This case still don't work.

And I found another funny bug connected with :s. :s/$/foo/gc cause infinite loop of replacements.