vicoapp / vico

Mac Programmers Text Editor

Home Page:http://www.vicoapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"%s/\n/sometext/g" does not work well

moistrot opened this issue · comments

I found replace "\n" to some text does not work.

What behavior do you see instead?

@moistrot can you please give us an example of your text that doesn't work well with global replace?

I'll be closing this issue if additional details aren't added in the next week or two, just a heads up :)

sorry so late.

any text has "\n" like this:

abcd
efgh

if we exec "%s/\n/,/g" ,then result "abcd,efgh",but it's not. nothing happend.

you can try it.

Got it, thanks!

Yep, looks like we're doing the find/replace linewise rather than on the whole text. Looking into this some more to see if there's a relatively straightforward way to expand that to go more than linewise.

%s/^/,/g worked well.

Yeah, but this is a broader issue with how \n interacts with :s handling in Vico. It means you can't really do multiline find/replace, which is suboptimal. I think I'm nearing a fix.

@moistrot See if using the branch in PR #45 takes care of this for you :)

Whoops, I merged the multiline :s fixes into master a little over a week ago. This should be fixed on master!